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
952d664bdfe3b90e7ca164e8f110a58a
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 Yoo { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-->0) { int a = in.nextInt(); int b = in.nextInt(); if(a<4 && b<4 && a!=1 && b!=1) System.ou...
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 17
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
6a84b304cbbfc8827d413ac589a4d319
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 CP { static Scanner scan = new Scanner(System.in); public static void solve() { int n,m; n = scan.nextInt(); m = scan.nextInt(); if(n==1 || m==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 17
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
a2d369a9ccc26559d08cb9a4681060be
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 cp1 { static void islocked(int i,int j){ if(i==1 || j==1 || (i<=3 && j<=3)){ if((i==3 || j==3)&& i!=1 && j!=1){System.out.println(2+" "+2);} else {System.out.println(i+" "+j);} } else{ System.out.println(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 17
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
736cf1633f591bdf39aefb967ffe2a9c
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_Immobile_Knight{ 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==2 || n==3) && (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 17
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
57cdcf8338a36bb7058f53789d23bc06
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
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***********************************************...
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 17
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
a102d845b112f2a67a345c14b7c82444
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.List; import java.util.Scanner; /** * @author Nikolay Chistykov */ public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int t = sc.nextInt(); while (t-- > 0) { ...
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 17
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
96584a204f941b8a0499e77542d4060e
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 Solve { static Scanner sc = new Scanner(System.in); private static void solve() { int n = sc.nextInt(); int m = sc.nextInt(); System.out.println((n + 1) / 2 + " " + (m + 1) / 2); } public static void main(String[] args) { int tt = sc.nextInt(); while (tt-- > 0) { so...
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 17
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
68a923379bd81fbd9a0d7e4653cd1f71
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 a1739 { 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>=2 && n<=3 )&&(m>=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 17
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
66dc159a733d6f9a82fdee22404cfc1c
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; public class Main { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int tcs, n, m; static StringTokenizer st; 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 17
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
511ca41237c1fcd9a4be7cbddd0c88e8
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.Math; public class BeingZero2 { public static void main(String args[]){ Scanner sc=new Scanner(System.in); int t,n,m; t=sc.nextInt(); while(t-->0) { n=sc.nextInt(); m=sc.nextInt(); if(n==1 || m==1) { System.out.println(n+" "+m); } 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 17
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
c2b2c988f3a55c6d0d4d1e2b812bd18f
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 Abai { 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.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 17
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
a48271d074e57ad41828c9749aeed9fb
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 problem { 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.out.println...
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 17
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
cd32c9d831fdb50c17187b53919cc1dc
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(); int min = Math.min(m, n); int max = 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 17
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
afe6083781573beb049620171cbebff7
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==2 && m==2) || (n==3 && m==2) || (n==2 && m==3)||(n==3 && m==3)) 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 17
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
9fc1f3f52a4f78f5eded33c6e4e95bdc
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 S1 { public void solve(int a, int b, PrintWriter out) { if (a == 1) { out.println("1 1"); return; } if (b == 1) { out.println("1 1"); return; } if (a * b > 9...
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 17
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
67ecf197af5d4bdf3a1d0d0b8940ac70
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.math.BigInteger; import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; import static java.lang.System.*; import static java.lang.System.out; import static java.lang.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 17
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
dbdee3322bfbb5c5d3ae4107fcc39d6c
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 vivek * <> */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class A { private static void solveTC(int __) { /* For Google */ // ans.append("Case #").append(__).append(": "); //code start...
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 17
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
2342ca1869616293fd0b60c5b2ca8e8f
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 in=new Scanner(System.in); int t=in.nextInt(); { while(t--!=0) { int row=in.nextInt(); int col=in.nextInt(); so...
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 17
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
62dfae86b774adca80b0fc69aee827ea
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
// Source: https://usaco.guide/general/io import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while(t-->0){ int r = sc.nextI...
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 17
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
df04ef3bc2a41683ec49060b59d4568e
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
// Source: https://usaco.guide/general/io import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while(t-->0){ int r = sc.nextI...
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 17
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
29d885ce19111b1dd6e88e47e8a395cc
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 AInmobileKnight { public static void main(String[] args) { Scanner s = new Scanner(System.in); try{ Thread.sleep(50); }catch (InterruptedException e){} int testcase = Integer.parseInt(s.nextLine()); // Review each...
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 17
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
0ec99b5b4b8d9ffbcf468380e2370a9e
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.Collections; import java.util.PriorityQueue; import java.util.Scanner; public class oooo { 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.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 17
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
7fe2129dc44da19d84d537af1e9b4313
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 A1739 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); int n = 0,m = 0; int[][] mas = new int[t][2]; for (int i = 0; i < t; i++) { n = in.nextInt(); m = in.nextInt(); if (n*m >= 12) { mas[i][0] ...
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 17
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
aa67ea57725b67d637376b1b96325b4c
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.reflect.Array; import java.util.*; public class A { static int mod = (int) (1e9 + 7); public static void main(String[] args) throws IOException { // Scanner sc = new Scanner(new File("second_hands_input.txt")); // PrintWriter pw = new PrintWriter("seco...
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 17
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
87bc0b516cacae5f056e9ba2372117ee
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 Pset51 { 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 (Math.max(n, m) == 3) { if (Math.min(n, m) == 1) { 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 17
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
c7ac8cadcc4af21d3b81bafe67b778d8
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.max; import static java.lang.Math.min; import static java.lang.Math.*; import static java.lang.System.*; public class CP0025 { public static void main(String args[]) throws Exception { PrintWriter pw = new 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 17
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
2d0b37ccd6cdb48fa429fc91e5091954
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 immobileKnightCF{ 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 == 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 17
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
886a28ed8d6718a929c032635b86998f
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 newScanner = new Scanner(System.in); int testcases = newScanner.nextInt(); for(int i = 0; i<testcases; i++){ int rows = newScanner.nextInt(); int columns = newScanner.ne...
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 17
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
d655cd2ed416681008093ae23a349190
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 Chess { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int test =sc.nextInt(); while (test > 0) { int n = sc.nextInt(); int m = sc.nextInt(); int count = 0; int 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 17
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
42a8e8a3ecfb317ff5ce97c3f704eb4d
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 scn=new Scanner(System.in); int t=scn.nextInt(); while(t-->0){ int n=scn.nextInt(); int m=scn.nextInt(); int f=0; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ ...
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 17
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
8b7f520492ad1ebd3fc9f9dc39ba2757
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 ac { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for (int i = 0; i<a; i++){ int aa = sc.nextInt(); int bb = sc.nextInt(); if (aa==3 && bb==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 17
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
6b4c00e588066a7c6024dc5a74bb0c6e
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 input = new Scanner(System.in); int t = input.nextInt(); for(int i=0;i<t;i++){ int n = input.nextInt(); int m = input.nextInt(); int nn = n%2==0?(n/2):((n+1)/2); int ...
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 17
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
1725c0918a662f0e53a53e1b1f6f57f4
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 A { static InputReader in; static OutputWriter out; public static void main(String[] args) { in = new InputReader(System.in); out = new OutputWriter(System.out); if (System.getProperty("ONLINE_JUDGE") == null) { ...
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 17
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
5827d89fb1c0d2c840abb4fa45c2a170
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
//My code is my Identity import java.util.Arrays; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; public class prog4 { /** * @param args */ public static void main(String...
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 17
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
c40e56905443f27e6fd68686ac249423
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 A { final static boolean multipleTests = true; Input in; PrintWriter out; public A() { in = new Input(System.in); out = new PrintWriter(System.out); } public static void main(String[] args) { A solution =...
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 17
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
a76771561c357feb474bd1a3c560d4e2
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 Solution extends Helper { private static SuperFastReader sc = new SuperFastReader(); // private static final FastReader sc = new FastReader(); // private static final Scanner sc = new Scanner(System.in); private static PrintWriter out = new PrintWriter...
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 17
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
6118d6f049a372294ef093647226593f
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
//https://codeforces.com/contest/1739/problem/0 import java.util.*; public class Immobile_Knight_1739A { 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.nextI...
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 17
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
3329f3e86f2fde1e2d1d2b6de709b070
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 { /** * @param args */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); // List<Integer> arrx=new ArrayList<>(); // List<Integer> arrt=new ArrayList<>(); // Li...
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 17
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
3407bd9038eefde3988017f5917acc69
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 CF_1736A_ImmobileKnight { public static void f(int n,int m) { if(n<=2&&m<=2) { System.out.println(1+" "+1); return; } else if((n==3&&m==2)||(m==3&&n==2)||(m==3&&n==3)){ System.out.println(2+" "+2); return; }else { System.out.println(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 17
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
1cea4c650df450284203078ac059daee
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.io.InputStreamReader; import java.lang.reflect.Array; import java.util.*; import static java.lang.Math.*; public class NewProgramJava { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new ...
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 17
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
319654b5d5a43c961f5c71870a031568
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
// 09/11/2022 import java.util.*; public class A1739 { 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((n + 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 17
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
e1782f159e465e1537f62f5f78dbfbbe
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[] args) { Scanner scan = new Scanner(System.in); int cases = new Integer(scan.nextLine()); for (int i = 0; i < cases; i++) { String[] tokens = scan.nextLine().split(" "); int ...
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 17
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
8801fc7a1820758bcbb8148d5bc21aa7
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 input = new Scanner(System.in); int nbofcases = input.nextInt(); for (int q = 0; q < nbofcases; q++) { int clmns = input.nextInt(); int rows = 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 17
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
9987ea914f5a7f0fd68b738fd2728dd7
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.StringTokenizer; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner scan = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = scan.nextInt(); while (t-- > 0) { int n = scan....
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 17
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
e9cc5e66ae3907777c964b89ba0681c2
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 Solve { static Scanner sc = new Scanner(System.in); private static void solve() { int n = sc.nextInt(); int m = sc.nextInt(); System.out.println((n + 1) / 2 + " " + (m + 1) / 2); } public static void main(String[] args) { int tt = sc.nextInt(); while (tt-...
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 17
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
d68e771ce6dfd72376de6fd7eeb23d8c
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 static java.lang.Math.min; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); while (t>0){ int a,b; a=in.nextInt(); b=in.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 17
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
c6686b3f08bedda72db753959ee194ae
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 static java.lang.Math.min; public class Main { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); while (t>0){ int a,b; a=in.nextInt(); b=in.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 17
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
cdbd4ea2913b2acee4fa70bbf87b235f
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 here_we_go { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); int t = scnr.nextInt(); while (t > 0) { t--; int n, m; n = scnr.nextInt(); m = scnr.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 17
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
2c4f5f64027a1687313cb088c1ba8fdb
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.StringTokenizer; public class Main { public static void main(String[] args) throws IOException{ new Main().run(); } void run()throws IOException{ new Solve().setIO(System.in,System.out).run(); } public class Solve extends IOTask{ ...
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 17
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
d8d9636dc405b78c734ddaffd92d775e
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 knight { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); int t = Integer.parseInt(br.readLine()); ...
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 17
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
979a5b173bc169c7f388379b4788d37c
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 scanner = new Scanner(System.in); int testCases = scanner.nextInt(); for (int i = 0; i < testCases; i++){ int rows = scanner.nextInt(); int columns = scan...
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 17
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
8409d1a9f70944d45abf91e5b6e07023
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 P1739A { static public boolean validMove(int x, int y, int width, int height, int xMove, int yMove) { if (x + xMove >= 1 && x + xMove <= width) { if (y + yMove >= 1 && y + yMove <= height) { return true; } } return false; } static public boolean c...
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 17
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
376a020a7e2c8d3c552630fc30350682
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 cf1739.a; import java.util.Scanner; public class A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); while (t-- > 0) { int m = s.nextInt(); int n = s.nextInt(); String result = cf1739a(m, n); System.out.println(result);...
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 17
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
6e57915e8b3d6cddb16848c60fe2cb17
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 User { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String [] line = br.readLine().split(" "); int t = Integer.parseInt(line[0]); for(...
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 17
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
17da1acf2521403a9262387e4091d584
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 scanner = new Scanner(System.in); int testCases = scanner.nextInt(); for (int i = 0; i < testCases; ++i) { int n = scanner.nextInt(); int m = scanner.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 17
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
5c1b3e7d5835679b15fb7f5d81984dca
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 problemA{ public static void main(String[] args) { Scanner sh = new Scanner(System.in); int t = sh.nextInt(); while(t>0){ int n = sh.nextInt(); int m = sh.nextInt(); if(n==1 || m==1){ System.out.println("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 17
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
b456716c1ea71ab83a67529cef17e877
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.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.security.KeyStore.Entry; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; impor...
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 17
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
7001e71ad67943a6c63a3a38f8903e50
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 scan = new Scanner(System.in); int t = scan.nextInt(); for(int i = 0; i < t; i++) { int n = scan.nextInt(); int m = scan.nextInt(); outerloop: for(int j = 1; j <= n; j++) { for(int 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 17
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
38da88754c79cc6e9ee17a86280b3994
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(); for (int tc = 0; tc < t; ++tc) { int n = sc.nextInt(); int m = sc.nextInt(); System.out.println(solve(n, m)); } sc.close(); } ...
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 17
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
007c5052182dd2867a31d481925bb4e3
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.*; // Map.Entry<Integer,String>dum; //res=(num1>num2) ? (num1+num2):(num1-num2) /* Name of the class has to be "Main" only if the class is public. */ public class Pupil { static FastReader sc = new FastReader(); public static ...
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 17
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
b7f54468ac8149d42603a08d4b0d0558
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 { final int mod = 1000000007; static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasM...
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 17
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
684a1ab97ee80c2e0dd9c93b7ab24fc1
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.System.out; import static java.lang.Math.abs; import static java.lang.Math.min; import static java.lang.Math.max; import static java.lang.Math.log10; import java.util.*; import java.lang.*; import java.io.*; public class a_Codeforces { public static void main(String[] args) thro...
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 17
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
e0c67b902930e9e83960b65adfb389d1
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.InputStreamReader; public class Main{ public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); while(t-- > 0){ String[] s = br.readLine(...
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 17
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
25f4bfa7d8f74a2eac3762a93bc00df8
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.security.*; public class solution { public static void main(String[] args) throws Exception { Scanner input; try { File file = new File("/home/harsh/Documents/Codes/input.txt"); FileInputStream fis = new FileInputStr...
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 17
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
47f66e59448e67eb15944bae91cf8191
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 Codechef { public static void main(String[]args){ Scanner sc=new Scanner(System.in); int test=sc.nextInt(); while(test-->0) { // System.out.println(solve(sc)); solve(sc); } sc.close(); } public static void solve(Scanner 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 17
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
50be378b6c7e86d5210f1902d61f7641
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 java.lang.*; public class ImmobileKnight { public static void main(String[] args) throws IOException{ FastReader s = new FastReader(); PrintWriter out = new PrintWriter(System.out); int t = s.nextInt(); while(t-->0){ int...
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 17
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
8ab460cab970732561f37cc3814da488
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.function.*; import java.io.*; // you can compare with output.txt and expected out public class RoundEdu136A { MyPrintWriter out; MyScanner in; // final static long FIXED_RANDOM; // static { // FIXED_RANDOM = System.currentTimeMillis(); // } final static String 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 17
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
f28af9c86ddb3723d451328b504ad530
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 m=sc.nextInt(); int n=sc.nextInt(); if(m==1||n==1){ System.out.println(m+" "+n); } else if(m>1&&n>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 17
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
7131cb72c1ba6e22561c7c4da29513b0
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 A136 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for (int l = 0;l < t;l++){ int n = scanner.nextInt(); int m = scanner.nextInt(); int[] ns = {1,2,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 17
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
c07f9b6ff739d3c6e26c61d182152ba6
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 { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( new InputStreamReader(System.in)); } String...
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 17
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
9cb9eb5e741907984028b30b73a2aed0
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 forces { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t; t=sc.nextInt(); while(t-->0) { int m,n; n=sc.nextInt(); m=sc.nextInt(); if(m==1||n==1) { System.out.println(1+" "+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 17
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
8038867c85194edc9a6f671e476bd896
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 Immobile_Knight { 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 17
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
92760e63f69dfb5169cb5cc1fa32532a
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 java.text.*; import java.math.*; import java.util.regex.*; public class main{ public static void main(String args[]){ Scanner s=new Scanner(System.in); int t=s.nextInt(); while(t-->0){ int a=s.nextInt(); int b=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 17
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
91427df7e536d16bb2f7c53ce388ef6a
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 contest_3 { public static void main(String[] args) { try { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int rows = sc.nextInt(); int cols = sc.nextInt(); int...
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 17
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
8e54fcd68b5ab7b739d328062c3f5aab
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 Sca...
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 17
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
4fbc4d674c36651711010debab7f9752
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 Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int numCases = in.nextInt(); for (int i = 0; i < numCases; i++) { int height = in.nextInt(); int width = in.nextInt(); 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 17
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
1bb2ceb74371352e09f90a113e926e9b
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 input =new Scanner(System.in); int x = Integer.parseInt(input.next()); for (int i = 0; i < x; i++) { int n = input.nextInt(); int m = 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 17
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
64b400e98fb6bdebfd58b368627efee5
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.StringTokenizer; import java.util.ArrayList; public class Main { static class Scanner { public BufferedReader bufferedReader; public StringTokenizer stringTokenizer; public Scanner(InputStream stream) { this.bufferedReader = new BufferedReader(new InputStreamRead...
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 17
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
55ec3052a60e23db24895c5235f18f07
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 scan = new Scanner(System.in); int t = scan.nextInt(); for(int i=0; i<t; i++) { int n = scan.nextInt(); int m = scan.nextInt(); test(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
38e13b47e3226d0559e8d05e05ab213a
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 MyClass { public static void main(String args[]){ Scanner scn=new Scanner(System.in); int t=scn.nextInt(); for(int i=0;i<t;i++){ int n=scn.nextInt(); int m=scn.nextInt(); int dx[]={1,1,2,2,-1,-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
9ee533c1937f86ed31bc4dff22430f1b
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 Algorithm; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.ut...
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
f03f9c7616e6c6ce267317c0fcff159a
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 scanner = new Scanner(System.in); int t = scanner.nextInt(); while (t > 0) { int n = scanner.nextInt(); int m = scanner.nextInt(); if (n == 2 && 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
3a9f1503a9d546a455370c45dfdbe038
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
// Online Java Compiler // Use this editor to write, compile and run your Java code online import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t= sc.nextInt(); for(int i = 0;i< t;i++){ int rows= sc.nex...
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
a84a445b583f02ed4a7da4ccd5d62ba8
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(); int m = 0; int n = 0; int row[] = {2,2,-2,-2,-1,-1,1,1}; int col[] = {-1,1,-1,1,2,-2,2,-2}; for(int...
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
8138e3894889d109a104e8b7db84e012
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.awt.Point; import java.io.*; import java.math.BigInteger; import java.util.*; import static java.lang.Math.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); while(t-- > 0){ int n = in.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
d8af0d43bf0965202c909c5f9a8f3b8e
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 scn = new Scanner(System.in); int t = scn.nextInt(); for (int i = 0; i < t; i++) { int n = scn.nextInt(); int m = scn.nextInt(); int[] ans = findIsola...
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
6b920026533f2aedb939d0294a61d0ae
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 Immobile_Knight { 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
5359bc3c236c87ca1e5f7e5a73dcab89
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.math.BigInteger; import java.io.*; public class New { public static void main (String[] args) throws java.lang.Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.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
0b427278b2acc061663adfd064107564
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 input = new Scanner(System.in);; int cases = input.nextInt(); for (int i = 0; i < cases; i++) { func(input); } } public static void func(Scanner input) { int n = input.nextInt(); 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
e42b86f984f7d053d0d476ddc0aaf88d
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<2 || m<2){ System.out.println(n+" "+m); }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 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
71e8d5a416aeffb6c43b23788b1d7c73
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 q184 { 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){ //saare cell isolated...
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
e37433636d0cd727e96cd4cd3a6b9d06
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 { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { 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
c3edd171e296932e2ed67b276fa112bb
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 { static long mod = 1000000007; static int n , m; static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void main(String[] args) throws IOException { FastReader sc = new FastReader(); int 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
3c35d94023e66b188e83f55c9033cd82
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.security.jgss.GSSUtil; import java.io.*; import java.lang.reflect.Array; import java.util.*; import java.util.HashSet; import java.util.StringTokenizer; public class cf799 { static class FastReader{ BufferedReader br; StringTokenizer st; public 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
67707c6386222d5fe679bf77a0779c70
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۪۫۰۰۪۫B۪۫۰۰۪۫D۪۫۰۰۪۫-۪۫۰۰۪۫A۪۫۰۰۪۫L۪۫۰۰۪۫L۪۫۰۰۪۫A۪۫۰۰۪۫H۪۫۰ import java.util.*; public class Main { static Scanner z = new Scanner(System.in); public static void main(String[] args) { int N =z.nextInt(); while(N-->0){ int rows=z.nextInt(); int columns=z.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
63cc540ab801faf9140f437d6cf81270
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 q1 { static int[][] possPos = {{-2,-1},{-2,1},{2,-1},{2,1},{-1,-2},{1,-2},{-1,2},{1,2}}; public static void main(String[] args){ 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
3f07a5491db7fc8acb60190208800c0e
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 chess(int n, int m) { for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { if (i >= 2 && j <= 1) { continue; } if (i >= 1 && j >= 2) { continue; ...
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
6632912fb27631229e763b12ae3b9914
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 class fastReader { BufferedReader br; StringTokenizer st; public fastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { w...
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
1922a765343ebcb41f85a24de021ddb7
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 Knights { public static void main(String args[]) { Scanner sc=new Scanner(System.in); byte t=sc.nextByte(); for(byte l=1; l<=t; l++) { int n=sc.nextInt(), m=sc.nextInt(); boolean mobility=false; ...
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
ce48654ee5711aa54bec1bfb9a4d40c5
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_solution{ public static void main(String []args){ try (var in = new Scanner(System.in)) { int t = in.nextInt(); while(t-- > 0){ int n=in.nextInt(); int m=in.nextInt(); if(n ==1 || m == 1){ System.out.println((1)+" "+(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