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
3fc5381a94ea9a252343cbce30bebda5
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashMap; import java.util.StringTokenizer; public class C { static class Fast { BufferedReader br; StringTokenizer st; public Fast() { ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
0c1f10f3c4b3d970fc8d7879d6180522
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.lang.*; import java.io.*; 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(); ArrayList<Integer> odd=new ArrayList<>(); ArrayLi...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
242833274ab5ea22c2b030173c75b74f
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class B { private final IO io; public B(IO io) { this.io = io; } public void solution() throws IOException { int t = io.nextInt(); for (int i = 0; i < t; i++) { solveCase(); } ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
1e935d81ff793a5d96ea4ea73b36a18c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class CodeForces{ public static void main(String[] args) throws FileNotFoundException { FastScanner fs = new FastScanner(); int t = fs.nextInt(); while(t-- > 0) { int n = fs.nextInt(), k = fs.nextInt(); boolean flag = true; in...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
2984b435ca1cc7d71c8b4cb7415c86b3
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Codechef { static long fans[] = new long[200001]; static long inv[] = new long[200001]; static long mod = 1000000007; static void init() { fans[0] = 1; inv[0] = 1; fans[1] = 1; inv[1] = 1; for (int i = 2; i < 200001; i+...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
5e8235aaec02af7dacbd67eff7987f48
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.net.CookieHandler; import java.util.*; import java.io.*; //import static com.sun.tools.javac.jvm.ByteCodes.swap; // ?)(? public class fastTemp { static FastScanner fs = null; static ArrayList<Long> graph[] ; static int mod = 998244353; // static int count=0; public static...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
94fedcfed94fa0a25203265d0d52f19c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.beans.DesignMode; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; impo...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
89b58e13dfb549f7e0f5ae1d3ff8718e
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Stream; public class C_770 { public static final long[] POWER2 = generatePOWER2()...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
fb0ee52132165ae6a3ee0d8a10f52736
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; import...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
e28e1169892b6465fb4b1b4e99357dbe
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class Main{ static Scanner sc=new Scanner(System.in); static PrintWriter pw=new PrintWriter(System.out); public static int rr() { return (int)(7*Math.random())+1; } public static void main(String[] args) throws IOException, InterruptedExcepti...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
ffec24d9d1e5210b54176f11b1d17071
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public final class C { public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int T = fs.nextInt(); for (int tt = 0; tt < T; ++tt) { int n = fs.nex...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
e1beb61adb531fac003d2a961038a296
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class Main implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); public static void main(String[] args) { new Thread(null, new Main(), "", 256 * (1L << 20)).start(); } public ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
cdfb33dea8fc6ec41d3ba6c6b1b0c997
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class Codeforces_770C { public static void main(String[] args){ Scanner scan=new Scanner(System.in); int t=scan.nextInt(); while(t-->0){ int n=scan.nextInt(); int k=scan.nextInt(); if(k==1){ System....
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
876a435d16f9f42fe8fcfbf596ee4606
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class C1634Sol { public static void main(String[] args) throws IOException { //T //n k BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int T = Integer.parseInt(r.readLine()); for(int i ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
38ffab473f39ee1c727380a94c682eca
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public final class Main { //int 2e9 - long 9e18 static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)}; static...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
59536c0d6141c04665134f23089e060c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//package com.company; import java.util.*; import java.lang.*; import java.io.*; public class Rough_Work { public static void main(String[] args) throws IOException { FastReader sc = new FastReader(); PrintWriter out = new PrintWriter(System.out); int t = sc.nextInt(); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
cf7bef0afdf3f59167f12a6be445e4a0
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; public class Codechef { static int[] num_to_bits = new int[] { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; static int co...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
d1b40530f654be77cae3ac6a5ddfc0d1
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class OKEA { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Intege...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
9bdb765cf5e7cf2576f43590653336d1
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); int m = sc.nextInt(); if...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
dce0cbb31b3741e5ef0b90cbf40a7d89
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Random; import java.util.Stack; impor...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
bc22b82a3d78e6e53a3cc4587f05a9f5
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; /** * CF1634C OKEA */ public class Main { static Reader rd = new Reader(); public static void main(String[] args) { int tt = rd.nextInt(); while (tt-- > 0) { new Solution().solve(); } } static class Solution {...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
59f89086a1a40bf92b38c7a20fec1bd0
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class OKEA { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int t = s.nextInt(); while(t-- > 0) { int n = s.nextInt(); int k = s.nextInt(); if(k == 1) { S...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
7fa5437c63bea0a0ac84d2605bd055a6
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class C1643 { 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 n = sc.nextInt()...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
24d4d7b1f4a40291811e045794549b93
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class C770C { public static void main(String ...args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int k = sc.nextInt(); boolean p = false; if (n % 2 == 0) { p = true; } else { if (k ==...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
9f587b7cbefcdfe771a3b148526f07b7
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.util.*; import java.lang.*; public class Solution{ static class Graph{ public static class Vertex{ HashMap<Integer,Integer> nb= new HashMap<>(); // for neighbours of each vertex } public static HashM...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
c4a900a02f0f00d990dcdcd1fcf03989
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class codeMaster { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int tc = sc.nextInt(); while(tc-->0){ int n = sc.next...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
3a9bc7b50a117ceb20b6c2933dd05000
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.*; public class C { public static void main(String hi[]) throws Exception { BufferedReader infile = ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
651c442a8c3055978007a803a47d5992
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class OKEA { public static void main(String[] args) throws IOException { BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine()); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
67e87183f40732f028dcc418d8b1737d
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class Lokeando20 { public static void main(String[] args){ Scanner read = new Scanner(System.in); boolean weCan = false; int cont=0,mean=0,sum=0; int cases = read.nextInt(); for(int i=0;i<cases;i++)...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
724776572b0d5b077a2e9e798dd1285c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.*; import java.io.FileNotFoundException; import java.io.FileReader; import java.math.BigInteger; import java.util.Arrays; import javax.lang.model.util.ElementScanner6; public class Main { static fi...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
c530e06b9d6d19d987004c0d01d8b4c9
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class exe_C1634 { public static void main(String[] args) { //Input Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); int[] n = new int[t]; int[] k = new int[t]; for (int i = 0; i < t; i++) { n[i] = scanner.nextInt(); k[i] = scanner.nextI...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
eae6663dc593833fec7eecf4ba6b6b22
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class C { public static void main(String[] args) { new C().run(); } BufferedReader br; PrintWriter out; long mod = (long) (1e9 + 7), inf = (long) (3e18); class pair { int F, S; pair(int f, int s) { ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
d8cb6e8f3a64925d672df622dbc89cd5
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { InputStream inputStream=System.in...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
2b61fb604297ee591ad74eddaac9c9c5
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class MyCpClass{ public static void main(String []args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); int T = Integer.parseInt(br.readLine()....
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
5a9978b35c88e598d7bc35239d02d67b
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class Feb6P32 { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int t = sc.nextInt(); for(int i = 0; i < t; i++) { ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
57ecd7af6567677921bd94a2d1925590
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class ProbC { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
b17f7867885ea92ec53ced3312e10684
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
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){ t--; int n = sc.nextInt(); int k = sc.nextInt(); String ans = "YES"; if(k==1){ ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
00c6624d1fe636c5a59967e85cd8f21d
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.util.stream.Collectors; import java.io.*; import java.math.*; public class A13 { public static FastScanner sc; public static PrintWriter pw; public static StringBuilder sb; public static int MOD= 1000000007; public static class FastScanner { BufferedReader ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
502e160055a579ffb8ab5951ab1089ab
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/* Rating: 1367 Date: 06-02-2022 Time: 20-42-49 Author: Kartik Papney Linkedin: https://www.linkedin.com/in/kartik-papney-4951161a6/ Leetcode: https://leetcode.com/kartikpapney/ Codechef: https://www.codechef.com/users/kartikpapney */ import java.util.*; import java.io.BufferedRe...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
78a1283ce818fd62b06f834906a890c4
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; // import java.lang.*; // import java.math.*; public class Main { static FastReader sc=new FastReader(); static PrintWriter out=new PrintWriter(System.out); static long mod=1000000007; // static long mod=998244353; static int MAX=Integer.MAX_VALUE; static int M...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
884303a2b951cd9ccd677b80437133d6
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//import java.io.*; //import java.util.*; //public class okea { // // public static void main(String[] args)throws IOException { // BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); // int T = Integer.parseI...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
202eed1f7be12cca8e72654fdc19dd72
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { sc=new MScanner(System.in); pw=new PrintWriter(System.out); int t=sc.nextInt(); for (int i=0;i<t;i++){ solver(); } } publ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
129a9206ff0e6ec17d6e88578d963cd5
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; // cd C:\Users\Lenovo\Desktop\New //ArrayList<Integer> a=new ArrayList<>(); //List<Integer> lis=new ArrayList<>(); //StringBuilder ans = new StringBuilder(); //HashMap<Integer,Integer> map=new HashMap<>(); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
5912adf6a5076a9106c13ce35d98489c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class C_060222 { public static void main(String[] args) { try { final BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(in...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
163fdb3a8712bd336262b42ce7f4f6a4
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class C { public static void main(String[] args) { FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for(int ttt = 1; ttt <= T; ttt++) { int n = in.nextInt(); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
278a1675f8b3a9b09cc7355d944d1182
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashMap; import java.util.StringTokenizer; import java.util.TreeSet; public class Solution { // VM options: -Xmx1024m -X...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
584e0ac08954428e5c4b976f7a027b4b
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.util.Map.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.lang.System.*; public class Main { public void tq() throws Exception { st=new StringTokenizer(bq.rea...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
9868d9f93938ea26a50149c4409c85f6
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//make sure to make new file! import java.io.*; import java.util.*; public class C770{ public static void main(String[] args)throws IOException{ BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int t = Inte...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
6ee2c541dfaf1c4a179df04c0f2a0bab
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
5d59e92a9bbb08bb08ee555270c89f5e
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class C_OKEA { public static void main(String[] args) throws IOException { FastReader in = new FastReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); int t = in.nextInt(); for (int tt = 0; t...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
55531fa407f8f6760b472b9431f95c60
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class Code { public static void main(String[] args) { Scanner st = new Scanner(System.in); int t = st.nextInt(); while (t-- > 0) { int a = st.nextInt(); int b = st.nextInt(); if (a == 1...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
cb6f383438f845e26993fb8d52049dfa
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class C_1634 { public static void main(String[] args) { FastReader sc = new FastReader(); PrintWriter out=new PrintWriter(System.out); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
82714e40e941f94b2ad3d6252dc8493f
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class Practice { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
1ee6fdc2cb57091e629e3457f77b731e
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static int arr[] = new int[100001]; public static int prev[] = new int[100001];...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
0aa995d4a5f93db5334ecb16647c7b27
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/** * @Jai_Bajrang_Bali * @Har_Har_Mahadev */ /* Author: Sanat Kumar Dubey (sanat04) * File: C.java */ import java.util.Scanner; public class C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); //int t=1; ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
4fee64c7f1c65375e712ca149f7d7653
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class OKEA { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for (int i = 0; i < t; i++) { int n=sc.nextInt(); int k=sc.nextInt(); if (k==1||n%2==0){ ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
8b8f5d353152dbbac766bf3d95fdbaaa
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
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 try...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
cb2abc7de9ad2adba18709cf496e69bb
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; import java.lang.Math; public class Main { public class MainSolution extends MainSolutionT { // global vars public void init(int tests_count){} public class TestCase extends TestCaseT { public Object solve() { int n =...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
3bba522b94cf0590002a934b42c06ede
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//package codeforces; import java.util.*; public class OKEA { public static void main(String[]args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); while(t>0) { int n=in.nextInt(),k=in.nextInt(); if(k==1) { System.out.println("YES"); for(int i=0;i<n;i++) ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
f65c6cf077d3e12fca0c1b9dcfdb6ab0
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Ac { static int MOD = 998244353; static int MAX = (int)1e8; static Random rand = new Random(); static FastReader in = new FastReader(); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
b817fdbead28ec41375ddc16c1f4bc8b
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class Main { static PrintStream out = new PrintStream(System.out); static LinkedList<LinkedList<Integer>> adj; static boolean[] vis; static long ans; static int target; static HashMap<ArrayList<Integer>, Integer> seqs; //static ArrayL...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 8
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
b026b73acb07cd0618a1e61bd507743b
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class Main { public static class Pair { int x; int y; public Pair(int x, int y) { this.x = x; this.y = y; } } private static final int modulo = 1000000007; private static int evenCount = 0; pri...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
0ca65a235880e380130c2ac6744f2448
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class OKEA { static void printArray(int [][] arr, int n, int k) { for (int i = 0; i < n; i++) { for (int j = 0; j < k; j++) { System.out.print(arr[i][j] + " "); } System.out.println(); } } publ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
617d2efd8a4c585abd1931bf9bbc5b0a
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/** * Surly * 26.10.2022 **/ import java.util.*; import java.math.*; import java.io.*; public class Main { static Scanner sc = new Scanner(System.in); static PrintWriter pr = new PrintWriter(System.out); public static void main (String[] args) { double starttime = System.currentTimeMilli...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
bccc447074ab81ac0e8ac3acbc788858
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import static java.lang.Integer.*; public class codeforces { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); int k = sc.nextInt(); if(n%2!=...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
b909278a625ff5d50b3863fdfa5ad112
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; import java.util.ArrayList; 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 n=sc.nextInt(); int k=sc.nextInt(); int even=0; int odd=0; for(int e=1; e<=n*k; e++) { if(e%2==0) { even++...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
a8be3fd6430076b96fb95cfd202dfc9a
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class s{ public static void main(String args[]) { Scanner Sc=new Scanner(System.in); int t=1; t=Sc.nextInt(); for(int tc=1;tc<=t;tc++) { int n,k; n=Sc.nextInt(); k=Sc.nextInt(); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
56904283d1b14be9a3f44c89e84a7bd2
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*;import java.io.*;import java.math.*; public class OKEA { public static void process()throws IOException { int n = ni(); int k = ni(); int[][] a = new int[n][k]; if(k==1){ pn("YES"); for(int i=1;i<=n;i++) pn(i); return; ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 17
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
7de1992d8c837c39f2f50e9e3b13d3a2
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
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
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
07e820d5655aec2440d3a0f6713a873a
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//Code By KB. import java.beans.Visibility; import java.io.*; import java.lang.annotation.Target; import java.lang.reflect.Array; import java.nio.channels.AsynchronousCloseException; import java.security.KeyStore.Entry; import java.util.*; import java.util.logging.*; import java.io.*; import java.util.loggi...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
f61ced7627f9c833251a4f5d48f780bf
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.Print...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
55e4e67f9f7fb48ff26a1107a43199d2
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class Q1633A { static int mod = (int) (1e9 + 7); static void solve() { int n = i(); int k = i(); if (k == 1) { System.out.println("YES"); for (int i = 0; i < n; i++) { System.out.println(i ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
a1326ffebcfdf34515ffbb43bfd1c84c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class Testing{ public static void main(String[] args)throws Exception{ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); int k = sc.nextInt(); int[][] ans = new int[n][k]; { List<Integer>...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
d7587488b298d5cf7d12a694e2172870
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/* بسم الله الرحمن الرحيم /$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ |__ $$ /$$__ $$ |$$ |$$ /$$__ $$ ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
2793d25ebbec29f1aeab297ada6093da
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class codeForces { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int k = sc.nextInt(); if (k == 1) { System....
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
feeb9f797fc6d49142d4103aa5ce67ae
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class codechef { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); sc.nextLine(); for (int i = 0; i < n; i++) { int n1=sc.nextInt(); int k=sc.nextInt(); if(k==1){...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
85ad14080dc6fe39397373d91ae507b3
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main{ public static void main(String[]args){ long s = System.currentTimeMillis(); new Solver().run(); System.err.println(System.currentTimeMillis()-s+"ms"); } } class Solver{ int N, K; ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
d807c202c81e2d5496198801332dca09
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/***** ---> :) Vijender Srivastava (: <--- *****/ import java.util.*; import java.lang.*; // import java.lang.reflect.Array; import java.io.*; public class Main { static FastReader sc =new FastReader(); static PrintWriter out=new PrintWriter(System.out); static long ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
8096fdcf9617fabf8a6d49acb389db89
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
/***** ---> :) Vijender Srivastava (: <--- *****/ import java.util.*; import java.lang.*; import java.io.*; public class Main { static FastReader sc =new FastReader(); static PrintWriter out=new PrintWriter(System.out); static long mod=998244353; /* start */ ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
34aca5aba4f30427891660505b0e366a
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class Main { static class FastReader{ BufferedReader br; StringTokenizer st; FastReader(){ br=new BufferedReader(new InputStreamReader(System.in)); } String next() { while(st==null||!st.hasMoreElements()) { ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
c8481c274832b82419a0a54f694c7cad
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.Math.sqrt; import static java.lang.Math.pow; import static java.lang.System.out; import static java.lang.System.err; import java.util.*; import java.io.*; import java.math.*; public ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
8a7c6e1d13dd3f45cdc0beced49eb906
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class C { static PrintWriter out; public static void main(String[] args) { FastReader in = new FastReader(); out = new PrintWriter(Syst...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
e31182228f8a2f4169912f30e850a354
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class C { public static void main(String[] args) { Scanner go = new Scanner(System.in); int t = go.nextInt(); while (t-->0){ int n = go.nextInt(); int k = go.nextInt(); if (k==1){ System.out.print...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
4e09132b16d8e839b57bee1135733434
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
00ea0296f49fbc4fef49b64a2479e25c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//jai Shree Krishna import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.util.Collections; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Comparator; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
cf89e1a2f2dc32837090a60e47f6ee03
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class ProblemA{ static long mod = 1000000007L; // map.put(a[i],map.getOrDefault(a[i],0)+1); // map.putIfAbsent; static MyScanner sc = new MyScanner(); //<----------------------------------------------WRITE HERE------------------------------...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
0126204a226fa4e1f82fed424f854608
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
//package atcoder.com; import java.util.*; import java.io.*; public class Main { public static StringBuffer res = new StringBuffer(""); public static void main(String[] args) throws IOException { //FileInput(); ManualInput(); } public static void ManualInput() throws NumberFormatException, IOExc...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
8d2279bd5bd524b2fd3fdbf6a5311607
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.IOException; import java.util.Arrays; import java.util.Scanner; public class Training { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t; t = sc.nextInt(); for (int i = 1; i <= t; i++) { int n, k; n = sc.nex...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
bb5f895c55085c4e0dfa89e46e91c906
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
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(), k = sc.nextInt(); int count = (n*k) / 2; if(count % k != 0 || count/k != (n+1)/2){ if(k == 1){ ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
f77a605233eec20fe3c6e7bf091ca277
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
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(), k = sc.nextInt(); int count = (n*k) / 2; if((n*k) % 2 != 0 || count % k != 0 || count/k != (n+1)/2 || n == 1){...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
ab7dd52a8bac70eb26bebf8c0a92fdba
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class OKEA { public static void main(String[] args) { Scanner s=new Scanner(System.in); int t=s.nextInt(); for(int i=0;i<t;i++){ int n=s.nextInt(); int k=s.nextInt(); if(k==1){ System.out.println(...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
fb50b93f69c4fcf1d7325cc61d07103e
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class C { static FastReader in = new FastReader(); static BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); static StringBuilder sb = new StringBuilder(); public static void main(String args[]) throws IOException { //int t=...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
5cfbc465b906450ca377f8b253a310dc
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static boolean isPrime(int n) { if (n <= 1) return false; else if (n == 2) return true; else if (n % 2 == 0) return false; for (int i = 3; i <= Math.sqrt(n); i += 2) { if (n % i == 0) return false; } return ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
1958e0a0249f1ef58efc8d3378201b6e
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String args[]) { Scanner scn = new Scanner (System.in); int x= scn.nextInt(); while(x>0){ int n= scn.nextInt(); int k= scn.nextInt(); int n1 = (n*k); ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
9f47a13a513c107c71320a42f07cc54f
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String args[]) { Scanner scn = new Scanner (System.in); int x= scn.nextInt(); while(x-->0){ int n= scn.nextInt(); int k= scn.nextInt(); if(k==1){ ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
00e7a942fbad304a84844895662be6ef
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.InputMismatchException; public class divs770c { private static class pair implements Comparable<pair> { int low, high; pair(int low, int high) { this.low = low; ...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
e30754b7a618bf956beaf8c020af9f9e
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.io.*; import java.util.*; public class R770C { public static void main(String[] args) { Scanner scan = new Scanner(System.in); PrintWriter out =new PrintWriter(System.out); int t = scan.nextInt(); while(t-->0){ int n = scan.nextInt(); in...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
862cdcf410e138b35bfd42a9c48ded59
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; public class COKEA { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s = new Scanner(System.in); int t = s.nextInt(); while (t-- > 0) { int n = s.nextInt(); int k = s.nextInt(); if (k == 1) { System...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
f54b12e1559badf83328be9a2420e32c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.*; import java.io.*; //code by tishrah_ public class _practise { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == n...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output
PASSED
1c90c7732faa34b30a1a7d3e599f282c
train_107.jsonl
1644158100
People worry that computers will get too smart and take over the world, but the real problem is that they're too stupid and they've already taken over the world.— Pedro DomingosYou work for a well-known department store that uses leading technologies and employs mechanistic work — that is, robots!The department you wor...
256 megabytes
import java.util.Scanner; public class OKEA { public static void solve(int shelves, int itemsPerShelf) { int totalItems = shelves * itemsPerShelf; // System.out.println("Shelves: " + shelves); // System.out.println("Items per shelf: " + itemsPerShelf); // System.out.pr...
Java
["4\n\n1 1\n\n2 2\n\n3 3\n\n3 1"]
1 second
["YES\n1 \nYES\n1 3 \n2 4 \nNO\nYES\n1 \n2 \n3"]
null
Java 11
standard input
[ "constructive algorithms" ]
9fb84ddc2e04fd637812cd72110b7f36
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The first and only line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 500$$$) — the number of shelves and length of each shelf, respectively. It is guaranteed that the sum $$$n$$$ over a...
1,000
Print the answer for each test case. If such an arrangement exists, print "YES" on a single line. After that, print any example on $$$n$$$ lines of $$$k$$$ numbers each, one line per shelf. Each number from $$$1$$$ to $$$n \cdot k$$$ must occur exactly once in the output. If no good arrangement exists, print a single w...
standard output