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 | cd8094399d010bfb8979ebd54af84e41 | 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.math.*;
//import java.io.*;
public class memoziation {
static Scanner in=new Scanner(System.in);
static int global=0;
// static BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
static class Pair implements Comparable<Pair>{
... | 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 | 83bef5397e70e9985e986b2bccd63ab6 | 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.math.*;
//import java.io.*;
public class Experiment {
static Scanner in=new Scanner(System.in);
static int global=0;
// static BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
static class Pair implements Comparable<Pair>{
... | 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 | 3c7b2763ac39b31b3e49758ef8304889 | 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 OKEA {
public static void main(String[] args) throws IOException {
Reader in = new Reader();
PrintWriter out = new PrintWriter(System.out);
int T = in.nextInt();
for (int t = 0; t < T; t++) {
int N = 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 | 57db0d24d618b06ab6353b8df3762e78 | 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.reflect.Array;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList... | 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 | a28d6b185ba023fff473db74831fc05c | 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 okea {
public static void main(String[] args)throws Exception {
// TODO Auto-generated method stub
Reader.init(System.in);
int t=Reader.nextint();
while(t-->0) {
int n=Reader.nextint();
int k=Reader.nextint();
if(k==1) {
System.out.... | 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 | d3b2e612f14793a2450dce91b3d6617a | 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{
// static class FastReader {
// BufferedReader br;
// StringTokenizer st;
// public FastReader()
// {
// br = new 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 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 | aacf85f2cbead3a76445d4137407face | 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.util.StringTokenizer;
/**
* @author Peter Li
* @version 02/06/2022
*/
public class COKEA {
static boolean solve() {
int n = ni(), k = ni();
if (k >= 2 && n % 2 == 1) {
return fals... | 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 | b74018643e965307b577d31af5a4608b | 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.InputMismatchException;
public class E1634C {
public static void main(String[] args) {
FastIO io = new FastIO();
int t = io.nextInt();
while (t-- > 0) {
int n = io.nextInt();
int k = io.nextInt();
int[][] grid ... | 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 | 072709ea122e085c2f668897ca7c3f74 | 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.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.max;
import static java.lang.System.exit;
import static java.util.Arrays.fill;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;... | 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 | b1e731d4d5c0bcc54f10445a74575ba6 | 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 Solution{
static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
static StringTokenizer st;
static final long mod=1000000007;
publi... | 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 | 7fb41c9de7dcda8f4c938db3f225af2d | 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 {
// when can't think of anything -->>
// 1. In sorting questions try to think about all possibilities like sorting from start, end, middle.
// 2. Two pointers, brute force.
// 3. In graph query questions try to solve it reversely or try to proc... | 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 | 7e70f7cb6e046de5bd08cc9a0d251ac3 | 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 CodeForce
{
public static void main(String args[])
{
long n,k;
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while(t-->0)
{
long init =0;
n=s.nextLong();
k = s.nextLong();
... | 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 | 226399b4f336e66636bad6f3d088c180 | 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.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
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 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 | 2d2210f244ac8266a9d969bf61c4635d | 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 solution{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
StringBuilder sb = new StringBuilder();
while(t-->0){
int n = sc.nextInt();
int k = 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 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 | 724ada1eded2323307b71077d41a3869 | 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 solution{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
StringBuilder sb = new StringBuilder();
while(t-->0){
int n = sc.nextInt();
int k = 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 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 | 4777c06a20fffa3d6678bb0804444c68 | 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 Main
{
static long mod = (int)1e9+7;
static PrintWriter out=new PrintWriter(new BufferedOutputStream(System.out));
public static void main (String[] args) throws java.lang.Exception
{
FastReader sc =new FastReader(... | Java | ["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 | c74b3eed71ad732bf5bc18995a65c555 | 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 RAM, HAR HAR MAHADEV, HARE KRISHNA
import java.util.*;
import java.util.stream.*;
import java.lang.*;
import java.math.BigInteger;
import java.text.DecimalFormat;
import java.io.*;
public class Eshan {
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
sta... | 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 | a94030156f813e587e3738ce40f512e7 | 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.util.*;
import java.util.Map.Entry;
public class codeforces {
static int mod = 1000000007;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.has... | 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 | d33b0f634f8eda7b4a4c191b90aed343 | 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 test2{
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
int[][] arr = new int[1010][1010];
int cnt = sc.nextInt();
while(cnt-- > 0)
{
int n = sc.nextInt();
int k = sc.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 | dc2c0c649fb28b100463315a136c4222 | 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 MyClass {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
int tc=sc.nextInt();
while(tc>0)
{
int n=sc.nextInt();
int k=sc.nextInt();
int i,j;
if(k==1)
{
System.out.println("YES"... | 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 | 67588187df57ae5550e629c4f8f5ed4a | 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.List;
import java.util.Objects;
import java.util.Optional;
import java.util.Scanner;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class C_Okea {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int tasks = in.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 | 5abd01516e09941a338f38ac534d33bf | 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 codeforceb
{
//ArrayList<Integer> arr2=new ArrayList<Integer>();
static ArrayList<Long> arr1=new ArrayList<Long>();
//Map<Integer,Integer> hm=new HashMap<Integer,Integer>();
//static Set<Integer> st1=new HashSet<Integer>();
static Set<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 | 2d799ffcc26ebe0b86473b3d7dadfe99 | 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 div_2_770;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class C{
public static void main(String[] args){
FastReader sc = new FastReader();
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
int 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 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 | 098eba841b0171e2ecfb1cbbcc6fc824 | 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 HelloWorld{
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.out.printl... | 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 | 989fd157e2b93e3f8cebbd7cf4547df3 | 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.io.*;
import java.util.*;
public class Main{
static boolean[] primecheck = new boolean[1000002];
static ArrayList<Integer>[] adj;
static int[] vis;
static int mod = (int)1e9 + 7;
public static void main(String[] args) {
OutputStream outputS... | 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 | 5ca7f4e63f2e9ff15aa52f84b0a4b890 | 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 CF15 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int tc = sc.nextInt();
while(tc>0){
tc--;
int n = sc.nextInt();
int k = sc.nextInt();
if(k==1){
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 | |
PASSED | 1eaebf8a088bb5b26b81f40fc5f1e514 | 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 pariNa {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
long t=sc.nextLong();
//finalAnswer.append().append('\n');
outer:
while(t-->0) {
int a=sc.nextInt();
int b=sc.nextInt();
StringBuilder finalAnswer=new StringBuilder();
... | 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 | a358aca9d0b09c36255c0e2083f28693 | 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 Test
{
final static FastReader fr = new FastReader();
final static PrintWriter out = new PrintWriter(System.out) ;
static long mod = (long)1e9 + 7 ;
static int dp[] ;
static void solve()
{
int n = fr.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 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 | 675b40e3d15e07115d3668117eca149b | 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.awt.*;
import java.io.*;
import java.util.*;
public class Main {
static int N = 100001;
// Array to store inverse of 1 to N
static long[] factorialNumInverse = new long[N + 1];
// Array to precompute inverse of 1! to N!
static long[] naturalNumInverse = new long[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 | 6ef13415336311f2643cb2a69f6485bf | 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.math.*;
public class Solution {
static int mod=1000000007;
public static void main(String[] args) {
// TODO Auto-generated method stub
// System.out.println();
Scanner sc = new Scanner(System.in);
int tt=1;
//
tt = sc.nextInt();
//
while (tt-- > 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 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 | 2c8b2ac386a1b9ef67faec00bcd8b083 | 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 {
private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
private static final boolean OFFLINE_WITHOUT_FILES = false;
public void solve() throws Exception {
int t = readInt();
while (--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 | 7272318d42c8848fc980070e51c43954 | 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.text.*;
import java.math.*;
import java.util.regex.*;
public class JaiShreeRam{
static Scanner in=new Scanner();
static long mod = 998244353;
static List<List<Integer>> adj;
static int seive[]=new int[1000001];
static int dp[]=new int[1001];
public 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 | 07b2b46723f65098b18a123b7e9875d5 | 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 FastScanner sc = new FastScanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
static StringBuilder sb = new StringBuilder();
static long mod = (long) 1e9 + 7;
public static void main(String[] args) throws... | 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 | 2a50fa50916ff3024fffc33dc7fe477e | 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) throws IOException {
Kattio io = new Kattio();
int t = io.nextInt();
for (int ii=0; ii<t; ii++) {
int n = io.nextInt();
int k = io.nextInt();
if (k == 1) {
System.out.println("YES");
for (int i=1; 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 | 7325c3a670b95af7c65caa90ad19827e | 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 Main
{
static final PrintWriter out =new PrintWriter(System.out);
static final FastReader sc = new FastReader();
//I invented a new word!Plagiarism!
//Did you hear about the mathematician who’s afraid of negative numbers?He’l... | 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 | b59d77cf836e63b44e9a65300bf70734 | 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.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collections;
/* Name of the class has to be "Main" only if the class is public. */
public class Okea
{
static FastScanner sc= new FastScanner();
public static voi... | 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 | e2cd43172120da945720c275dd5e9f74 | 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 MainClass {
static FastScanner fs;
static FastWriter fw;
static boolean checkOnlineJudge = System.getProperty("ONLINE_JUDGE") == null;
private static final int[][] kdir = new int[][]{{-1, 2}, {-2, 1}, {-2, -1}, {-1, -2}, {1, -2}, {2, -1}, {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 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 | 6b2eefe13836143af67ec93afcc21533 | 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 geeks {
public static void main(String [] args){
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
while(x>0){
int n=sc.nextInt();
int k=sc.nextInt();
int u=1;
if(n%2==0||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 | 8ed1c576b2532d66063086505e31ad90 | 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.math.BigInteger;
import java.util.*;
public class Main {
static long M = (long) (1e9 + 7);
static class FastReader {
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 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 | 9abe6b1210f3f874691a050afac05c21 | 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 | //Utilities
import java.io.*;
import java.util.*;
public class a {
static int t;
static int n, k;
public static void main(String[] args) throws IOException {
t = in.iscan();
while (t-- > 0) {
n = in.iscan(); k = in.iscan();
if (n % 2 == 0){
out.println("YES");
int nxtOdd = 1, nxtEv... | 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 | bb85a87c7d73d3fb800e0823a00d2d7d | 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 sol{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
int m=sc.nextInt();
if(m==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 | f46611d080d09748fadcaba45193e467 | 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 | public class OKEA {
public static void main(String[] args) {
ContestScanner scanner = new ContestScanner();
int tests = scanner.nextInt();
for (int i = 0; i < tests; i++) {
int numberOfShelves = scanner.nextInt();
int lengthOfShelve = scanner.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 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 | 9d84e9b8addedb9750cd22b4b39594f8 | 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.*;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
public class Round12 {
public static void main(String[] args) {
FastReader fastRead... | 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 | 3618a920960999d5368d311af572a0ec | 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.List;
import java.util.Scanner;
public class Okea {
public static void main(String[] args) {
try (Scanner scanner = new Scanner(System.in)) {
int t = Integer.valueOf(scanner.nextLine());
String[] lines = new String[t];
for (int i = 0; i < t; i++) {
lines[i] = scanner.nextLi... | 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 | 1d0d871e5cc820c865e109f234049f8a | 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.StringTokenizer;
public class test {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(Sys... | 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 | 29135c9795e56af4bfbd183dee2d2ad6 | 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.InputStreamReader;
import java.util.*;
public class Okea{
public static void main(String args[])throws Exception{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringBuilder result = new StringBuilder();
int testCases = Integer.pars... | 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 | 311bbaa4775281f2599a3578eb951fcf | 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.BigDecimal;
import java.math.*;
//
public class Main{
public static void main(String[] args) {
TaskA solver = new TaskA();
// boolean[]prime=seive(3*100001);
int t = in.nextInt();
for (int i = 1; i <= 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 | c2ee0d4b7919e0bf3156e32c402c4604 | 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 | // In The Name Of Allah
// Mohammad Hosseini
// Hello MF_AS AP
import java.util.*;
import java.io.*;
public class hello {
public static Scanner sc = new Scanner(System.in);
public static PrintWriter pw = ... | 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 | 353e1ba0fd61ac43d715d5a05ffcea6c | 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.StringTokenizer;
public class C {
public static FastScanner s = new FastScanner();
public static PrintWriter out = new PrintWriter(System.out);
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 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 | 7fe8af1ae332b201513b305264aaf424 | 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.util.StringTokenizer;
public class Solution {
private static final FastScanner fs = new FastScanner();
public static void main(String[] args) {
int testCase = fs.nextInt();
for ... | 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 | 8e1cb3f3317dba18e3ef594c738b0edf | 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 FastReader sc=new FastReader();
public static void main(String args[]) {
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt(),k=sc.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 | 49f0e3bea3d9b2c1e53aaa8d55cf3a32 | 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.PrintStream;
import java.io.PrintWriter;
import java.io.File;
import java.io.FileInputStream;
import java.util.*;
public class Main {
// static final File ip = new File("input.txt");
// stat... | 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 | 2098a30cff28f45ffdc0aec43632c461 | 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 Main
{
public static class FastReader {
BufferedReader br;
StringTokenizer 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 | 5c2f3a1c2cec3c633bd53e1f3e88e4cf | 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 in = new Scanner(System.in);
int t = in.nextInt();
while (t-- > 0)
{
int n = in.nextInt(), m = in.nextInt();
if (m == 1)
{
System.out.println("YES");
for (int i = 1; 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 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 | aaa16db69824d4a7abc1d6ab59f4d01d | 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.HashMap;
import java.util.Map;
import java.util.Vector;
public class NK01 {
public static int [][] dp = new int [510][510];
public static int [][] sum = new int [510][510];
public static boolean [][] op = new boolean[510][510];
public static void main(String[... | 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 | f9b2449d63ffbfaaa06a079c788d5c66 | 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.Math.*;
public class MyClass {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0){
int n = sc.nextInt();
int 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 | 0fd11d304999d163c9142872b774fb90 | 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.*;
/**
__ __
( _) ( _)
/ / \\ / /\_\_
/ / \\ / / | \ \
/ / \\ / / |\ \ \
/ / , \ , / / /| \ \
/ / |\_ /| / / / \ \_\
/ / |\/ _ '_| \ / / / \ \\
| / |/ 0 \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 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 | cba2b9f4035b6aa8797770185ed58486 | 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 {
public static void main (String[] args) throws java.lang.Exception {
int t=1;
t = sc.nextInt();
while(t-->0){
int n = sc.nextInt(), k = sc.nextInt();
int[][] arr = new int[n][k];
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 | d3d4e9a972f1966aad90268e01dfb0b0 | 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 final Random random=new Random();
static long mod=1000000007L;
static HashMap<String,Integer>map=new HashMap<>();
static class FastReader{
BufferedReader br;
StringTokenizer st;
public 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 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 | 68804377b27ea6119c891d2331bd6eb4 | 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 okea;
import java.util.*;
import java.io.*;
public class okea {
public static void main(String[] args) throws IOException {
BufferedReader fin = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(fin.readLine());
StringBuilder fout = new StringBuilder();
while(... | 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 | 2670dac91d81d4c70576790a2b1db3c8 | 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_OKEA {
static final int INT_MOD = (int) 1e9 + 7;
static final long LONG_MOD = (long) 1e9 + 7;
static final int INT_POSITIVE_INFINITY = Integer.MAX_VALUE;
static final long LONG_POSITIVE_INFINITY = Long.MAX_VALUE;
static final int INT_NEGATIVE_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 | 90f51932d2eee188a11050a7526323ae | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class C {
static class scannerzzz {
static BufferedReader reader;
static StringTokenizer tokenizer;
... | 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 | f80a7f0377841958c22fec0b3a9ea605 | 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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class C {
static class scannerz {
static BufferedReader reader;
static StringTokenizer tokenizer;
... | 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 | 599ffd40ca7d118024da3e3d82c95920 | 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 Codechef {
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader() {
din = new DataIn... | 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 | f5c55bba5d08429cd6b3c91d0b0db7cc | 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.*;
public class solution
{
public static void main (String[] args) throws java.lang.Exception {
int in = 0;
// your code goes here'
Scanner sc = new Scanner(System.in);
int y = sc.nextInt();
while (y-- > 0) {
int... | 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 | 76469079937914661b027a0384a534e9 | 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 s = new Scanner(System.in);
int t = s.nextInt();
while (t-- > 0){
int n = s.nextInt();
int k = s.nextInt();
int[][] ar = new int[n][k];
// TreeSet... | 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 | db38310a4d6fd2468a162ba078eaf515 | 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 | // Working program using Reader Class
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.*;
public class Main
{
static class Reader
{
final private int... | 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 | a9588fc95297ee6fad303e7fd7fe532e | 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 | /**
* C_OKEA
*/
import java.util.*;
import java.io.*;
public class C_OKEA {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(
new InputStreamReader(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 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 | 1a16ae8f70f4af7825cb00db55d90e66 | 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 c5{
static class Pair{
int first;
int last;
public Pair(int first , int last){
this.first = first;
this.last = last;
}
public int getFirst(){
return first;
}... | 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 | 37717a6c476570b2a4e399e2d4ce8a50 | 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 Main
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0)
{
int n=sc.nextInt();
int 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 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 | 63126ee351a1df106a2a0e92880e3903 | 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;
import java.util.stream.Stream;
/* 3 1 yes
* 3 2 no
* 3 3 no
* 3 4
*
* 1 4 0*k+i 1*k+n
* 2 5 0*k+n
* 3 6
*
* */
public class C {
static FastScanner fs = new FastScanner();
static PrintWriter out=new PrintWriter(System.out);
public 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 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 | 145baa7c0706c3f9ac36497df08a96c5 | 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) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
PrintWriter pw = new PrintWriter(System.out);
int te... | 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 | dded6d7d35d27d8a01517163d208e2e0 | 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 TestClass {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
for (int i = 0; i < t; i++) {
int n = in.nextInt();
int k = in.nextInt();
int[][] a = new 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 | 0a21f9c27e9b8d58a849ae3a8dccbd06 | 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.math.*;
import java.io.*;
public class Solution {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(new InputStreamReader(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 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 | b8e0ce7eda255add44c77e56d3178ba0 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 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();
}
}
pu... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | c6135b039851b627618a1dd77d4625bb | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | /* || श्री राम समर्थ ||
|| जय जय रघुवीर समर्थ ||
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.*;
import static java.util.Arrays.sort;
/... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | c1a5fd6390f861bb24c25cebffc18a13 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.util.Scanner;
public class D
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while (t-- > 0)
{
int n = in.nextInt();
int max1 = 0, ans1 = -1;
for (int i = 3; i <= n; i++)
{
System.out.printf("? %d %d %d\n", 1, 2, ... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 7979dde19b3e83f4e4e2355c890dc3a4 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.util.*;
import java.io.*;
// res.append("Case #"+(p+1)+": "+hh+" \n");
////***************************************************************************
/* public class E_Gardener_and_Tree implements Runnable{
public static void main(String[] args) throws Exception {
new Thr... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 3f1b8ce61ba2ac4c6b4e5a29c0044b24 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | /*
Setting up my ambitions
Check 'em one at a time, yeah, I made it
Now it's time for ignition
I'm the start, heat it up
They follow, burning up a chain reaction, oh-oh-oh
Go fire it up, oh, oh, no
Assemble the crowd now, now
Line 'em up on the ground
No leaving anyone behind
*/
import static java.lang.Math... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 028aebf184ba54bd7c0cbd8f7192bb49 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 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.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.StringTokenizer;
import java.util.TreeSet;
p... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | fd919a939b448ca49946952e8337bb01 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.Stack;
import java.util.StringTokenizer;
... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | dd34c155a49e2ba34e908347759be183 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Random;
import java.util.Stack;
import java.util.StringTokenizer;
... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | bec195ad4ca1c06c39209d33a5ac66c3 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.*;
import java.util.*;
/*
*/
public class D{
static Scanner sc=null;
static int Q;
public static void main(String[] args) {
sc=new Scanner(System.in);
int t=sc.nextInt();
for(int tt=0;tt<t;tt++) {
int n=sc.nextInt();
int a=1,b=2;
int cur=0,c=0;
... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 1654ff6bd225eb8b9258a1eb3385eb35 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.util.*;
import java.util.Map.Entry;
import java.io.*;
import java.math.*;
public class CodeChef2 {
static boolean lazy[];
static int lazyupd[];
public static void main(String args[]) throws Exception {
FastReader fr = new FastReader();
int t = fr.nextInt();
PrintWriter out = new PrintW... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 15f819d8c3ed74f4a271c3f34f26e14f | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
//--------------------------INPUT READER---------------------------------//
static class fs {
public BufferedReader br;
StringTokenizer st = new StringTokenizer("");
public fs() { this(System.in); }
public fs(I... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 6301b7133c066c5d0ce9304418f81056 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
static HashMap<String, Integer> q = new HashMap<>();
static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
static PrintWriter pw = new PrintWriter(System.out);
public static void main(String[] args) throws Exception... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 430f7a18be17bb4a5b2675f187ee996c | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String args[])
{
FastReader input=new FastReader();
PrintWriter out=new PrintWriter(System.out);
int T=input.nextInt();
while(T-->0)
{
int n=input.nextInt();
... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 1a243264b14e201653eb5b5c6be6a47f | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.FileInputStream;
import java.util.List;
import java.util.Random;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.util.InputMismatchException;
import java.util.ArrayList;
import java.io.FileNotFoundException;
import java.io.InputStream;
public class Main {
... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 32cb8f2c56b29281a7efaef1af973c8d | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.*;
import java.util.*;
/*
polyakoff
*/
public class Main {
static FastReader in;
static PrintWriter out;
static Random rand = new Random();
static final int oo = (int) 2e9 + 10;
static final long OO = (long) 2e18 + 10;
static final int MOD = 998244353;
stat... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | cc21ea2ce5432209829da430499c34ad | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import j... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 0796c405f574a40b22e6a508a59126e0 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes |
import java.util.*;
import java.io.*;
public class D {
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(
new InputStreamReader(System.in));
}
String next() {
... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 713e1290e0308a084922866666a67843 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes |
import java.util.*;
import java.io.*;
/**
* CF1634D Finding Zero
*/
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 So... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | c554e2da8af0117a1992e050a7cf1d88 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | /*
* Everything is Hard
* Before Easy
* Jai Mata Dii
*/
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.h... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | cad5c2461fb2a090a7318c4c0271c427 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
//import java.text.DecimalFormat;
import java.util.*;
public class Codeforces {
static int mod = 1000000007;
public static void main(String[] args) throws Exception {
PrintWri... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 0a5a47112ba6e4f7431aae905acb6d89 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 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 | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 0e79700ba3448970d455429eb981a5f5 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | //make sure to make new file!
import java.io.*;
import java.util.*;
public class D770{
public static BufferedReader f;
public static PrintWriter out;
public static void main(String[] args)throws IOException{
f = new BufferedReader(new InputStreamReader(System.in));
out = new Pri... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 16338ed6075e89f976e5e9c7213fdc49 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.*;
import java.util.StringTokenizer;
import java.util.Vector;
public class D {
String filename = null;
InputReader sc;
int query(int i, int j, int k) {
System.out.println("? " + i + " " + j + " " + k);
System.out.flush();
int r = sc.nextInt();
i... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 767cc41b9d4f5791a5e5ee635253d19b | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.util.*;
import java.io.*;
public class D1643 {
static Scanner sc = new Scanner(System.in);
static PrintWriter pw = new PrintWriter(System.out);
public static int query(int[] three) throws IOException {
pw.println("? " + three[0] + " " + three[1] + " " + three[2]);
pw... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 57827c837ef5971d0ad41cad2ee2b3d9 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 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 | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output | |
PASSED | 95ecb55388570ff41e118fc5e6737a77 | train_108.jsonl | 1644158100 | This is an interactive problem.We picked an array of whole numbers $$$a_1, a_2, \ldots, a_n$$$ ($$$0 \le a_i \le 10^9$$$) and concealed exactly one zero in it! Your goal is to find the location of this zero, that is, to find $$$i$$$ such that $$$a_i = 0$$$.You are allowed to make several queries to guess the answer. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Objects;
import java.util.Ra... | Java | ["1\n\n4\n\n2\n\n3\n\n3\n\n2"] | 1 second | ["? 1 2 3\n\n? 2 3 4\n\n? 3 4 1\n\n? 4 1 2\n\n! 2 3"] | NoteArray from sample: $$$[1, 2, 0, 3]$$$. | Java 8 | standard input | [
"constructive algorithms",
"interactive",
"math"
] | 84e79bd83c51a4966b496bb767ec4f0d | Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 500$$$). Description of the test cases follows. The first and only line of each test case contains an integer $$$n$$$ ($$$4 \le n \le 1000$$$) — the length of the array that we picked. It is guaranteed that ... | 2,000 | null | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.