Skip to content

Instantly share code, notes, and snippets.

@1ou
Created October 10, 2020 19:33
Show Gist options
  • Save 1ou/f4857ed4a7d28e4b613b1c8dc206370d to your computer and use it in GitHub Desktop.
Save 1ou/f4857ed4a7d28e4b613b1c8dc206370d to your computer and use it in GitHub Desktop.
package codeforces;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/*
https://codeforces.com/problemset/problem/?/?
*/
public class aTemplate {
static void solve() {
int n = FS.nextInt();
int[] arr = FS.readArray(n);
FS.printArr(arr);
FS.pt.println(n);
}
public static void main(String[] args) {
int T = FS.nextInt();
for (int tt = 0; tt < T; tt++) {
solve();
}
FS.pt.close();
}
static class FS {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
private static StringTokenizer st = new StringTokenizer("");
static PrintWriter pt = new PrintWriter(System.out);
static String next() {
while (!st.hasMoreTokens())
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
return st.nextToken();
}
static int nextInt() {
return Integer.parseInt(next());
}
static int[] readArray(int n) {
int[] a = new int[n];
for (int i = 0; i < n; i++) a[i] = nextInt();
return a;
}
static int[][] read2Array(int m, int n) {
int[][] a = new int[m][n];
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
a[i][j] = nextInt();
}
}
return a;
}
static long[][] read2ArrayL(int m, int n) {
long[][] a = new long[m][n];
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
a[i][j] = nextInt();
}
}
return a;
}
void printArr(long[] arr) {
for (long value : arr) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static long[] readArrayL(int n) {
long[] a = new long[n];
for (int i = 0; i < n; i++) a[i] = nextInt();
return a;
}
static void printArr(int[] arr) {
for (int value : arr) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static void printArrL(int[] arr) {
for (int value : arr) {
pt.print(value);
pt.print(" ");
}
pt.println();
}
static void print2Arr(int[][] arr, int m, int n) {
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
pt.print(arr[i][j]);
pt.print(" ");
}
pt.println();
}
pt.println();
}
static void print2Arr(long[][] arr, int m, int n) {
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
pt.print(arr[i][j]);
pt.print(" ");
}
pt.println();
}
pt.println();
}
static void close() {
pt.close();
}
static long nextLong() {
return Long.parseLong(next());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment