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
ae3a3897e66c078e27ebd9cd053499bc
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { // write your code here boolean readFromLocal = tru...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
67a43a72e6e5a154a57c162cbd5085be
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.lang.Math.ceil; import static java.util.Arrays.sort; public class C { public static void main(String[] args) throws IOException { int t = ri(); while (t-- > 0) { int n = rni(); ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
05eb49c750816184e477d7b8ed6d7472
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class B { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int a = sc.nextInt(); int b = ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a0daf77cb8f86912760732ebcd6b238e
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
//Harsh Gour code import java.util.*; import java.io.*; import java.lang.*; public class Solution { // Arrays.sort(arr, (a, b) -> a[1] - b[1]); // this is used to to sort value pairs /* String str ="3"; int p = Integer.parseInt(str); System.out.println(p); */ // Using stringBuilder ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
61d08c4074f4ed281750d4eb223ea283
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); StringTokenizer s = n...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
3070a6e3594ac96df3baba4cf74f1ca0
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
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 a = s.nextInt(); int b = s.nextInt(); if ((Math.abs(a-b...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a981104853f57857d8c20068116c9685
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; // THIS TEMPLATE MADE BY AKSH BANSAL. public class Solution { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
15f2ea775e1b51bd55707207cdacef98
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.FileNotFoundException; import java.util.StringTokenizer; import java.io.Writer; import java.io.Buffer...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
df323a305628f9557542ca444d9642d1
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; import java.util.ArrayList; import java.util.Arrays.*; import java.util.Map.Entry; import org.xml.sax.InputSource; import static java.util.Collections.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class Main { static final int SCAN_...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 < p_2 > p_3$$$, and $$$2$$$ is the only such index, and $$$p_2> p_3 < p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
5623f7fc9c82752b24bfe4210c282281
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} < p_i > p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class ProblemA{ static long mod = 1000000007L; // map.put(a[i],map.getOrDefault(a[i],0)+1); static MyScanner sc = new MyScanner(); //<----------------------------------------------WRITE HERE-------------------------------------------> stati...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
36fcaf425c6fc833cea88dd13910ccb4
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class CodeForces { static private final String INPUT = "input.txt"; s...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a35a1d8da4e3f0f6102510cffdfbdf26
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Solution { static long[] fac; static int[][] temp = new int[8][8]; public static void main(String[] args) throws IOException { Reader.init(System.in); BufferedWriter output = new BufferedWriter(new OutputStreamW...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
7ad0496d7b0cc9e42ae41d8b5c670e72
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.util.*; import java.io.*; import java.math.*; public class B_Build_the_Permutation { public static void main(String[] args) { OutputStream outputStream = System.out; Pri...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
fb982e340f204c2f5619b677b198d1ba
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; public class class376 { public static void main(String arg[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int a=sc.nextInt(); int b=sc.nextInt(); if(a+b+2>n || Math.abs(a-b)>1) { System.out.println(-1); } else { ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
04d43ffce27aab439ca0402df8aa48d8
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.Math.sqrt; import static java.lang.Math.pow; import static java.lang.System.out; import static java.lang.System.err; import java.util.*; import java.io.*; import java.math.*; public ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
e4c18497090674608a313d7d418d90ff
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Solution { public static void reverse(int arr[]) { int l=0,r=arr.length-1; while(l<r) { int t=arr[l]; arr[l++]=arr[r]; arr[r--]=t; } } public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
8cfe670740693bdad6493384a24aae4d
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.lang.*; import java.math.BigInteger; import java.io.*; public class Main implements Runnable { public static void main(String[] args) { new Thread(null, new Main(), "whatever", 1 << 26).start(); } private FastScanner sc; private PrintWriter pw; ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
2b5a755ec0d1015da7941da0734dfefd
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.lang.*; import java.math.BigInteger; import java.io.*; public class Main implements Runnable { public static void main(String[] args) { new Thread(null, new Main(), "whatever", 1 << 26).start(); } private FastScanner sc; private PrintWriter pw; ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
6bdc84b1c99d09567e48941c62773b35
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; // import static j'>>>ava.lang.Math.min; public final class Main { static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
fbcd847503760443e9751e8ba3c277be
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
/* بسم الله الرحمن الرحيم /$$$$$ /$$$$$$ /$$ /$$ /$$$$$$ |__ $$ /$$__ $$ |$$ |$$ /$$__ $$ ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
4dbb06cc9bcc9cfd899852f65a9ee818
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
28e722b01f2dd4e4702462734f607435
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException; import java.io.IOException;import java.io.InputStream;import java.io.PrintWriter; import java.security.AccessControlException;import java.util.List;import java.util.stream.IntStream; public class _B {static public void main(final S...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
9e33d4de2b7b338ecd7f430c7e1272fd
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
da89302cc16fb41bfaaf3d8b45583e27
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class cf1608b { public static void main(String[] args) throws IOException { int t = ri(); while (t --> 0) { int n = rni(), a = ni(), b = ni(); if (abs...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a1a1f91c5cff605d2e008f41c6d5e84a
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
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= 998244353; public static void main(String[] args) throws Exception { PrintWriter ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
3f491846e14e876bd8af1467f9d94de2
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Practice { static boolean multipleTC = true; FastReader in; PrintWriter out; static int mod = (int) (1e9 + 7); int mod2 = 998244353; int parent[]; int rank[]; public static void main(String[] args) throws Exception { new Practice().run(); } void run() t...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
ba0d997f5201e3983a518d5a38025cf0
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class Main { static class Pair { int l,r; public Pair(int l,int r) { this.l=l; this.r=r; } } static long mod= (long)1e9+7; public static final double PI = 3.141592653589793d; publ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
2bcd60104d948f2f2a9a6faf4ace71f5
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.math.*; public class Final { static final Reader s = new Reader(); static final PrintWriter out = new PrintWriter(System.out); public static vo...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
bee44e8aa73cc514ff34417a50601880
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class cp { static int mod=(int)1e9+7; // static Reader sc=new Reader(); static FastReader sc=new FastReader(System.in); static int[] sp; static int size=(int)1e6; static int[] arInt; static long[] arLong; public static void main(String[] args) throws...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
4ec52778450fbbd0996d1c207d5f58e3
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Solution { public static void reverse(int arr[]) { int l=0,r=arr.length-1; while(l<r) { int t=arr[l]; arr[l++]=arr[r]; arr[r--]=t; } } public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a0823cf84733349919245be19a891c4a
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class Main{ static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( new InputStreamReader(System.in)); } String next()...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
43b5bff8cadad718e0d053d49632b1f0
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class test { static StringBuilder sb; static long fact[]; static int mod = (int) (1e9 + 7); static class Pair implements Comparable<Pair> { int x; int y; Pair(int x, int y) { this.x = x; this.y = y; } public int c...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
ceb52716fd57c5d27b2ee1f452656b3c
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.Arrays; import java.util.Random; import java.io.FileWriter; import java.io.PrintWriter; /* Solution Created: 14:27:05 11/12/2021 C...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
38edc2a31184476bea86a8fd6c41c2d6
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.Scanner; import javax.swing.text.html.StyleSheet; public class B_Build_the_Permutation{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int testCases = scan.nextInt(); while(testCases-->0){ int n = scan.nextInt(); ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
87b807bd89b2286bbdf4da3a7c49160b
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int caseNo = scanner.nextInt(); int[][] input = new int[caseNo][3]; for (int i = 0; i < caseNo; i++) { for (int j = 0; j < 3; j++) input[...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
21d1c8309fa889f274d3ac0356e5732d
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.io.OutputStream; import java.io.BufferedOutputStream; import java.util.*; public class CodeForces_758 { ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
624e906e9c3c9494338bb41a5726530c
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class b { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int numcases = Integer.parseInt(in.readLine()); ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
1fafa9e5a471b60d49252411f13711c9
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; // @author : Dinosparton public class test { static class Pair{ long x; long y; Pair(long x,long y){ this.x = x; this.y = y; } } static class Duo{ int x; String s;...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
e7e1e4b1037fb2178be640976d4a668e
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; import java.sql.Array; import java.sql.ResultSet; import java.sql.SQLException; public class Solution { private static class MyScanner { private static final int BUF_SIZE = 2048; BufferedReader br; private MyS...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
5843d873aa5054e8908b00f9fc37e7b6
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
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
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
bf521872368ebf1ae04f9ee7e7152a1f
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Main { static StringBuilder sb; static dsu dsu; static long fact[]; static int mod = (int) (1e9 + 7); static void solve() { int n=i(); int a=i(); int b=i(); // if(a==0&&b==0){ // for(int i=1;i<=n;i++)sb.append(i+" "); // retu...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
5f30377c6e38fc0f56710126743573c2
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class q2 { public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // public static long mod = 1000000007; public static void solve() throws Exception { String[] parts = br.readLine().split(" "); int n = I...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a086a96ddc93f7dc08e34289060140c9
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.time.Year; import java.util.Scanner; import java.util.*; public class test2 { public static void main(String[] args) { Scanner in = new Scanner(System.in); // 测试次数 int testnum = in.nextInt(); for (int i = 0; i< testnum; i++) { int n = in.next...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
9fd7cfa9f188963dc6d998faff2968f7
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
/** * Created by Himanshu **/ import java.util.*; import java.io.*; import java.math.*; public class B1608 { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(System.out); Reader s = new Reader(); int t = s.i(); while (t-- ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
87955ed30b03c8d6a77bb3fd720943c9
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
//package currentContest; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Linke...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
b9ab39a3c828178063ca6baa98a0b134
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class Main { static long mod = 1000000007; static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void main(String[] args) throws IOException { FastReader sc = new FastReader(); int t =sc.nextInt(); while( t-->...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
1f68ccce05730fefbdea11a3945e00ca
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
//package prog_temps; import java.util.*; import java.io.*; public class Java_Template { static boolean[] primecheck = new boolean[1000002]; static int M = 1000000007; static int mn = Integer.MIN_VALUE; static int mx = Integer.MAX_VALUE; static int vis[]; static ArrayList<ArrayList<Integer>...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
11a72aee2d1c0ed7d58d77c362a22e09
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.*; public class Q1608B { static int mod = (int) (1e9 + 7); static void solve() { int n = i(); int a = i(); int b = i(); if (a + b > n - 2) { System.out.println(-1); return; } if (Math.abs(a...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
4a11e4d8a30ab435825da16dd61ae461
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class BuildThePermutation { private static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { b...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
b00311c3918e263232cbbc05e4842c81
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.InputMismatchException; /** * Provide prove of correctness before implementation. Implementation can cost a lot of time. * Anti test that prove that it's wrong. * <p> * Do not confuse i j k g indexes, upTo and length. Do extra methods!!! Write mor...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
4da06ba7376ef0533a9e324e432939fb
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
//package com.company; import java.io.*; import java.math.BigInteger; import java.util.*; public class Main{ static boolean[] primecheck = new boolean[1000002]; public static void main(String[] args) { OutputStream outputStream = System.out; FastReader in = new FastReader(); ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
9bc06b89ded79759f863b09a9e810b15
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class code6{ static final int M = 1000000007; // Fast input static class Hrittik_FastReader{ StringTokenizer st; BufferedReader br; public int n; public Hrittik_FastReader(){ br=new BufferedReader(new I...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
b2dc4f241229f8d767b4d3e7fc19d558
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.io.DataInputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.LinkedList; import java.util.List; public class Main { private static void run() throws IOException { int n, a, b; n = in.nextInt(); a = i...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
7fdf9d56abd9da846786d8b99296b23d
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.Scanner; public class BuildThePermutation { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int i = 0; while (i < t) { int n = sc.nextInt(); int a = sc.nextInt(); ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
f7f32a2a428843b0ad7ae50cf045f57b
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; public class Main{ static int [] path; static int tmp; static boolean find; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-->0) { int n = sc.nextInt()...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a6bdd3b0e00c4f2abe6c088c717a4a57
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import com.sun.security.jgss.GSSUtil; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.*; public class javacp{ static FastReader fs=new FastReader(); static class FastReader{ BufferedReader br; ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
f505576077cb60e6030afde0c3689e7c
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
import java.util.*; import java.io.*; public class ja { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); int a = sc.nextInt(); int b = sc.nextInt(); ...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
a1be7c3723b7bb6a36032f23dcb8206e
train_109.jsonl
1639217100
You are given three integers $$$n, a, b$$$. Determine if there exists a permutation $$$p_1, p_2, \ldots, p_n$$$ of integers from $$$1$$$ to $$$n$$$, such that:There are exactly $$$a$$$ integers $$$i$$$ with $$$2 \le i \le n-1$$$ such that $$$p_{i-1} &lt; p_i &gt; p_{i+1}$$$ (in other words, there are exactly $$$a$$$ lo...
256 megabytes
//package contests; import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; import java.util.* ; import java.math.*; import java.io.*; public class javaTemplate { public static final int M = 1000000007 ; public static B...
Java
["3\n4 1 1\n6 1 2\n6 4 0"]
1 second
["1 3 2 4\n4 2 3 1 5 6\n-1"]
NoteIn the first test case, one example of such permutations is $$$[1, 3, 2, 4]$$$. In it $$$p_1 &lt; p_2 &gt; p_3$$$, and $$$2$$$ is the only such index, and $$$p_2&gt; p_3 &lt; p_4$$$, and $$$3$$$ the only such index.One can show that there is no such permutation for the third test case.
Java 11
standard input
[ "constructive algorithms", "greedy" ]
2fdbf033e83d7c17841f640fe1fc0e55
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. The description of test cases follows. The only line of each test case contains three integers $$$n$$$, $$$a$$$ and $$$b$$$ ($$$2 \leq n \leq 10^5$$$, $$$0 \leq a,b \leq n$$$). The sum of $$$n$$$ over all ...
1,200
For each test case, if there is no permutation with the requested properties, output $$$-1$$$. Otherwise, print the permutation that you are found. If there are several such permutations, you may print any of them.
standard output
PASSED
9e1b69c8a6bd85d3942f0e80ea78dbaa
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class FindArray { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int n = scanner.nextInt(); int[][]array=new int[n][1000]; int[]arr=new int[n]; for(int i=0;i<n;i++) arr[i]=scanner.nextI...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
eb84684832628af864db7975d9d0d087
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class find_array { public static void main(String[] args) { try { Scanner scn=new Scanner(System.in); int t=scn.nextInt(); while(t!=0) { int n=scn.nextInt(); System.out.print(2+" "); int old=2; for(int i=1;i<...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
a5088d3ed2b13e796f699c121ef17125
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class CodeForces { private static boolean isPrime(int num) { if (num <= 1) { return false; } for (int i = 2; i <= Math.sqrt(num); i++) { if (num % i == 0) { return false; } } return true; } ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
ddb229611982ea5091a871fa43bf5430
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
//package games; import java.util.ArrayDeque; import java.util.Deque; import java.util.Scanner; /** * @author SHshuo * @data 2021/12/11--18:07 */ public class findArray { public static void main(String[] args) { // 输入的数据 Scanner sc = new Scanner(System.in); int[] array ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
645decb4ec0afde5de111411ba667c05
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
/*package whatever //do not write package name here */ import java.io.*; import java.util.Scanner; public class Array { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); if(n==1){ System.out.p...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
2832453f846974614a3a0a808ef47239
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.DataInputStream; import java.io.FileInputStream; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class A { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPoin...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
542cfecbebd72c8b4e3e13c9ef4126b1
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class FindArray { public static int[] findArr(int n) { int[] arr = new int[n]; arr[0] = 2; for (int i = 1; i < n; i++) { arr[i] = arr[i - 1] + 1; while (arr[i] % arr[i - 1] == 0) { arr[i]++; } } ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
d8de8bb573ac172586e0c7a48b8b97f9
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class A { static BufferedReader br; static StringTokenizer st; static PrintWriter pw; static String nextToken() { try { ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
1fc7fb42ce575da2dc6a742239a32ccf
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Rough { public static void main(String[] args) throws Exception { Scanner s = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int tc = s.nextInt(); for(int t=1;t<=tc;t++) { int n=s.nextInt(); for(int i=2;i<n+2;i++)pw.prin...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
2ae0677428a896f7b35239c77bed48b8
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Rough { static int N=(int)1e4; static boolean[] ar=new boolean[(N+5)]; static ArrayList<Integer> isprime=new ArrayList<>(); static void seive() { ar[0]=ar[1]=false; ar[2]=true; for(int i=4;i<=N;i+=2) { ar[i]=false; ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
687aba721b3f97722bcbce8eaf6560f1
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Solution{ static PrintWriter out = new PrintWriter(System.out); static int mod = 1000000009; public static void main(String[] args) throws IOException { FastReader fs = new FastReader(); int t = fs.nextInt(); while(t > 0){ int n = fs...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
2f353bd169c810d6e8695cab70ec3cf0
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author singh */ public class...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
f76a5d10f6eaff846cb27696a860dcec
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; import java.math.BigInteger; public class Solution { public static void main(String[] args) { FastReader f = new FastReader(); int t = f.nextInt(); while (t-- > 0) { int n = f.nextInt(); BigIntege...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
b7f0a2bd0b700669327a785be21cad80
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.math.*; import java.util.* ; import java.io.* ; public class B { static final int mod = (int)1e9+7 ; static final double pi = 3.1415926536 ; static boolean not_prime[] = new boolean[1000001] ; static void sieve() { for(int i=2 ; i*i<1000001 ; i++) { if(not_prime[i]==false) { for(i...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
1ee2724c56b4ebdf84e024c3fb21b615
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i=1;i<=t;i++) { int n = sc.nextInt(); for(int j=2;j<=(n+1);j++) { Syste...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
393ffeb2fbc0b7130578f598df81ae87
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collector; import java.util.stream.Collectors; import java.util.stream.Stream; pub...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
fe56e8f6c3fc429020e8d3e19ef7abbe
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.*; // Solution public class G { public static void main(String[] args) { //~ BufferedReader br = new BufferedReader(new FileReader("input.txt")); ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
643814de310809df43caa3d9dea0aac6
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); int T = Integer.parseInt(in.r...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
19fc530168ac6ad03a754e94c8a317d3
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for (int i = 0; i < t; i++) { int n=sc.nextInt(); int[] arr=new int[1000]; ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
db11dd12812baf63d2dc60af6c448a5a
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner in = new Scanner(System.in); int input = in.nextInt(); for (int i=0; i<input; i++) { int len = in.nextInt(); for (int j=2; j<=len+1; j++) { Syste...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
8430ea95fccbdf1be6afb03a8ffe107f
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Test { public static void main(String[] args) throws IOException { Reader rd = new Reader(); int t = rd.nextInt(); while (t-- > 0) { int n = rd.nextInt(); if (n == 1) System.out.println("1"); ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
02392f3ff030a7e4e677be249e95ca23
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static class DSU { private int[] parent; private int[] size; private int totalGroup; private int maxSize = 1; public DSU(int n) { parent = new int[n]; totalGroup = n; ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
377dd3f56351a55354d7987e293dbf2a
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class Main { static void daunism1() { } static void dfs(int v, int w) { } static long gcd(long a, long b) { if (b == 0) return Math.abs(a); return gcd(b, a % b); } public static void main(String[] args) thr...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
48da36e78ff2c289633657af9daa4320
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class Main { public static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { int tc = scanner.nextInt(); while (tc-->0){ int size = scanner.nextInt(); int [] array = new int[size]; for...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
0ec7f79a5f1640f23c39a0d7542c6300
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class Main{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); for(int i=2;i<=n+1;i++) { System.out.print(i+" "); } System.out.println(); } } }
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
bc8663ca87ef3222d29095326d47bd6f
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class findarray { public static void main(String [] args) { Scanner in=new Scanner (System.in); int n=in.nextInt(); int ar[] =new int [n]; int j; int i; //int prime[]=new int [100000]; for(i=0;i<n;i++) { ar[i]=in.nextInt(); } for(i=0;i<n;i++) { i...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
f21519ee2697a65102992e3dca8422dc
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; /** * @author Guy_Z * @date 2021-12-15 17:03 */ public class A_FindArray { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); //the number of the test cases int t = scanner.nextInt(); int[][] arrays = new in...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
af9c1442e8640b21e8490eeafc8a8a05
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class Test { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int noOfInputs = sc.nextInt(); for( int i=0; i< noOfInputs; i++) { int n = sc.nextInt(); for( int j=2; j<=n ; j++) { Syste...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
ebde88c9904df7206b541a2b6c306af8
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.io.InputStreamReader; import java.math.BigInteger; import java.net.Socket; import java.util.*; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOException { Scanner cin=new Scanner(System.in); int t =cin.nextI...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
541b6dc640d9788e9c8f5b0e82b074f6
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; /** * * @author Omar Faruk */ public class FindArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T-- > 0){ int n = sc.nextInt(); //StringBuilder str = new S...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
d73ffeacd8d35b4413be2bab5fda280d
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; /** * * @author Omar Faruk */ public class FindArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T-- > 0){ int n = sc.nextInt(); StringBuilder str = new Str...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
e9d67712efe07ce1c760ab58acd6662f
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class MyClass { static Scanner in=new Scanner(System.in); public static void main(String args[]) { int testCases=in.nextInt(); for(int t=0;t<testCases;t++){ int n=in.nextInt(); if(n==1){...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
94618783e5144763e0cc836fc83164fd
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Scanner; public class SolnA { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0) { t--; int n = sc.nextInt(); if(n==0) return; int[] ans = new int[n]; for(int i=0;i<n;i++) { if(i==0) ans[i]=2; else...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
da9aef970a323e8316faf49766a19239
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { // write your code here Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); int g=2; while(...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
5c3a6c7cabc782bcb7198107b5889a7a
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class SolutionA { static boolean primes[] = new boolean[8000 + 1]; public static void main(String args[]) { Scanner cin = new Scanner(System.in); int t = cin.nextInt(); primeSieveOpt1(8000); while (t-- > 0) { int n = cin.nextInt(); ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
4bddd461327be1a91bf9bca95f5abafa
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.util.*; public class FindArray { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); for(int i=1; i<=n ;i++) System.out.print(i+1+" "); ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
f86e216780e2fae358f304f692f86b41
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.StringTokenizer; /** * Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
a3889e355c43f304241cf0aa83c39256
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
// package CF.R_758; import java.io.*; import java.util.*; import java.math.*; /** * @Author: merickbao * @Created_Time: 2021-07-10 10:43 * @Description: */ public class Main { public static void main(String[] args) throws IOException { InputStream inputStream = System.in; Outp...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
cec154d3b94bdea6432a0475551dacf9
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.math.BigInteger; import java.util.*; public class Test { 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=2; for(int i=0;i<n;i++) System.out.print(k++ +" "); System.out.println(); ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
e2ebff44bb06cc0ca2c0c9689d4ab647
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.time.LocalDate; import java.util.*; //BigInteger x = new BigInteger(a); //Collections.reverseOrder() public class Main { static FastScanner sc; // static PrintWriter syso; static long mod = 1_000_000_007; static int maxi = Integer.MAX...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
67ec3932ec60dc9a5ae308db6cf3151e
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.*; import java.util.*; public class A_Find_Array { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } ...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output
PASSED
1a7643fa6d0966412a7a31f1c3c2663e
train_109.jsonl
1639217100
Given $$$n$$$, find any array $$$a_1, a_2, \ldots, a_n$$$ of integers such that all of the following conditions hold: $$$1 \le a_i \le 10^9$$$ for every $$$i$$$ from $$$1$$$ to $$$n$$$.$$$a_1 &lt; a_2 &lt; \ldots &lt;a_n$$$For every $$$i$$$ from $$$2$$$ to $$$n$$$, $$$a_i$$$ isn't divisible by $$$a_{i-1}$$$It can be sh...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Codeforces { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine(...
Java
["3\n1\n2\n7"]
1 second
["1\n2 3\n111 1111 11111 111111 1111111 11111111 111111111"]
NoteIn the first test case, array $$$[1]$$$ satisfies all the conditions.In the second test case, array $$$[2, 3]$$$ satisfies all the conditions, as $$$2&lt;3$$$ and $$$3$$$ is not divisible by $$$2$$$.In the third test case, array $$$[111, 1111, 11111, 111111, 1111111, 11111111, 111111111]$$$ satisfies all the condit...
Java 8
standard input
[ "constructive algorithms", "math" ]
76bfced1345f871832957a65e2a660f8
The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 100$$$). Description of the test cases follows. The only line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 1000$$$). It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^4$$$.
800
For each test case print $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the array you found. If there are multiple arrays satisfying all the conditions, print any of them.
standard output