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
323d52f04dc79792bf629107a3f37742
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int diff= Math.abs(b-c) + (...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
34af75a2edc31ef81188057d2e8d7ef4
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Codeforces { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); for(int i = 0; i < n; i++){ int a = in.nextInt(); int b = in.nextInt(); int c = in.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
ae9f8ec9ab5e1c0e5184918b2677d540
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Codeforces { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testCases = sc.nextInt(); while (testCases > 0){ int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
23cba963d083f78e7169876f3eab03f8
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Random; import java.util.StringTokenizer; public class abes { public static void ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
7dee2982139d1be57c78143d980064d0
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.List; 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...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
1301bb42cb1ce52bd828c1b5a373454d
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class KMPAlgorithm { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T=sc.nextInt(); while(T>0){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int diff = a-1; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
cf833532bcd6fc0e514cdbb1ce4a3f25
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Code2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0){ int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); if((a - 1) <(Math.abs(c ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
7a79eb5fabbed48ed78e650c834cbeaf
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class pro1 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); t--; if(Math.abs(a-...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
74020dffca3cad1c905e1661b4e79268
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here try { Scanner s = new Scanner(System.in); int ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
1ce69fc09e70859cf08ad00be22744da
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class cf6 { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int t=sc.nextInt(); while(t>0){ long a=sc.nextLong(); long b=sc.nextLong(); long c=sc.nextLong(); long m=(a-1); long d=Math.abs(b-c)+Math.abs(c-1); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
54f0f1ea22b605d4732dec7580f361d4
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class cf2 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); int a,b,c; for(int i=0;i<t;i++) { a= sc.nextInt(); b= sc.nextInt(); c= sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
da6aa29e0d4a3894513f4b5e72c46636
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; 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 a = sc.nextInt(), b= sc.nextInt(), c = sc.nextInt(); if((a-1)< (Math.abs(...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
18bfe63ac0f4ea1c9ffa5ae4796c8b3c
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
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
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
93643eee8528299dfac1dac8f65e9985
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Elevators{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t= sc.nextInt(); while(t!=0){ int a= sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int first= a-1; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
9edf5d09372089da530e652e204a7749
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Temp { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { t--; int a = sc.nextInt(); int b = sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
286629093bf4980691c638fe2be34ad9
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
103331f7862528f973648cea2dc14c10
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Practise { public static void main(String[] args) { int t; Scanner obj = new Scanner(System.in); t = obj.nextInt(); while(t-->0){ int a = obj.nextInt(); int b = obj.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
d340eb267911326e02a9dbddcad11f29
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.DataInputStream; import java.io.IOException; public class CF1729 { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
150aff7d435e86f5875ef5a5fc2efca0
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class CF1729 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); int a, b, c; for (int i = 1; i <= t; i++) { a = scan.nextInt(); b = scan.nextInt(); c...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
625a2625c9fccdde4d030a8d9ab9bfb6
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Solution { static boolean check = false; // public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStream...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
d7ab034749f90410f305d39b68cd6231
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static int twoElevators(int a, int b, int c) { int elevatorTime2 = Math.abs(c - b) + c; if (elevatorTime2 > a) { return 1; } else if (elevatorTime2 < a) { return 2; } return 3; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
e468787f3b4f090f702ae0a1a0f81879
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Solve { static Scanner sc = new Scanner(System.in); private static void solve() { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); a--; int a1 = Math.abs(c - b) + (c - 1); if (a < a1) { System.out.println(1); } if (a > a1) { System.out.prin...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
a1779bec49cf8acda17a3fd4e448329f
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int num=input.nextInt(); int i; for(i=1;i<=num;i++){ int a=input.nextInt(); int b=input.nextInt(); int c=input.nextInt(); int first=a-1; int second=Math.abs(b-c)+c-1; if(second>first){ ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
ee86ec8b197f950ac02e748cf5008ff7
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input =new Scanner(System.in); int x = Integer.parseInt(input.next()); for (int i = 0; i < x; i++) { int a = input.nextInt(); int b = input.nextInt(); int c =...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
bdb3093790726dd228a6f99e67c40e0d
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input =new Scanner(System.in); int x = Integer.parseInt(input.next()); for (int i = 0; i < x; i++) { int a = input.nextInt(); int b = input.nextInt(); int c =...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
e32b435e3d1562d2d2ea35308416ede5
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.lang.Math; import java.util.*; public class lift { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t; t = sc.nextInt(); while(t>0){ int a,b,c; a = sc.nextInt(); b = sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
2fd42d18fce7e58abcbcc19c6c3dda29
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
//package Java_classes; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Two_Elevators { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
5625fc48a09bbd5f0f8f0c63145b6982
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.lang.Math; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t--!=0) { int a=sc.nextInt(), b=sc.nextInt(), c=sc.nextInt(); int t1=Math.abs(a-1); int t2=Math.abs(b-c)+Math.abs(c-1...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
d97ac38e8e5a2b1f3013150f95f21f18
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class twoElevators { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int m...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
2409625c0b600b50ac34ee94661319d3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { static int compute(int a, int b, int c) { int d1 = Math.abs(a-1); int d2 = Math.abs(b-c) + Math.abs(c-1); if (d1 < d2) { return 1; } else if (d1 > d2) { return 2; } else { return 3; } ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
1d4bcf92e53c5243fa8d2ea8cfa80eaf
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner inp = new Scanner(System.in); int t = inp.nextInt(); while (t-- > 0) { int a = inp.nextInt(), b = inp.nextInt(), c = inp.nextInt(); int timea = a - 1; int ti...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
5dbb5efedf1d8813a7fbbc2c8fb00825
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class ContestX { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { var t = sc.nextInt(); for (var ti = 0; ti < t; ti++) { var a = sc.nextInt(); var b = sc.nextInt(); var c = sc.nextInt(); var...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
035d3e7523edce12af6922343d744496
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Codechef { public static class Pair { int x; int y; public Pair(int x, int y) { this.x = x; this.y = y; } } private static final int modulo = 1000000007; public static Scanner scan = new Scan...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
2db2b6aa03143804e080953540c946d9
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); int n = input.nextInt(); int a, b, c, razn; for (int i = 0; i < n; i++){ a = input.nextInt(); b = input.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
895ace495579611b01e00afd07ff7db2
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int g=1; int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int x=Math.abs(a-g); int y=Math.abs((c-b...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
550e4c58301261743d818a4147b29519
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; /* Set<String> hash_Set = new HashSet<String>(); // Demonstrating Set using HashSet // Declaring object of type String Set<String> hash_Set = new HashSet<String>(); // Adding elements to the Set // using add() me...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
a0be5e601e8e2a82b8407a5cd60ca43e
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Practice { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); int a, b, c, l1 = 0; int l2 = 0; for(int i = 0; i < t; i++){ a = scan.nextInt(); b = scan.n...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
b7237d4a0ff0ef534b401799fc3ed44a
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class TwoElevators { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); if((a-1) < (Math.ab...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
ab78b9e02e7a753cfe368abb721feaa3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Codeforces { private static final int INT_MAX = 999999999; /*public static int power(int x,int n) { if(n==0) return 1; return x*power(x,n-1); }*/ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int test=...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
de2ed6efa94d7e58cca6bc319b8c102d
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.ne...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
e410f461df80a030b7a638f6e121cb44
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.util.Scanner; public class file { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); while(t>0) { int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.next...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
172d9e92ac5e3aaa08c8fc2f7078edc3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { Scanner sc=new Scanner(System...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
659b1a9400b2956ce1db89d865ca093f
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class solution{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int m = 1; m <= n; m++){ int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int diffOne = a - 1; int diffTwo = 0; if(b...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
776f6c0d0975ee6af9c8b34c3704e7b2
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class p2{ public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int a =sc.nextInt(),b =sc.nextInt(),c=sc.nextInt(); int f = Math.abs(b-c)+Math.abs(c-1)+1; if(f>a) { System.ou...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
0b3caef3a0a654dfb5708ca0310f7846
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class TwoElevators { public static void main(String[] args) { Scanner mS = new Scanner(System.in); long a; long b; long c; long dis; int rep = mS.nextInt(); for(int i = 0; i < rep; ++i) { a = mS.nextLong(); b = mS.nextLong(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
b3f2241c78f8550cdadb19ef172fd6bc
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
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 a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
abddec5a0e6776b7966515b2abe7f760
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
/** * * @author AshwinA */ import java.util.*; import java.lang.*; import java.io.*; public class CP_IMP_2{ public static void main (String[] args) throws java.lang.Exception{ Reader in = new Reader(); Writer out = new Writer(); int t = in.nextInt(); while(t-->0){ int a = in.next...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
dd8ad33dbbb1c9bfeb328e3d2b0e5fcc
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.io.*; public class CF1729A { // For fast input output static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try { br = new BufferedReader( new FileReader("in...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
637ae65198367da44b2c69ef7aa08483
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
// package Round817_div4; import java.util.Scanner; public class test2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); while(n-->0){ // int f = 0; int a = sc.nextInt(); int b = sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c4361f6f016aa5193519ed09e3fcd34f
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
// package ide; import java.util.*; import java.lang.*; public class codechef { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int t=1; t=sc.nextInt(); while(t-->0){ // Scanner sc = new Scanner(System.in); int a= sc...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
2df43de33bed48e20006a1486a0c644e
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; public class elevator { public static void main(String[] args) { Scanner scnr = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int testCases = scnr.nextInt(); for (int i = 0; i < testCases; i++) { int el1 = s...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
840419930498661f5e08476bfe29f1d4
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.nio.charset.StandardCharsets; import java.util.Scanner; public class CF1729A { public static void main(String[] args) { Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8); int t = scanner.nextInt(); for (int i = 0; i < t; i++) { int a = scanner....
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
8b441d36dee8a785f8fcdee45e6b8bf3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = Integer.parseInt(sc.nextLine()); while (t>0){ long a = sc.nextInt(); long b = sc.nextInt(); long c = sc.nextInt(...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
4733463182da1e9d3d34e20efaaee00f
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; /** * * @author eslam */ public class Solution { // Beginning of the solution static Kattio input = new Kattio(); static BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out)); static ArrayList<Ar...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
b0617d4ea51b2ee967f7f508d7ffddfa
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
//package com.tdorosz._1729; import java.util.Scanner; public class TwoElevators { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int testCases = scanner.nextInt(); scanner.nextLine(); for (int i = 0; i < testCases; i++) { handleTestCase(scanner); } } private stati...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
2ed52ec6810a1f595326fa9981167bf4
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.io.*; public class TwoElevators { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
cb832b8f7846fd2c5b36552c0faa8c82
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
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 a = in.nextInt(); int b = in.nextInt(); int c = in.nextInt(); int t1 ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
3dc313a95a39c13ac12efcc679e2cae3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
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 a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int x = Math.abs(1-a); int y = M...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
12d649d8a39c7650cc2f3440b2c32c62
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; /** * a ==> the floor of first elevator * b ==> position of the second elevator heading to c * c ==> floor number * * Get the seconds of (A) heading to ground (a - 1) * Get the seconds of (B) heading to (C) (max(b, c) - min(b, c)), * Then Go to the ground (c - 1) */ public...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
e6237b56040344d75225a5278ea09ca4
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
/** * * @author Mohammed_Ramadan */ import java.util.*; public class TwoElevators { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); for (int i = 1; i <...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 17
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
9e4f951adedbc0c3492f5351a99e102c
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in=new Scanner (System.in); long a=in.nextLong(); for (int i = 0; i < a; i++) { long x=in.nextLong(),y=in.nextLong(), z=in.nextLong(); long...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
7737a76a6d9921852b68975fc306627a
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class a { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t > 0) { long a = sc.nextLong(); long b = sc.nextLong(); long c = sc.nextLong(); long x =...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
f7ab505efbe70650feb08978988e9f85
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class cf3 { public static void main(String[] args) { Scanner sc =new Scanner(System.in); int t=sc.nextInt(); for(int k=0;k<t;k++){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); int d=1; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
32dfdfc56cc3ec67df6846c959b5ec86
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Tttest { public static int fun(long a,long b,long c) { long timeA=a-1; long timeB=0; if(b<c) { timeB=c-b; timeB+=(c-1); }else if(c<b) { timeB=b-1; }else { timeB=b-1; } if(timeA>timeB) { return 2; }e...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
e0cb3eb86babd18a1ce0b44bc5b83242
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.math.BigInteger; import java.util.*; public class Exercise5 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a= sc.nextInt(); for (int i = 0; i < a; i++) { int b= sc.nextInt(); int c= sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
fbb8757b811403d5f8b11a33b74f2f29
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Solution { public static boolean isPrime(int num){ if(num==0||num==1) return false; for(int i=2;i<=num/2;i++){ if(num%i==0) return false; } return true; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
62a860578e86de9d6082976e98e307f5
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class A_Two_Elevators{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i=0;i<t;++i) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextI...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
112b6aca81b28b75fe0c740164713783
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Coding { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] answers = new int[n]; for (int i = 0; i < n; i++) { int[] floors = new int[3]; for (int j = ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
b89eb85fc2c26a2f369aac187aa7eea1
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int timea=0;int timeb=0; for(int i=0;i<n;i++) { int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
d373a21da4e83a769fea452480971c13
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) throws IOException{ Scanner sc = new Scanner(System.in); int t = sc.nextInt() ; while(t-->0) { int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int diff = Math.abs(b-c) +...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c5db944260f3b83a69fb3c5d5771b39c
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Map; import java.util.Scanner; public class ssss { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0; i < t; i ++){ int a = sc.nextInt(); int b = sc.nextInt(); in...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
fd0782bf6d7b9065b0cf94a2e3ff1527
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; @SuppressWarnings("unchecked") public class CodeForces{ public static void main(String[] args){ Scanner input = new Scanner(System.in); int t = input.nextInt(); while(t-- > 0){...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
ca5f711d9a92aad1fb1767911e1953b3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
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 a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); int d =Math.abs(b-c)+Math.abs(c-1); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
6e4a844d88e07ff4a86e2675e82edd05
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
// package javass; import java.util.Scanner; public class javass { static Scanner stdin=new Scanner(System.in); public static int read(){ return stdin.nextInt(); } public static void main(String args[]){ for(int t=read();t>0;t--){ int a=read(),b=read(),c=read(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
8ca28b052725c1e66234e490f0ca5a2e
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; import java.math.*; import java.security.*; import java.text.*; import java.util.*; import java.util.concurrent.*; import java.util.function.*; import java.util.regex.*; import java.util.stream.*; import javax.lang.model.util.ElementScanner6; import javax.sound.midi.SysexMessage; import...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
69633dbc7a7245e55287636c419e0f93
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String args[]) { Scanner s=new Scanner(System.in); int t=s.nextInt(); while(t>0) { long a[]=new long[3]; for(int i=0;i<3;i++) { a[i]=s.next...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c47bb0ed358e882844bb5db3a42e6136
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
//package practicing; import java.io.*; import java.lang.*; import java.math.BigInteger; import java.util.*; public class test { public static Comparator<String> getComp(){ return new Comparator<String>() { @Override public int compare(String o1, String o2) { ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
8590a7b8808f17f276ade896ea2b8e07
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.StringTokenizer; public class CodeForces { public static void main(String[] args) { StringBuilder stringBuilder = new StringBuilder(); FastReader fastReader = new FastReader(); int n = fastReader.nextInt(); int[...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
3714ee08929bfb13c014747f362b5022
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; public class Main { public static void main(String[] args) throws IOException { FastScanner sc =new FastScanner(); PrintWriter w =new PrintWriter(System.out); int n = sc.nextInt(); while (n-- !=0){ int a =sc.nextInt(); int b=sc....
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
fbdda7555247da94cac9191111b7340d
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int T=sc.nextInt(); for(int k=0;k<T;k++) { long a=sc.nextInt(); long b=sc.nextInt(); long c=sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
4810687c09bf7fd86bd839b7fc6d0b99
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { Scanner in = new Scanner(System.in); int test = in.nextInt(); int a = 0, b =0 ,c =0; while(test-- > 0 ) { a= in.nextInt(); b = in...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c88c58b8dddb8888222c03aeef62f837
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class x { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int test=sc.nextInt(); while(test-->0) { int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); if(a==1...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c7f64f12c623997adc044b0706ed5e9b
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class TwoLifts { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int input[] = getInts(reader.readLi...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
081bc13fbbab5a74d0bbd445c1386d08
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class TwoLifts { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int amountOfNumbers=scan.nextInt(); for (int i=0;i<amountOfNumbers;i++){ int a= scan.nextInt(); int b= scan.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
69d9d31fcc116904ac46e24b89bc96a0
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; /** * * @author devil */ public class Codeforces { public static void main(String[] args) { Scanner sc=new Scanner (System.in); int t=sc.nextInt(); while(t-->0){ int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(); int d=a-1; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
598bf1cb617f3b641a4e0488cd0aca4d
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
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 a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
8cd40db4ead9548ef889a5891107c4d2
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; import java.lang.Math; public class TwoElevetorsCodeForces { public static void main(String[] args) { Scanner as=new Scanner(System.in); int t, a, b, c; t=as.nextInt(); while(t--!=0){ a=as.nextInt(); b=as.nextInt(); c=as.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
74d76fc6c68dfe525f7aa70e30b5ccaf
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.math.BigInteger; import java.util.*; import java.io.BufferedReader; import javax.print.DocFlavor; import java.io.*; import java.math.BigInteger; import java.util.*; public class lol { static Scanner in = new Scanner(System.in); static FastScanner scanner = new FastScanner(); public ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
4ac119bb4b48bd8d2ba757a0309b77ab
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class leet { public static void main(String[] args) { Scanner shyn = new Scanner(System.in); ArrayList<Integer> numbers = new ArrayList<Integer>(); int a = shyn.nextInt(); int c = 0; for (int i = 0; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
b335dcdf4afe39b448ebacc9d5cf438b
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class freecode { public static void main(String[]args) { Scanner sc = new Scanner(System.in); int h = sc.nextInt(), t1, t2; int a, b, c; for(int i = 0; i < h; i++){ a = sc.nextInt();b = sc...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
37061a0f0273d274e41f8f0b7f6e8520
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static class Reader { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Reader() { this(System.in); } public Reader(InputStream input) { ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
cc1f56a717f45e4164f77b6945c11578
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static class Reader { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public Reader() { this(System.in); } public Reader(InputStream input) { ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
cfde71fb9d969d20e77489cd32b6f2f1
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class elevator { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scn = new Scanner(System.in); long t = scn.nextInt(); for(long i = 0;i<t;i++) { long a = scn.nextLong(); long b = scn.nextLong(); long c = scn.nextLong(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
8d3d22abe575e61e93c27ad6582b1fa2
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.io.*; public class TwoElevators { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); while(t-->0) { String s[] = br.readLine...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
64819209f87c369d9bc2c343502d2ead
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java .util.*; public class leetcode { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0 ; i<t ; i++) { long a = sc.nextLong(); long b = sc.nextLong(); long c = sc.ne...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c2566af0bbec450ebe6485da640061bf
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class Solution{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++){ sc.nextLine(); int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
c8ff13dd491eb126cf1d99652a543195
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.Scanner; public class A_Two_Elevators{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=0;i<n;i++){ int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
404a641bbfb26394ddf4517180c724d3
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
//import com.sun.jdi.Value; import java.io.*; import java.util.*; public class Main { // static long gcd(long a, long b) { // if (a == 0) return b; // return b == 0 ? a : gcd(b, a % b); // } // static int lcm(int a, int b) { return (a * b)/gcd(a, b); } public static voi...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
26ac974be6c60a10da033a94569faa1c
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
//package com.company; import java.io.*; import java.util.*; public class Cf_0 { private static class FastReader { InputStream is; private byte[] inbuf = new byte[1024]; private int lenbuf = 0, ptrbuf = 0; public FastReader(InputStream is) { this.is = is; ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output
PASSED
441a8e0e181ee3102d697160888e1488
train_110.jsonl
1662993300
Vlad went into his appartment house entrance, now he is on the $$$1$$$-th floor. He was going to call the elevator to go up to his apartment.There are only two elevators in his house. Vlad knows for sure that: the first elevator is currently on the floor $$$a$$$ (it is currently motionless), the second elevator is lo...
256 megabytes
import java.util.*; public class prog1 { static int solve(int arr[]) { int ans = 0; if(arr[0] == 1) { return 1; } int a = arr[0] - 1; int b = Math.abs(arr[1] - arr[2]); if(arr[2] != 1 && arr[2]>arr[1]) { b = 2*b; b = b + Math.abs(arr[1] - 1); } if(arr[2] !=1 && ...
Java
["3\n\n1 2 3\n\n3 1 2\n\n3 2 1"]
1 second
["1\n3\n2"]
NoteIn the first test case of the example, the first elevator is already on the floor of $$$1$$$.In the second test case of the example, when called, the elevators would move as follows: At the time of the call, the first elevator is on the floor of $$$3$$$, and the second one is on the floor of $$$1$$$, but is alread...
Java 8
standard input
[ "math" ]
aca2346553f9e7b6e944ca2c74bb0b3d
The first line of the input contains the only $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. This is followed by $$$t$$$ lines, three integers each $$$a$$$, $$$b$$$ and $$$c$$$ ($$$1 \le a, b, c \le 10^8$$$, $$$b \ne c$$$) — floor numbers described in the statement.
800
Output $$$t$$$ numbers, each of which is the answer to the corresponding test case. As an answer, output: $$$1$$$, if it is better to call the first elevator; $$$2$$$, if it is better to call the second one; $$$3$$$, if it doesn't matter which elevator to call (both elevators will arrive in the same time).
standard output