exec_outcome
stringclasses
1 value
code_uid
stringlengths
32
32
file_name
stringclasses
111 values
prob_desc_created_at
stringlengths
10
10
prob_desc_description
stringlengths
63
3.8k
prob_desc_memory_limit
stringclasses
18 values
source_code
stringlengths
117
65.5k
lang_cluster
stringclasses
1 value
prob_desc_sample_inputs
stringlengths
2
802
prob_desc_time_limit
stringclasses
27 values
prob_desc_sample_outputs
stringlengths
2
796
prob_desc_notes
stringlengths
4
3k
lang
stringclasses
5 values
prob_desc_input_from
stringclasses
3 values
tags
listlengths
0
11
src_uid
stringlengths
32
32
prob_desc_input_spec
stringlengths
28
2.37k
difficulty
int64
-1
3.5k
prob_desc_output_spec
stringlengths
17
1.47k
prob_desc_output_to
stringclasses
3 values
hidden_unit_tests
stringclasses
1 value
PASSED
af84f23dc9fb20510b510257c6640fad
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Fas...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
d7cddefc2a6871d2010fe18f1a8d3630
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; public class A_Immobile_Knight { // For fast input output static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try {br = new BufferedReader( new FileReader("input.txt")); PrintStream out = new PrintStream(new F...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
122597d59dd0cf205c8e53865c271ced
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class SolveJava{ public static void main(String args[]) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-- > 0){ int n = in.nextInt(); int m = in.nextInt(); if(n == ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
3df43e08c2a29f8db7d4628d08c7922c
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int testCsesNumber = scanner.nextInt(); for (int k = 0; k <testCsesNumber ; k++) { int rows = scanner.nextInt(); int coloms = sc...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
813dfe8679d06ae3cb868f999bcbb193
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Practise { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { t --; int r,c; r = sc.nextInt(); c = sc.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
9d8c5edef8a4f9398a778e332828d755
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Isolated { public static void main(String[] args){ Scanner input = new Scanner(System.in); //number of tests int n = input.nextInt(); for (int i = 0; i < n; i++) { int x = input.nextInt(); int y = input.nextIn...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
615fe2e20cbdc80d3d60e59bd55481d9
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int r = sc.nextInt(); int k = sc.nextInt(); System.out.println(Math.min(r,2)+" "+Math.min(k,...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
06128c5d05aae9f1b5a5d27f37ce836e
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); int k = sc.nextInt(); System.out.println(Math.min(n,2)+" "+Math.min(k,...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
439f910e5fad68cb6e065521e562ee3b
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); int m = sc.nextInt(); System.out.println(Math.min(n,2)+" "+Math.min(m,...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
643a239772d3b4be2714de68aed91511
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class Mainn { static long M = (long) (1e9 + 7); static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( new InputStreamReader(System...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
995cbdae88a10d28a83dae486ab3571d
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Solution { static boolean check(int i,int j,int r,int c){ if(i<1 || j<1 || i>r || j>c)return false; return true; } public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); while(t...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1df4bdfc3be34597f42ffc940733537c
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* package codeForces; // don't place package name! */ // algo_messiah23 , NIT RKL ... import java.util.*; import java.lang.*; import java.io.*; import java.math.*; import static java.lang.System.*; import java.util.stream.IntStream; import java.util.Map.Entry; /* Name of the class has to be "Main" only ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
bf13971f24ccad8b3652540e340a5fd4
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class HelloWorld { public static void main(String args[]) { Scanner scanner=new Scanner(System.in); int t=scanner.nextInt(); while(t-->0) { int n=scanner.nextInt(); int m=scanner.nextInt(); String s="1 1"; outer: for(int i=1;i<n+1;i++) { for(int j=1;j<m+...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1559fddb368ab7fe10fcd0c57db91bdc
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.lang.Double.parseDouble; import static java.lang.Math.PI; import static java.lang.Math.min; import static java.lang.System.arraycopy; import static java.lang.System.exit; import static java.util.Arrays.copyOf; ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
e1b29de99ddb747b6a855edb23294286
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws FileNotFoundException,IOException, InterruptedException { Scanner s=new Scanner(System.in); PrintWriter pw=new PrintWriter(System.out); int t=s.nextInt(); for (int tt=1; ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
00d650c5f880c2e9c2647d822fe9a4d8
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public final class Codeforces1 { public static void main (String[] args) throws java.lang.Exception { FastReader sc = new FastRead...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c8c59d8c90701ca63f2601be06102060
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static int INF = 0x3f3f3f3f, mod = 1000000007, mod9 = 998244353; public static void main(String args[]){ try { PrintWriter o = new PrintWriter(System.out); boolean multiTest = true; // init ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
d021c8927ec6ce5c4614a78578ff7d42
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static int INF = 0x3f3f3f3f, mod = 1000000007, mod9 = 998244353; public static void main(String args[]){ try { PrintWriter o = new PrintWriter(System.out); boolean multiTest = true; // init ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
68d8494d2eef184fa928081a35b1bc51
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static final long MOD=(long)1e9+7; static final int MAX_TC=(int)1e5+6; static final boolean MULTI_TC = true; static FastReader sc; //===========================MAIN======================================// public static void ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
7339e51268af249d50908d460ace1426
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); //число наборов входных данных String ans[] = new String[t]; //массив ответов for(int i = 0; i < t; i++){//если клетки не нашлось, выведет...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
25c68752610ec6c84783b70fbbdafbb3
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class MyClass { public static void main(String args[]) { Scanner reader=new Scanner(System.in); int T=reader.nextInt(); while (T-->0) { int n=reader.nextInt(); int m=reader.nextInt(); if (n==1 || m==1) ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
00ec9ed49347727f9fc5dcc94dd87b18
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class MyClass { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0) { int n = sc.nextInt(); int m = sc.nextInt(); boolean flag = true; ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
96e7bf46b02a64d8239a80a8cca447be
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class ques1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); int l = sc.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
bb4649e70bb2de79ccc93e408c4d0c34
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
// Working program with FastReader import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; import java.util.*; public class UtopianLord { stat...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
a2e3ea118ba6f2447a9af46f94f13c4f
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner ai = new Scanner(System.in); int a = ai.nextInt(); for(int i = 0; i < a; i++) { int n = ai.nextInt(); int m = ai.nextInt(); if(n == 1 || m == 1 || n == ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
5dfe6b198bec45482c7902108009f278
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Solution1 { static Scanner scn = new Scanner(System.in); public static void main(String[] ScoobyDoobyDo) { int t = scn.nextInt(); // int t = 1; for (int tests = 0; tests < t; tests++) solve(); } public static void solve(...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
81876abb37951c1373f5689169791545
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Solution { static Scanner scn = new Scanner(System.in); public static void main(String[] args) { int t = scn.nextInt(); int temp = t; while (t-->0) { int n = scn.nextInt(); int m = scn.nextInt(); boolea...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c51dd21d3d1ceeaa469adc3a4efc1f53
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.HashMap; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- >0){ int n = sc.nextInt(); int m = sc.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c185a427b79a3f896d48fd5dfc076439
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
8869ffa8a4c08331849600230ef14b6d
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class codeforces { static PrintWriter pw = new PrintWriter(System.out); static FastReader sc = new FastReader(); public static void ma...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
ca771a975f8684d7ba91891a25b3c0ae
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import static java.lang.Math.*; import static java.lang.System.*; import java.io.*; import java.util.*; public class Q1{ public static void main(String[] args)throws IOException { // Use one of them Scanner sc = new Scanner(System.in); // BufferedReader br = new BufferedReader(new InputStrea...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1e372e25356b5d8364a5e21158c0aeee
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* IF I HAD CHOICE, I WOULD HAVE BEEN A PIRATE, LOL XD ; _____________############# _____________##___________## ______________#____________# _______________#____________#_## _______________#__############### _____##############______________# _____##____________#_____################ ______#______##########...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
b1b19a098b9eea11c006c9517420473c
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class cp { public static void main(String[] args) { int t = inp(); while(t-->0){ var tmp = inp(2); out((tmp[0]%2==1?(tmp[0]+1)/2:tmp[0]/2)+" "+(tmp[1]%2==1?(tmp[1]+1)/2:tmp[1]/2),false); } } public static long fd(long n){ return n%10; } public static long[] inpl...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
071074273122a31a2ae8431a4324a01c
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class A { public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
f0a46f3ce67959b87a21b23b245b6bf2
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static long gcd(long a,long b) { if(a==0) return b; return gcd(b%a,a); } public static long lcm(long a,long b) { return (a*b)/gcd(a,b); } public static long [] arrayInput(BufferedReader br,int n) throws java.lang.Exceptio...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
68c2ab49273a9e98eea704cf987b5d1c
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; /** * * @author eslam */ public class Solution { // Beginning of the solution static Kattio input = new Kattio(); static BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out)); static ArrayList<...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
6efa44772bb2262d8cd89b84612a20af
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author dauom */ public class Main...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
7ffe36e784b151709d1f1d308e2e5655
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static long mod = (int)1e9+7; // static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void main (String[] args) throws java.lang.Exception { FastReader sc =new FastReader(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1a0d040aceaafc518083d36f46684672
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/** * @author Nitin Bhakar * */ import java.io.*; import java.util.*; public class Codeforces{ static long mod = 1000000007L; static int ninf = Integer.MIN_VALUE; static int inf = Integer.MAX_VALUE; static void swap(int[] a,int i,int j) {int temp = a[i]; a[i] = a...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c04f9deb2f5b7631ed3d452f48852d63
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; public class practice { static char vowels[] = new char[]{'a', 'e', 'i', 'o', 'u'}; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new Print...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
350f71c51cd8da3b4b4d12d6f027c28b
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in= new Scanner (System.in); int t=in.nextInt(); while(t--!=0){ int r=in.nextInt(); int c=in.nextInt(); if(r==1 || c==1) System.out.println(r+" ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
caed59a4ba10293b5972b551188d79b2
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.util.*; import java.io.*; import java.math.*; public class Hello { static long mod = Long.MAX_VALUE; public static void main(String[] args) { OutputStream outputStream =...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c8b5a8d541cf9ba0380de1fe8c690f5d
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class testing11 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for(int w = 0; w < t; w++){ int row = in.nextInt(); int col = in.nextInt(); boolean flag = fals...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
14d6719c05c37443b23a3019e6926031
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class ImmobileKnight { public static void main(String[] args) { var scan=new Scanner(System.in); int t =scan.nextInt(); for (int i = 0; i < t; i++) { int n=scan.nextInt(); int m=scan.nextInt(); printSol(n,m); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
8ce73811a280266f8338c7597ff66217
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class ImmobileKnight{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=1;i<=t;i++) { int n=sc.nextInt(); int m=sc.nextInt(); if(Math.max(n,m)==3...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
13e2c35feb96032c5003c927da99cc86
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class behenkalora { public static void main(String args[]) { Scanner rdj = new Scanner(System.in); int t = rdj.nextInt(); while(t-->0) { int n =rdj.nextInt(),m =rdj.nextInt(); int k=Math.min(n,2),l=Math.min(m,2); System...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
fd759344018a2cb0f59b1fc7d6d1e971
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class ECR136A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for (int i = 0; i < t; i++) { int n = in.nextInt(); int m = in.nextInt(); if ((n == 2 && m == 3) || (n == 3 && m == 2) || (n == 3 && m == 3)) ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
7bd62cfa3066f3a5b149a2b1a2067350
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; import java.util.Arrays; import java.util.HashSet; import java.util.HashMap; import java.util.ArrayList; import java.util.Collections; import java.util.Random; import java.util.TreeSet; import java.util.PriorityQueue; public class Solution{ public static void main(String[] args){...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c36cd6fb459a9a749f374ec46df42096
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0){ int n = sc.nextInt(); int m = sc.nextInt(); if(n <= 3 && m <= 3) System.out.println((n == ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
da8ddcc894487ae944054efbb0821ae8
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import com.sun.source.tree.Tree; import java.io.*; import java.util.*; public class Main { // private static int[][] dirs = {{-1,-1}, {1, 1}, {-1, 1}, {1, -1}}; private static int[][] dirs = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}}; private static long inf = (long) 1e13; private static lon...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
a916807ad8904eb2b26dabb122b74169
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class A1739 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n, m; n = sc.nextInt(); m = sc.nextInt(); boolean isolatedCellFound = fals...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
bc3c3a4f5d7ef1aa14a89323a7424386
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Knights{ public static void main(String[] args){ Scanner sc =new Scanner(System.in); int t =sc.nextInt(); while(t-- > 0){ int n = sc.nextInt(); int m =sc.nextInt(); n = n/2+1; m =m/2+1; ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
16915cd7441fa045e2f32298be137f9e
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; import java.util.StringTokenizer; import java.math.BigInteger; public class Main{ ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
327f362971339d5d89359e81022f0c21
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class CodeForces { static private final String INPUT = "input.txt"; s...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
618e5b9a082faf6d5a575bb378f089e1
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Knight { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int a=sc.nextInt(),b=sc.nextInt(); if((a==3 && b==3)||(a==3 && b==2 )||(a==2 && b==3)) ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
3bb1d91efb1ca82a3b0e3ddd9858c50a
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Knight { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int a=sc.nextInt(),b=sc.nextInt(); if(a==1||b==1||a==2 && b==2) System.out.print...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
225090c254cf9d256c9dadc39e3770a1
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Scanner; public class ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
f668c6207fefac733ad2adcba2451c51
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import javax.print.event.PrintEvent; public class A { static int row[] = { -2, -1, 1, 2, -2, -1, 1, 2 }; static int col[] = { -1, -2, 2, 1, 1, 2, -2, -1 }; static void...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
902e2813e58ec739e79bffb740ed048a
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t= sc.nextInt(); while(t-->0){ boolean flag = false; int n=sc.nextInt(); int m=sc.nextInt(); for(int i=1;i<=n;i++){ ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
4ffc178369c5c207414b7111cbd2c07b
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class codeforces { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); int m=sc.nextInt(); if(1<=n && m<=8) { System.out.p...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
78f83c88200b3f552f788f982cfaec78
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); while(w-->0) { int n = t.nextInt(); int m = t.nextInt(); StringBuilder ans = new StringBuilder(); if(n==1 || m==1) { ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
5f7abc5678098f52e06fe775952213b9
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.util.Scanner; import java.io.*; import java.math.BigInteger; import java.util.stream.*; import java.util.ArrayList; import java.lang.*; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arr...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
efb0901586592674e7087188e914ce3b
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class ImmobileKnight { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int i=0;i<t;i++){ int a = sc.nextInt(); int b = sc.nextInt(); if(a>1 && b>1){ ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
a05a67873351bdf1047eb1e711cf6436
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Codeforce { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int m=sc.nextInt(); if(n==1 || m==1) ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
4590c7cef5bf6bb2ba96d3d0f0f10d91
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class code { public static void main(String[] args) { Scanner hs = new Scanner(System.in); int t= hs.nextInt(); int n[]= new int[t]; int m[]= new int[t]; for (int i=0;i<t;i++) { n[i] = hs.nextInt(); m[i] = hs.nextInt(); }...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
5561d15db5736085824a1e21c5d71392
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class code { public static void main(String args[]) throws Exception { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt()...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
0ecc73ea078625649dfaed5930dd1510
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.sql.PreparedStatement; import java.util.*; public class Main { static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next()...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
5904fa985b6ad1bda77d42c76d661bdf
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.System.*; public class M { public static void main(String[] args) { FastScanner x = new FastScanner(); int t = x.nextInt(); while (t-- > 0){ Long max = (long) Integer.MIN_VALUE; Long min = (lon...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
3f09f6f627dab68e7d427ae465420e94
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0){ int n = sc.nextInt(); int m = sc.nextInt(); if(n<3 || m<3){ if(n == 2 && m == 3) ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1461f74f180f2602d44e965af605a93e
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class ArrayFilling { public static void main (String []args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int m=sc.nextInt(); boolean flag=true; for(int i=0;i<n;...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
59be63f54c0fb32c89697e332b1a28b5
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ //public class codechef public class Codechef { public static void main (String[] args) throws java.lang.Exception { ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
748ed8d2c942b22b78d6b3076540a496
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0 ; i < t ;i++){ int n = sc.nextInt(); int m = sc.nextInt(); if((n >= 3 && m >=4) || (n >= 4...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
2ecfa9f61a463d12a823ae0394120818
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.HashMap; import java.util.StringTokenizer; public class A { static FastScanner fs = new FastScanner(); public static void main(String[] args) { int tc = 1; // int tc...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
8ec474efc0d508205030c1686cfef0f1
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class A1739 { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); for(int z=1;z<=t;z++){ int n=sc.nextInt(); int m=sc.nextInt(); if(n==...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
d6c757cbe1f88a2b307fd5ea535612dd
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* ⣿⣿⣿⣿⣿⣿⡷⣯⢿⣿⣷⣻⢯⣿⡽⣻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠸⣿⣿⣆⠹⣿⣿⢾⣟⣯⣿⣿⣿⣿⣿⣿⣽⣻⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣻⣽⡿⣿⣎⠙⣿⣞⣷⡌⢻⣟⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣿⣿⡄⠹⣿⣿⡆⠻⣿⣟⣯⡿⣽⡿⣿⣿⣿⣿⣽⡷⣯⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣟⣷⣿⣿⣿⡀⠹⣟⣾⣟⣆⠹⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢠⡘⣿⣿⡄⠉⢿⣿⣽⡷⣿⣻⣿⣿⣿⣿⡝⣷⣯⢿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣯⢿⣾⢿⣿⡄⢄⠘⢿⣞⡿⣧⡈⢷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⢸⣧⠘⣿⣷⠈⣦⠙⢿⣽⣷⣻⣽⣿⣿⣿⣿⣌⢿⣯⢿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣟⣯⣿⢿⣿⡆⢸⡷⡈⢻⡽⣷⡷⡄⠻⣽⣿⣿⡿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣿⣿⣏⢰⣯⢷...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
d843662d1513d0974c81c0920b65e837
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
// import java.lang.reflect.Array; // import java.math.BigInteger; // import java.nio.channels.AcceptPendingException; // import java.nio.charset.IllegalCharsetNameException; // import java.util.Collections; // import java.util.logging.SimpleFormatter; // import java.util.regex.Matcher; // import java.util.regex...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
72a4b30c58e8acc2847c6b5fc5fb560e
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
// A. Immobile Knight import java.util.*; import java.lang.*; import java.io.*; import java.util.*; import java.io.*; public class Main { static StringBuilder sb; static dsu dsu; static long fact[]; static int mod = (int) (1e9 + 7); static void solve() { int n = i(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
21c2e9f1f654310d8d17e7d2b36b22f6
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class acmp2 { public static void main(String[] args) { Scanner fastScanner = new Scanner(System.in); int m= fastScanner.nextInt(); while (m-->0) { int n = fastScanner.nextInt(); int n2 = fastScanner.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
ce768f5c34588e9b72f620ba1f93de5a
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class CodeForces { public static void mergeSort(String[] a, int from, int to) { if (from == to) { return; } int mid = (from + to) / 2; // sort the first and the second half mergeSort(a, from, mid); m...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
6d973e0d86654d80c5789047682926cf
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class ProblemA { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); int m = sc.nextInt(); if(n < 3 || m < 3){ ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
775c964167f300a43ac48c135d30e5a3
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Main { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.i...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
da08dfb7668dd4dce1a2f8320598926f
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class cc { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int testcase = scan.nextInt(); for(int i = 0 ; i < testcase; i++){ int row = scan.nextInt(); int column = scan.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c9bb1b4a1525b95dcc3c5071ee623044
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class CodeForces { public static void mergeSort(String[] a, int from, int to) { if (from == to) { return; } int mid = (from + to) / 2; // sort the first and the second half mergeSort(a, from, mid); m...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 11
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
d17217948e0715a52f52d5bb80957d1d
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.*; public class Main { public static void swap (int [] arr , int i , int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } public static void main(String[] args) throws IOException { OutputStreamWrit...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
c9dddf50a8684d8635c1c86937aaad35
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.*; public class Main { public static void swap (int [] arr , int i , int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } public static void main(String[] args) throws IOException { OutputStreamWrit...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
0eb205db8f8553317e13fe3d9b37bce5
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.*; public class Main { public static void swap (int [] arr , int i , int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } public static void main(String[] args) throws IOException { OutputStreamWrit...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
d5a54a4e0badc45fd8142b4281cd0208
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.*; public class Main { public static void swap (int [] arr , int i , int j) { int temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } public static void main(String[] args) throws IOException { OutputStreamWrit...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
9c823f2dcf2d5ff4dc64d5284bec1640
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { FastScanner input = new FastScanner(); Algorithm algorithm = new Algorithm(); int t = input.nextInt(); while (t-- > 0) { int n = input.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
5410022fc92df19334a66c3cfbb96171
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
//package first_project; import java.util.*; public class First_project { public static void main(String[] args) { Scanner input = new Scanner(System.in); int r,c,size; size = input.nextInt(); for (int i = 0; i < size; i++) { r = input.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
04c1547d4455e75e7d89d9bb2890ed09
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class First_project { public static void main(String[] args) { Scanner input = new Scanner(System.in); int r,c,size; size = input.nextInt(); for (int i = 0; i < size; i++) { r = input.nextInt(); c = input.nextInt(); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
13fb04e52f81e8b2d7ca02fe4da84717
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class Main { static PrintWriter out; static int MOD = 1000000007; static FastReader scan; /*-------- I/O usaing short named function ---------*/ public static String ns() { return scan.next(); } public static int ni() ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
6f8e5e4c9165d3068abb85b5f33773d3
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class immobileKnight{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T>0){ int n = sc.nextInt(); int m = sc.nextInt(); if((n==1)||(m==1)){ System....
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
f79f25a1d10197ecce7b4c459da73796
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
//package hello; import java.util.*; public class Codeforces { public static void main(String[] args) { int[][] dir = {{-2,1},{-1,2},{1,2},{2,1},{2,-1},{1,-2},{-1,-2},{-2,-1}}; Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1131d720aa81f789225977c6b4aa9fad
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class acmp { public static void main(String[]args) { Scanner sc = new Scanner(System.in); int a=sc.nextInt(); for (int i = 0; i < a;i++) { int m=sc.nextInt(); int n=sc.nextInt(); if(n>1 && m>1){ ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
979979d512244e1d6f74fa485299f29c
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.*; public class code { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int t= sc.nextInt(); while(t-->0){ solve(); } } static void solve() { int n=sc.nextInt(); int m=sc...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
7d248a77f1dbc0c1ac148cda9b7e9dd1
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.io.PrintWriter; public class MyClass { public static void main(String[] args) { InputReader scanner = new InputReader(System.in); ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
1b59d00d9c0d1301a619fa20761b157f
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.io.*; import java.util.*; public class CF { public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int T=Integer.parseInt(br.readLine()); while(T-->0) { String[] s=br.readLine().split(" "); in...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
415c0e8cbc8a826084681cae183ffaad
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
//shynkakakakkakakakak import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for (int i = 0; i < a; i++) { int b = sc.nextInt(); int c = sc.nextInt(); if (b ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
e3b5a1fd0fd1b7b599c3dba225d32faf
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
//shynkakakakkakakakak import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for (int i = 0; i < a; i++) { int b = sc.nextInt(); int c = sc.nextInt(); if (b ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output
PASSED
2eaef46a44c6ba4851bb6bdf6cebe913
train_109.jsonl
1664462100
There is a chess board of size $$$n \times m$$$. The rows are numbered from $$$1$$$ to $$$n$$$, the columns are numbered from $$$1$$$ to $$$m$$$.Let's call a cell isolated if a knight placed in that cell can't move to any other cell on the board. Recall that a chess knight moves two cells in one direction and one cell ...
256 megabytes
import java.util.Scanner; public class Knight { public static void main(String arg[]) { Scanner scan=new Scanner(System.in); int n=scan.nextInt(); for(int i=0;i<n;i++) { int x=scan.nextInt(); int y=scan.nextInt(); if(x==3||y==3) { if(x==1||y==1) System.out.println(1+" "+1); else ...
Java
["3\n\n1 7\n\n8 8\n\n3 3"]
2 seconds
["1 7\n7 2\n2 2"]
NoteIn the first testcase, all cells are isolated. A knight can't move from any cell of the board to any other one. Thus, any cell on board is a correct answer.In the second testcase, there are no isolated cells. On a normal chess board, a knight has at least two moves from any cell. Thus, again, any cell is a correct ...
Java 8
standard input
[ "implementation" ]
e6753e3f71ff13cebc1aaf04d3d2106b
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 64$$$) — the number of testcases. The only line of each testcase contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 8$$$) — the number of rows and columns of the board.
800
For each testcase, print two integers — the row and the column of any isolated cell on the board. If there are no such cells, print any cell on the board.
standard output