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
75b0c8cf0c1c1ef57a764c9a8cc5a714
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 tc = 0; tc < t; ++tc) { int n = sc.nextInt(); System.out.println(solve(n)); } sc.close(); } static int solve(int n) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
e908aece115944ec90786fe56df395ca
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.math.*; public class Aditya { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for(int i = 0;i < t;i++){ int n = in.nextInt(); if(n == 1){ System.out.print...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
c0ed60f60e24c019731d083d90e13af7
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.*; /** * * @author eslam */ public class IceCave { static class Kattio extends PrintWriter { private BufferedReader r; private StringTokenizer st; // standard input public Kattio() { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
80adea4464b3b7ac8071caa79d23e3aa
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.util.*; public class Reach{ 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) ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
eece9fe8caed40c6a002fe38fb20a12d
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; /** * @author Nikolay Chistykov */ public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); while (n-- > 0) { int t = sc.nextInt(); if (t == 1) { ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
03b04f4046e135ed7fb82f7c78b490e2
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 Temp { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for (int i = 0; i < t; i++) { int num = scanner.nextInt(); int moves; if (num == 2 || num ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
5238a8fae1011380ea4787df0e295bdf
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 MainClass{ static class Reader{ private final BufferedReader reader; private StringTokenizer tokenizer; Reader(InputStream input) { this.reader = new BufferedReader(new InputStreamReader(input)); th...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
9e0c6f894faa0f41a9db5c6a76edebfc
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 TwoThreeMoves { public static void main(String[] args) { Scanner kb = new Scanner(System.in); int t = kb.nextInt(); while(t-->0){ int n = kb.nextInt(); int time =0; if(n == 1) time = 2; else...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
8004b60aa938002933931d47560a7f6c
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 Solution { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int T= sc.nextInt(); for(int t=0;t<T;t++){ int n=sc.nextInt(); int[] add= {0,2,1,1,2,2}; if(...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
47c094c3067f4c33005dd7d1a87bb82e
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 Main { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
094ae904aab2ab9d2ea8ca37a33b003a
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 tests { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int a =scanner.nextInt(); for(int i = 0; i < a; i++) { int b = scanner.nextInt(); int res = b/3; int tmp = b%3; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
0f9476425bd799e5d9f10ebf8ef3c740
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 A { public static void main(String args[]) throws IOException { FastReader sc = new FastReader(); PrintWriter out = new PrintWriter(System.out); int tc, i, j; String s; char p; tc = sc.nextInt(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
d6251d68cce6934d9f69f7fe33b6c2e7
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.function.*; import java.io.*; // you can compare with output.txt and expected out public class RoundEdu133A { MyPrintWriter out; MyScanner in; // final static long FIXED_RANDOM; // static { // FIXED_RANDOM = System.currentTimeMillis(); // } final static String I...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
fb82003bd05328d7bcd33bd274f5f99a
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(), num; for (int i = 0; i < t; i++) System.out.println((num = sc.nextInt()) / 3 + (num != 1 ? Math.min(1, num % 3) : 2)); } }
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
4cd7d2a2cc72deb7c6f3fb30dedae0e2
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[]) { try (Scanner in = new Scanner(System.in)) { int t; t=in.nextInt(); int n; while(t>0) { n=in.nextInt(); int d=n%3; ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
78faab994cac3448703a1ceea930fb4a
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; public class TwoToThreeMoves { public static void main(String[]args) throws NumberFormatException, IOException { InputStreamReader is = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(is); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
ae236ff82a900b90c645d955f98f319b
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[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); if(n%3==0) System.out.println(n/3); else if(n%3==1) System.out.pr...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
e686748a63337f64bdf42a92c0c5d1a2
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 temp { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); for (int k = 1; k <= t; k++ ){ int n=sc.nextInt(); if (n==1) System.out.println(2); else System.out.println...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
c32c26de83193f816ae71b0449760244
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 temp { public static void main(String[] args) { Scanner inp = new Scanner(System.in); int t=inp.nextInt(); for (int kase = 1; kase <= t; kase++ ){ int n=inp.nextInt(); if (n==1) System.out.println(2); else System....
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
44ab52cf6f8006112b77c7d65f5d0b52
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; /** * 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...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
51a0948085ebbf38751094e23d49bd6a
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.nio.file.FileSystemNotFoundException; import java.util.*; public class five { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); for(int i =0;i<t;i++){ int n = s.nextInt(); if(n==1) Sy...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
889257abd62fd03ddb26c71e6a90820d
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.abs; import static java.lang.Math.min; import static java.lang.Math.max; import static java.lang.Math.log; import java.util.*; import java.lang.*; import java.io.*; public class a_Codeforces { public static void main(String[] args) throws...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
707beb4ffbfe5ee077b810bdbe9f1780
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 c1716a { 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%3==0) System.out.println(n/3); els...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
a3b9ed5a66a5b186c80bd7de6ba17ca6
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 Test { public static void main (String[]args) { Scanner sc=new Scanner (System.in); int test=sc.nextInt(); while(test-->0) { int n=sc.nextInt(); n=Math.abs(n); 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 17
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
96ef18003a463de487842cd80825aa1b
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 17
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
e03a47eec9afd4bec0ba84a2a0143156
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[]) { // Your code goes here int t; Scanner sc=new Scanner (System.in); t=sc.nextInt(); for(int k=0;k<t;k++) { int n,q; n=sc.nextInt(); if(n==1) { System.out.println("2"); continue; } q=n...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
241df3f3c136627ec6b62f4f6bf8c1d1
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 solution{ 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....
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
cc3311a1a20aa55aa4ae215875e034ee
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 com.tdorosz._1716; import java.util.Scanner; public class Moves23 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int testCases = scanner.nextInt(); for (int i = 0; i < testCases; i++) { executeTestCase(scanner); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
21907bc94bb13433b7c46acaffab0d0b
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 J_1716A { public static void main(String argv[]) { Scanner x=new Scanner(System.in); int t=x.nextInt(); for(int i=0;i<t;i++) { int s=0; int n=Math.abs(x.nextInt()); if(n==1) S...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
254eec99e2865120984ffa8001b08f39
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) { //write your code here Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int tt = 0; tt < t; tt++) { double n=sc.nextDouble(); if(n==1){ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
e36853f4f0f1a5dda0cd2e864a8d1f45
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 void main(String []args){ Scanner sc=new Scanner (System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); if(n==1 || n==4) System.out.println(2); else { int...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
075540f43cc5ad16487002ed7086e940
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 Test { public static void main(String[] args) throws IOException { Reader rd = new Reader(); int t = rd.nextInt(); while (t-- > 0) { long n = rd.nextLong(); long twoMovesOnl...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
0a30be31bef8d3a78bd48b0980e334c1
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 input = new Scanner(System.in); int T = input.nextInt(); for(int t = 0; t < T; ++ t) { int temp = input.nextInt(); if(temp == 1) { System.out.pri...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
a147b066f98ff5c3c7d1e3fa487e16db
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.StringTokenizer; public class TaskA { public static void main(String[] args) { FastScanner in = 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 17
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
8a1fe7fa524d98c05d09d5ae86f305c7
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; public class _1716A { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int tc = Integer.parseInt(br.readLine()); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
b2e7f4e74a234b744b1c412b24881b3b
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 CP{ public static void main(String[] args){ int t ; Scanner input = new Scanner(System.in); t = input.nextInt(); for (int i = 0 ;i<t ;i++){ int n = input.nextInt(); if (n/3 == 0){ if (n == 1){ ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
06d8336c3091894e4416b03c7cb8c155
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 moves { public static void main(String args[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); int t = Integer.parseInt(br.readLine()); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
4e1aceff2e6b10eb457463cb4d2c3314
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.StringTokenizer; public class Solution { static final FastReader fr = new FastReader(); static class FastReader { BufferedReader br; StringTokenizer st; public F...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
d0edb9f450cc024e1fac93025427dccd
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 javax.lang.model.util.ElementScanner14; public class pavan { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); BufferedWriter output = new BufferedWriter(new OutputStreamWriter(System.out)); long t = sc.nextLong(); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
f72c234c6c1d847b5b080b6926785e79
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(), num; for (int i = 0; i < t; i++) System.out.println((num = sc.nextInt()) / 3 + (num != 1 ? Math.min(1, num % 3) : 2)); } }
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
cb48929a88d151b2dde9e0e2cbe88abb
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 CF1716A { // For fast input output static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("in...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
f27ee34beef66c03b29d2f6c48456c0f
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 First; import java.io.*; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Scanner; public class MyProject { public static void main(String[] args) { int t; Scanner in = new Scanner(System.in); ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
b0c59fe82d897cd0255a1dce392557c7
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 t = in.nextInt(); while(t-->0){ int n = in.nextInt(); System.out.println( (n == 1) ? 2 : (((n + 2) / 3)) ...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
fa8270e6e3b86179bf32a7d30bb50fd9
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 codeforces.rounds.r1716; import java.io.*; public final class A { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); in...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
f301a506175aab81f17f48c6cb835815
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.PrintWriter; public class MyClass { public static void main(String args[]) { Scanner sc =new Scanner(System.in); int tc = sc.nextInt(); PrintWriter out = new PrintWriter(System.out); while(tc != 0){ tc--; int n = sc.ne...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
650a6f3b68d4d69ec3f562ac21ffa28a
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 Problem3 { static Scanner scanner = new Scanner(System.in); static void solve() { int x = scanner.nextInt(); int ans =(int) Math.ceil((double) x / 3.); if (x == 1) ans ++; System.out.println(ans); } public static voi...
Java
["4\n\n1\n\n3\n\n4\n\n12"]
1 second
["2\n1\n2\n4"]
null
Java 17
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
ce0542c066475a5ed2a2628ca9c67244
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.util.Scanner; import java.util.StringTokenizer; public class forCP { public static void main(String[] args) throws IOException { ...
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
130b1ef88679599f71cde07b54d60046
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.*; public class Main { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tokenizer=null; public static void main(String[] args) throws IOException { new Main().execute(); } void debug(Object...os) ...
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
39fcf723ce435c22c537772802200a9c
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 { static Scanner in = new Scanner(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { int t = Integer.parseInt(in.nextLine()); StringBuilder sb = new StringBuilde...
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
7e9bb699f78c9c917a80f5774b7938b0
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 scanner = new Scanner(System.in); int t = Integer.parseInt(scanner.nextLine()); for(int i = 0; i < t; i++){ int n = Integer.parseInt(scanner.nextLine()); 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
cc60eb4268a56f4611852cbaffb90d52
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 scanner = new Scanner(System.in); int t = Integer.parseInt(scanner.nextLine()); long[] arr = new long[t]; for(int i = 0; i < t; i++){ arr[i] = Long.parseLong(scanner.nextLi...
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
fb11346fd6bd54697ec4cfa164c4e622
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 A { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scn = new Scanner(System.in); int t = scn.nextInt(); int[] arr = new int[t]; for (int i = 0;i<arr.length;i++) { arr[i] = scn.nextInt(); } for (int i = 0;i<ar...
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
8bbdaa456a3c537e30bc13b662e66e21
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 forces2 { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { // int n= sc.nextInt(); String s; s = sc.next(); ...
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
01e1ca8a6e661f5a793443ea31ddee12
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){ // code here.... long n = sc.nextLong(); System.out.println(solve(n)); } } public static long solve(long 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
5e87fde86a17e57b9681f4e2187961fc
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
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class C { static StringBuffer 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
49a41ad86fb83159fd0cd9888ac93807
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
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class C { static StringBuffer 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
ca48e34e0ad0ead8e90c0fb34d5990b5
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 a=sc.nextInt(); int ans=count(a); System.out.println(ans); 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
57778f8fb4e1bdaf3629bed31dd208f3
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 contest { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); BufferedReader br = new BufferedReader(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
9e33f3a22d692e55443f8ed2ccc8f3ed
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) { new Thread(null, () -> new Main().run(), "1", 1 << 23).start(); } private void run() { FastReader scan = new FastReader(); 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
a555340790d7426b2285d603edf847f2
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(); for (int i = 0; i < t; i++) { long a=scanner.nextLong(); if(a==4||a==-4){ System.out.pri...
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
ae77e8c91bc924b1dd627bfc5539bb58
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 ProblemA { 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(); Integer min = null; for (int y = n / 3 - 6; y <= n / 3 + 3; y++) { int val = 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
3452408bc4cfe41f0aec40e77b2af75c
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(); for(int i=0; i<t; i++){ int n = sc.nextInt(); if(n==1){ System.out.println(2); } else if(n%3 == 0){ System.out.println(n/3); } else{...
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
0ec64eb98ee5819c894b36a31b056ad0
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(); for(int i=0; i<t; i++){ int 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 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
30603ff373feb35d4958079e3fb0ecdd
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 scn = new Scanner(System.in); int cases = scn.nextInt(); while(cases-->0){ long num = scn.nextLong(); if(num==1) System.out.println(2); else if(num%3==0) S...
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
846351c467f0153873a8c738be131539
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.InputStreamReader; public class Moves { public static void main(String[] args) throws Exception { // TODO Auto-generated method stub BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in)); int numOfTestCases = Integer.parseInt(buffered...
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
d392d8a92aeb8ddf4d8d7a6726b4f47b
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 hii{ public static void main(String arg[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=1;i<=n;i++) { int c=0; int a=sc.nextInt(); if(a==1 || a==-1) c=2; else { ...
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
d8c9ab066421005c774ecda137934dd7
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 hii{ public static void main(String arg[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=1;i<=n;i++) { int c=0; int a=sc.nextInt(); if(a==1 || a==-1) c=2; else { ...
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
5b573578aa2aa69e60fc58314112aa50
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 hii{ public static void main(String arg[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=1;i<=n;i++) { int c=0; int a=sc.nextInt(); if(a==1 || a==-1) c=2; else { ...
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
7f9fda303f28f7a6c66233fc23a75a91
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 moves23 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int n=in.nextInt(); while(n-->0){ 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
90472325474df41a46062bce79074085
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 codeforces2 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int t=s.nextInt(); while(t>0) { int n=s.nextInt(); n=Math.abs(n); int tt=n/3; if(n==2){ Sys...
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
bb961d7216eb290fa0d8253b3af526d0
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.*; public class Codechef { /* FastReader class to work with input */ static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader...
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
8eca377bdd184f0fb62beb43a04a7eeb
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 A { static void solve(boolean ok) { if (ok) System.out.println("YES"); else System.out.println("NO"); } public static String toBin(int n) { String s = ""; return s; } public static void main(String[] args) { FastScanner sc = new Fas...
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
d7954befcd17aea3a685063639140744
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.File; import java.io.FileReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Solution { static PrintWriter pw; static FastScanner s; public static void main(String[] arg...
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
e615756ff1516e2c063456cf37597dd1
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
//KENAA import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.Queue; import java.util.St...
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
0a7e35e10adc248dfbe95b6859b644d7
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.net.URI; import java.net.URISyntaxException; import java.sql.Array; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util....
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
633511dd1ad3ae1d66b71d20b5b66af4
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 Main { public static void main(String[] args) throws IOException { FastReader sc = new FastReader(); int tc = sc.nextInt(); //int tc=1; while(tc-->...
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
bb302c35f0cd4656de3de94634a3dc9c
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 t = sc.nextInt(); for(int i = 0;i<t;i++) { int n = sc.nextInt(); if(n%2 == 0 && n%3 == 2) { 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
e2183f409348637d5f175548887ee8f4
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; /** * A. 2-3 Moves */ public class Main { static class FastReader { BufferedReader reader; StringTokenizer tokenizer; FastReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(strea...
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
0bed72129e49529f4da95c34d53ffe28
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 edu_133_a { public static void main(String args[]){ FScanner in = new FScanner(); PrintWriter out = new PrintWriter(System.out); int t = in.nextInt(); while(t-->0) { int n=in.nextInt(); if(n==1) out.println(2); els...
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
ed83f04c5908bc453681299c603da959
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.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.util.Iterator; import java...
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
f4965ac6fb3d04d1debbde10c96d96fd
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 ProblemA { public static int getCountBy3(int n) { if (n % 3 == 0) { return n / 3; } else if (n % 3 == 2) { return n / 3 + 1; } else { return (n / 3) + 1; } } public static void main(String args[]) { Scanner sc = 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
bed9f67135a09ad95dd0d0839b2d8a88
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 ProblemA { public static int getCountBy2(int n) { if (n % 2 == 0) { return n / 2; } return n / 2 + 2; } public static int getCountBy3(int n) { if (n % 3 == 0) { return n / 3; } else if (n % 3 == 2) { return n / 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
117bec46b3f3496feef5308fea291408
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.*; //System.out.println(); public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long t = sc.nextInt(); while(t-->0) { long n = sc.nextLong(); if(n%3==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
bd17ac2a2d79af2ed4d3800a8bee7a03
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.*; /** * Goal is to reach point n * * In 1minute, can move by 2 or by 3 to the left or to the right * * Input: * First line contains one integer - number of test cases * t lines describing test cases * * Output: Minimum number of minutes required to get from point 0 to the...
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
97a6edc21d4f56c0d99b52798a5cac32
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 int moves(int n) { if(n==1) return 2; if(n==4) return 2; int temp=n; int min=0; if(n%3==0) return n/3; else if(n%3!=0) { int m=n%3; if(m==1) return (n-4)/3+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
ac9fda6e7042bba42094b93e66a2e854
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){ int n=sc.nextInt(); n=Math.abs(n-0); int val=0; if(n%3==0){ val=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
47c1f3e7084ea27cd05426ff6392c4c5
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.math.BigInteger; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; import java.util.*; import static java.lang.System.out; public class app { public static ArrayList<ArrayList<Integer>>as=new ArrayList<>(); public static Boole...
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
bd9add437e07cced3a9b32be645ded09
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 Tttest { public static int fun(int n) { int ans=0; if(n==1) { return 2; }else if(n==2 || n==3) { return 1; } ans=n/3; if(n%3>0) { ans++; } return ans; } public static void main(String[] args){ // TODO Auto-generated method stu...
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
a41af7ac57bfd32fc0d57c2bd1c0c6b7
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 { int number; public Moves(int number){ this.number=number; } public int posNumber(int number){ if(number<0){ number*=-1; } return number; } public void input(int number){ int num=posNumber(number); if (num==1){ num=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
d3e98824db32625961eec257286fa4a3
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.StringTokenizer; public class Main { public static void main(String[] args) { FastScanner fs = new FastSca...
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
314af37ec1f67526e92cf190366be40c
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 sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0) { int n = sc.nextInt(); int q = 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
9208b9927d79fd656d0028169da28aa4
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 twoThreeMoves { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int arr[] = new int[t]; for(int i=0;i<t;i++){ int n = sc.nextInt(); if(n%3 == 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
a0e16b024b2151ac045eafd865dcd3d6
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 test{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int count = t; while(count>0){ long n; n= sc.nextInt(); 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
df63ac5ac0a71aab8b865b9e5982a9ba
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.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import jav...
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
d186e5eb9200a590e44ee03f97eab012
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 A { public static void main(String[] args) { FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for (int ttt = 1; ttt <= T; ttt++) { int n = in.nextInt(); ...
Java
["4\n\n1\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
74d3352e11ebfba1ccbe889189c5d680
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) { final Scanner scanner = new Scanner(System.in); int t=scanner.nextInt(); while (t--!=0){ int n=scanner.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
534c14acf2cc0b479cc24938e36002bf
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 MyClass { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); while(n-->0){ int x=sc.nextInt(); if(x == 1) System.out.println(2); else if(x == 2) System.out.println(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
49f6640bfd53adc7cad355cf4c90c429
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 preparation; /** * @author krishnam * */ import java.util.*; public class Solution { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-- >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
b101faa6f998ca2c3e3ac461bd40902a
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 Codeforce133A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0){ int n = sc.nextInt(); int x=0; if(n==1){ x=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
0a94d51064cd6f60b68206536248261f
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.StringTokenizer; public class Main { public static void main(String [] args) { FastScanner fs=new FastScanner(); PrintWriter out=new PrintWriter(System...
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