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
1f332c14ab30dc10cd0d20b4f355c194
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
//package CP.Codeforces.Div2_4_8_22; import java.util.*; import java.io.*; public class Moves23 { static FastReader in=new FastReader(); static final Random random=new Random(); static long mod=1000000007L; static HashMap<String,Integer>map=new HashMap<>(); public static void main(Str...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
e44b059b1dea7b17d8cead56529127fd
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigInteger; public class test { static int cnt = 0; //static int m; static int n; static char[] c; static long[][] memo; static char[][] x; static string[] p; static Boolean[][] m; //static String s; public static String diff(int h,int m,...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
e77d19661606ae82426092542201f8da
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/*package whatever //do not write package name here */ 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 a = sc.nextInt(); if(a==1) System.out.println("2"); else if(a==...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
160a428dacc7b928242e818bb902a4ac
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws FileNotFoundException { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = n...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
22250322ae68be9f52fa6c857afe0473
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main { public static void main(String[] args) throws FileNotFoundException { InputStream inputStream = System.in; OutputStream outputStream = System.out; boolean oj = System.getProperty("ONLINE_JUDGE"...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
11f3e57e2f6ee65e99faaf3e443e518a
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class Moves2And3 { public static void main(String[] args) throws IOException { InputStream inputStream = System.in; InputReader in = new InputReader(inputStream); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(Syst...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
3b0907e7b3c9e6e28d081b00d9b48f7c
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class moves23 { public static void main(String[] args){ Scanner scan = new Scanner(System.in); int t = scan.nextInt(); int[] ans = new int[t]; for (int i = 0; i < t; i++){ int n = scan.nextInt(); int mult = n / 3; if (n == 1){ ans[i] = 2; continue; } if (n > 0...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
58876567d92503ef9fee97828935fe10
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { Scanner inp = new Scanner(System.in); int T = inp.nextInt(); fo...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
f6b175aeccc272d594316281068187eb
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; import java.util.concurrent.ThreadLocalRandom; public class Main { pu...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
cd0f3634ef1a988167fe406a4dfb22f5
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; import java.lang.reflect.Array; import static java.lang.Math.*; // import java .util.Map.Entry; public class Main //class bhaiya { static int MOD = 1000000007; static long mod=(long)1e9+7; static int isPrimeLimit=(int)(1e6); static class FastReader{ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
bd4b3086d8fca25b4eff10c98dfaa811
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/****************************************************************************** Practice,Practice and Practice....!! *******************************************************************************/ import java.util.*; import java.io.*; public class Main{ static class FastReader{ BufferedReader ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
aad43a8e6ffb555b872438ac6636238a
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Codeforces {public static void main(String arg[]){ Scanner in=new Scanner(System.in);int n=in.nextInt();for(int i=0; i<n; i++){int x=in.nextInt();if(x==1) System.out.println(2);else if(x%3==0) System.out.println(x/3);else System.out.println(x/3+1);}}}
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
108b2f16046e8b56a04ee59676a4b54d
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; /** * * @author Omar Ayman */ public class Codeforces { public static void main(String arg[]){ Scanner in=new Scanner(System.in); int n=in.nextInt(); for(int i=0; i<n; i++){ int x=in.nextInt(); if(x==1) System.out.println(2); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
51b3849d6309a82ce7fc356c29d399a2
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int k; k=sc.nextInt(); for(int j=0;j<k;j++){ int n = sc.nextInt(); if(n==1){ System.out.println(2); continue; } int ans=0; if(n%3==1){ System.out.prin...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
76c463307f6f428c43657f3fe0cbbdec
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class a { public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
0b5fa64e63de88df3a42f521f509bbc3
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class a { public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
a81eb4399c6e5d83ff599e8673d14915
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Moves{ public static void main(String[] args) { Scanner o = new Scanner(System.in); int t = o.nextInt(); while( t-- > 0){ int n = o.nextInt(); int ans = 0; if( n == 1 ){ ans = 2; } else if (n == 2) { ans = 1; } else if (n == 4) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
4e897270cde023c053dd9aa65586e6b8
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class CF1 { static FastReader sc=new FastReader(); // static long dp[][]; // static boolean v[][][]; // static int mod=998244353;; // static int mod=1000000007; static long oset[]; static int oset_p; static long...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
f0a186058a69ee3f4eaecce834ba29ec
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; /** * <a href = "https://codeforces.com/contest/1716/problem/A"> Link </a> * @author Bris * @version 1.0 * @since 8:51:31 PM - Aug 14, 2022 */ public class A1716 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
3aecdc17f2cc4360439ddc34dc017486
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class A1716 { 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.println(2); } else{ System.out.println((n+2)/3); } } ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
be9b905cae8e5162ace46ce3eb8572b6
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Sol { public static void main (String[] args) { Scanner sc = new Scanner(System.in); // int ar[] = new int[n]; int n =sc.nextInt(); while(n-->0){ int x = sc.nextInt(); if(x%3 == 0){ System.out.println(x/3); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
5ec9f22001fc113dc6b42db326a2e3c6
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Moves { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int T= sc.nextInt(); while (T-->0) { int x = sc.nextInt(); if (x==1) { sb.append("2\n"); continue; } sb.append(...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
0a25157384adda2e752460b8245804e3
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int T= sc.nextInt(); while (T-->0) { int x = sc.nextInt(); if (x==1) { sb.append("2\n"); continue; } sb.append((...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
de712f111cb2f0e5995ecb4bd88aed7c
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Steps { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int amountOfPoint = scanner.nextInt(); int[] points = new int[amountOfPoint]; for (int i=0; i<amountOfPoint;i++){ points[i]= scanner....
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
c9c9c617b99437c7cefca7483261eb11
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { //Scanner in = new Scanner(System.in); FastReader in = new FastReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); i...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
7469a42428d10fff2315036d3259587e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class Test { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int numberOfTc = Integer.parseInt(br.readLine()); int tcs[] = new int[numberOfTc]; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
88a7add4124fb625278efe995a5ea115
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Codeforce { public static void main(String [] args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); if(n==4||n==1){ System.out.println(2); continue; } int temp = n%3; if(temp==1) System.out.println(n/3 +...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
3e17b81e9622ea77da7ca3f7b44af299
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class PalinInd{ static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){ br=new BufferedReader(new InputStreamReader(System.in)); } String next(){ while(st==null || ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
4a243a9a640db10fe090d648edb2cdac
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class NewVal{ public static void main(String[] args) { Scanner in=new Scanner(System.in); int testCases=in.nextInt(); for(int z=0;z<testCases;z++) { int n=in.nextInt(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
9ce63df49266c8f2f7d953feb2cfac09
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
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(); if(n==1){ System.out.println(2); continue; } int moves=n/3; int left=n%3; if(left==1){ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
ab6f118899c84c3b3e14bc313f160c2f
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
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(); if(n==1){ System.out.println(2); } else{ System.out.println((n+2)/3); } } ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
b45f25042d56574d4007b96c17b9ceb1
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class MyClass { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { long n = sc.nextLong(); long steps = 0; if(n==1) steps = 2; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
45d5bea8185b74550f29f3fd800835f6
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class GFG { 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(); if(n==1 || n==4){ System.out.print("2"); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
5d5207418e8b7f09cc7c6e2198adccf5
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { Scanner in=new Sc...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
f9cccc43fa2a6cd5a5dffca5fe463ad6
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Sca...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
e193fb1985bce79f920cebe17af2ef7e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Twothree{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); for(int i = 0; i < n; i++){ int k = scan.nextInt(); if(k == 2 || k == 3){ System.out.println(1); } else if(k == 1 || k == 4){ System.out.println...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
6ac2c87c7702faeb9b84588f78e8ed3e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t --> 0){ long n = sc.nextLong(); long ans = solve(n); System.out.println(ans); } } static long solve(long val){ long temp = val/6; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
51c20e4a425b29e39256967f077c74a3
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); int n; for (int i = 0; i < t; i++){ n = scanner.nextInt(); System.out.println(Main.solver(n)); } } public static int solver(...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
24566070bfe64445b2c234822a36bdf4
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; public class cp{ public static void main(String[] args)throws Exception{ BufferedReader br=new BufferedReader (new InputStreamReader(System.in)); PrintWriter pw=new PrintWriter(System.out); int t=Integer.parseInt(br.readLine()); w...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
22fdc001c7fd0738bb815fb67ea9e2d0
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; @SuppressWarnings("unused") public class A_2_3_Moves { public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); if...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
c6d28a0d4b25f239c7f59b3919562cfe
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for (int zz = 0; zz < t; zz++) { int n = in.nextInt(); if(n == 1) { System.out.println(2); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
400fbaea7eea3d0c6e7c65ef95894792
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Codeforces { static int M = 1_000_000_007; static int INF = 2_000_000_000; static int N = (int) 2e5 + 1; static long[] factorial; static boolean[] isPrime = new ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
d409d1846d11748335823e220a6d62a1
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.PrintWriter; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.FileReader; import java.io.IOException; import java.util.StringTokenizer; import java.util.ArrayList; import java.util.Collections; import java.util.Arrays; import java.util.Stack; import java.util.Ha...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
c11902ae3cb5afb4d3e765ee936cd54a
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Move2Or3 { public static void main(String[] args) { String input = "4\r\n" + "1\r\n" + "3\r\n" + "4\r\n" + "12\r\n" + ""; Scanner in = new Scanner(System.in); int t = in.nextInt(); for(int i = 0; i < t; i++) { int x = in.nextInt(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
ea9cecfa24f11203e0cd8848ae163a3e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.time.*; import static java.time.temporal.ChronoUnit.MINUTES; import javafx.util.Pair; public class Program { public static void print(Object str) { System.out.print(str); } public static void println(Object str) { Syste...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
270168755febdf267b14f1d26d59596f
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); System.out.println(solve(n)); } } public stati...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
e4d8f5e3e5c1fae7d5fb2532eaa63dc3
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import javafx.scene.shape.Line; import java.io.*; import java.math.BigInteger; public class Main { static Scanner sc = new Scanner(System.in); static PrintWriter pw = new PrintWriter(System.out); public static void main(String[] args) throws Exception { int tc = sc.nextInt(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
80f49a4f76b2537aea1d47b65231faa3
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
//package kg.my_algorithms.Codeforces; import java.io.*; import java.util.*; /* */ public class Solution { public static void main(String[] args) throws IOException { BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out)); FastReader fr = new FastReader(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
3fb23dd4df634bf814846991edc9c255
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.lang.Math; public class Main{ public static void main(String []args){ Scanner in=new Scanner(System.in); int T=in.nextInt(); while(T>0){ int n=in.nextInt(); int res=0; if(n==4){System.out.println("2");T--;continue;} ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
8e054509e6b03800e79f682179b685c1
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); int cur=n/3; int tmp=n%3; if(cur==0) { if(tmp==1) { System.out.println(2); } ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
169acf6d9348dd5733d1b65ed310d75d
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import static java.lang.Math.*; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.BigInteger; public class Main { static int g = 0; public static void main(String[] args) throws IOException { FastInput sc = new FastInput(); int t = sc.nextI...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
5d758175e7e4e057476fd14b6f803d4c
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; /* Name of the class has to be "Main" only if the class is public. */ public class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner s=new Scanner(System.in); int t=s.nextInt(); while(t-->...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
6bc4ade7bc9c70bcc914965f56d8e7e0
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class MainA { static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStream...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
ab8c023d703191c34fbe4d84d0cfe98e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = in.nextInt(); for(int tt = 0;tt<t;tt++){ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
44305b6fa739184db286ea1376b5bd68
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Moves { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int i; for (i = 0; i < t; i++) { int n = sc.nextInt(); int min = 0; if(n == 1) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
3d3ffe8886358956b37aac79b8c4e062
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int len = sc.nextInt(); int m = 0; for (int i = 0; i < len; i++) { int num = sc.nextInt(); Math.abs(num); if (num == 1) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
74a768027c1d1a29e1ecf4ca8c43fb40
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
//package two_three_moves; import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); public Main() { int t = sc.nextInt(); sc.nextLine(); for (int i = 0; i < t; i++) { int n = sc.nextInt(); int min = n / 3; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
7de444b02f932c1011b73584353ab1c4
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String[] args) throws IOException { FastReader in = new FastReader(System.in); PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out)); int t = in.nextInt(); for (int tt = 0; tt <...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
20e3c7269907e72a74b15f8701440336
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; public class Cf_0 { static class FastReader { InputStream is; private byte[] inbuf = new byte[1024]; private int lenbuf = 0, ptrbuf = 0; public FastReader(InputStream is) { this.is = is; } public int ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 8
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
104646291bc84556dab43df684227a9e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class SortedMatrixBs { 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 == 0) { System.out.println(0); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
f79c888ddf2702e9e65d54ca1c1d8d97
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Moves { public static int solve(int coordinates) { if(coordinates % 3 == 0) return coordinates / 3; else if(coordinates % 3 == 2) return coordinates / 3 + 1; else return (coordinates - 3) / 3 + 2; } ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
0d93da7f9e41269244b85eb5e902bcab
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
//package Algorithm; import java.awt.List; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Colle...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
77433b76429194edc2a089e474b8fea9
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; public class contest1 { static int power(int x, int y, int p) { int res = 1; x = x % p; while (y > 0) { if (y % 2 == 1) res = (res * x) % p; y = y >> 1; // y = y/2 x = (x *...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
2945a35a11cdd41b1eb21b9e64c5af17
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Moves2_3 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int test=1;test<=t;test++) { int n=sc.nextInt(); if(n%3==0) { System.out.println(n/3); } else if(n==1) { Sy...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
56127a9fa61201888ed1e446642425cb
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; //Incomplete public class ProbA { public static void main(String[] args) { FastReader in = new FastReader(); int numOfTestCases = in.nextInt(); for(int w = 0; w < numOfTestCases; w++) { int n = in.nextInt(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
08e59c6a67314fdf18b28af9295e53b1
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; //Incomplete public class ProbA { public static void main(String[] args) { FastReader in = new FastReader(); int numOfTestCases = in.nextInt(); for(int w = 0; w < numOfTestCases; w++) { int n = in.nextInt(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
80c4900f74e8184f2f0f18f0dc751d64
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.PrintWriter; import java.util.*; public class Main { public static class Pair { int x; int y; public Pair(int x, int y) { this.x = x; this.y = y; } } public static Scanner scan = new Scanner(System.in); public...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
2f1ad340142e8877e7277c99c9211bbf
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Moves { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i=0; i<n; i++){ solve(sc); } } public static void solve(Scanner sc) { int n = sc.nextInt();...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
48ffefd6fda10e7233307b129abe1f2a
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(),n,m1=0,m2=0; while(t-->0){ n=sc.nextInt(); if(n==1) System.out.println(2); else if(n%3==0) System.out.println(n/3...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
6429bf12ea078eb52a8d12d527529a55
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.util.*; public class TimePass { public static void main (String[] args) throws java.lang.Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); PrintWriter out=new PrintWriter(System.out); int testCases=Integer.parseInt(br...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
340fe1528300dbbeced91f711f60376d
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class App { public static Scanner scan = new Scanner(System.in); public static void main(String[] args) throws Exception { int t = Integer.parseInt(scan.nextLine()); while(t > 0) { System.out.println(solve()); t...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
b433325e011cfbd1675c792ca429104e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class moves__ { public static void main(String args[]){ Scanner read=new Scanner(System.in); int t=read.nextInt(); while(t-->0){ int n=read.nextInt(); if(n==1) System.out.println(2); else{ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
54638b64cfcff5e4ad525254426746ef
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class soln { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); long t = sc.nextLong(); for(int i = 0 ; i < t ; i++) { long n = sc.nextLong(); if(n < 0) { n = n*-1; } if(n == 1) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
f19445a269e000b3c788403b2ea75e56
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; public class CodeForces { public static void main(String args[])throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=Integer.valueOf(br.readLine()); while(t-->0) { int n=Integer.valueOf(br.readLi...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
f9dc3574d51a27e6d1716ca3c950fbc1
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class cf1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for(int i = 0; i < n; i++){ int k = sc.nextInt(); arr[i] = k; } ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
37a194a8d14891660aaa36c73fa8a670
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Solution{ public static void main(String args[]){ Scanner in = new Scanner(System.in); long test = in.nextLong(); while(test-- > 0){ long n = in.nextLong(); n = Math.abs(n); long ans = 0; if(n == 1) ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
bc05a5994be3fa98fbc7369ae09d5936
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
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();n=Math.abs(n); if(n==1) {System.out.println(2);continue; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
9f522df5efba0c05baeeff7cd7c779f2
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template */ import java.util.Scanner; public class Move { /** * @param args the command line arguments */ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
8d8dcc2dc4ea90420dcefcc2460d1133
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int i; int t = scn.nextInt(); while(t>0) { int ans=0; int n = scn.nextInt(); if(n==1) ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
e6a96a149d1ced78ee0f740d37444122
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedList; import java.uti...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
99bff69fd614fcb48347e3143f9362e9
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Solutions{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int testcase=sc.nextInt(); for(int i=0;i<testcase;i++){ int input=sc.nextInt(); if(input==1){ System.out.println(2); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
ebb9c93b48ac6c5649bae20d625cb0e7
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.io.*; /* * * 10 -> 4 * 10 -> 5 / 5 * * * * * */ public class B{ public static void main(String[] args) { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int t = fs.nextInt(); for(int tt=0;tt<t;tt++) { int move...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
c8016be90e9145a856efc3ff1b2b7d21
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class prg { public static Scanner sc=new Scanner(System.in); public static void main(String args[]) { int t=sc.nextInt(); for(int i=0;i<t;i++) run(); } public static void run() { int n=sc.nextInt(); if(n==1) ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
3f0b6d1241da5d553ad0460dbad0b74a
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int numOfTest = in.nextInt(); while (numOfTest-- != 0) { long num = in.nextLong(); if (num == 1) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
8567870f6827facb8b2b7bd31aec5027
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int numOfTest = in.nextInt(); while (numOfTest-- != 0) { long num = in.nextLong(); if (num == 1) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
a0353008ef1a61fbfed19fdda4ee9b09
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class CodeForces { static void algo(int n){ n=Math.abs(n); if(n==1){ System.out.println(2); return; } int moves; if (n%3==0){ moves=n/3; System.out.println(moves); return; } ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
d61bd185c1233359d66a3d44493fe81d
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class q1 { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); for(int i = 0 ; i < n ; i++) { int x = scn.nextInt(); if(x==1||x==4) { System.out.print...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
d55ebfa02966e681e4db9f00f905654e
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
// import static java.lang.System.out; import static java.lang.Math.*; import java.util.*; import javax.naming.ContextNotEmptyException; import javax.swing.ImageIcon; import javax.swing.table.TableStringConverter; import javax.swing.text.DefaultStyledDocument.ElementSpec; import java.io.*; import java.m...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
d0104c4ba533673a7894377023e0c79d
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
// import static java.lang.System.out; import static java.lang.Math.*; import java.util.*; import javax.naming.ContextNotEmptyException; import javax.swing.ImageIcon; import javax.swing.table.TableStringConverter; import javax.swing.text.DefaultStyledDocument.ElementSpec; import java.io.*; import java.m...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
daf6c77647b9df443d002c4966935d50
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.sql.PreparedStatement; import java.util.*; public class Main { static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next()...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
ca97b3faa7f49d0772dcead5f598fdee
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
//package Educational_Codeforces_Round_133; import java.util.Scanner; public class A { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = Integer.parseInt(scanner.nextLine().trim()); String[] out = new String[t]; for(int i = 0; i < t; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
7e252f639f1f7e5cae88edd42ec5f233
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; import java.math.*; public class A { public static void main(String[] args) throws java.lang.Exception { Reader scan = new Reader(); int tc = scan.nextInt(); for (int i = 0; i < tc; i++) { long n = scan.nextLong...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
7bb0e43d81cc5bdb109ed08008d002b1
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here S...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
48030aa7d2be9daff032f83ded4a073a
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class temp2 { static int ans(int n) { if(n==1) return 2; if(n%3==0) return n/3; return n/3+1; } public static void main (String[] args) { // your code goes here Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i<t; i++) { int n = sc.n...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
055c86477d122ca76e083c9f5a8c2a7c
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class ComdeFormces { static int dp[][]; static boolean mnans; public static void main(String[] args) throws Exception{ // TODO Auto-generated method stub // Reader.init(System.in); FastReader sc=new FastReader(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
b83f1a86af2a8089f2ddfee8cfa205b3
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.IOException; import java.util.Scanner; public class codeforces133div2 { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); int t = in.nextInt(); while (t-- > 0) { int n=in.nextInt(); int ans=0; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
8481505e03d2a93b820c3ed8fd2cafd0
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { int T=0; Scanner in ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
b92f655551d77bb72573cbd5d929d947
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; import java.util.concurrent.ThreadLocalRandom; public class ProblemA { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
38fc2c212b2947895663bc5395e00175
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0) { int n = sc.nextInt(); int ans=0; if(n<=3) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output
PASSED
1976480b4be01ee63777e50649e1ec93
train_109.jsonl
1659623700
You are standing at the point $$$0$$$ on a coordinate line. Your goal is to reach the point $$$n$$$. In one minute, you can move by $$$2$$$ or by $$$3$$$ to the left or to the right (i. e., if your current coordinate is $$$x$$$, it can become $$$x-3$$$, $$$x-2$$$, $$$x+2$$$ or $$$x+3$$$). Note that the new coordinate c...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int T=sc.nextInt(); while(T-->0){ int N = sc.nextInt(); int res=0; if(N==1) res=2; else if(N==2 || N==3) res=1; else res=(N%3==0 ? N/3 : N/3 + 1); System.out.prin...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 11
standard input
[ "greedy", "math" ]
208e285502bed3015b30ef10a351fd6d
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ lines describing the test cases follow. The $$$i$$$-th of these lines contains one integer $$$n$$$ ($$$1 \le n \le 10^9$$$) — the goal of the $$$i$$$-th test case.
800
For each test case, print one integer — the minimum number of minutes required to get from the point $$$0$$$ to the point $$$n$$$ for the corresponding test case.
standard output