Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
ContestId |
Name |
Phase |
Frozen |
Duration (Seconds) |
Relative Time |
Start Time |
1571
|
Kotlin Heroes: Episode 8 |
FINISHED |
False |
9900 |
103562663 |
Oct. 7, 2021, 2:35 p.m. |
Problems
B"Alex has bought a new novel that was published in n volumes. He has read these volumes one by one, and each volume has taken him several (maybe one) full days to read. So, on the first day, he was reading the first volume, and on each of the following days, he was reading either the same volume he had been reading on the previous day, or the next volume. Let v_i be the number of the volume Alex was reading on the i -th day. Here are some examples: You know that Alex was reading the volume v_a on the day a , and the volume v_c on the day c . Now you want to guess which volume was he reading on the day b , which is between the days a and c (so a < b < c ). There may be some ambiguity, so you want to make any valid guess (i. xe2 x80 x89e. choose some volume number v_b so it's possible that Alex was reading volume v_a on day a , volume v_b on day b , and volume v_c on day c ). Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 100 ). Description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 100 ) -- the number of volumes the novel consists of. The second line of each test case contains two integers a and v_a ( 1 <= a <= 98 ; 1 <= v_a <= a ) denoting that Alex was reading volume v_a at day a . The third line of each test case contains two integers c and v_c ( a + 2 <= c <= 100 ; v_a <= v_c <= c ) denoting that Alex was reading volume v_c at day c . The fourth line of each test case contains one integer b ( a < b < c ) -- the day you are interested in. It's guaranteed that the input is not controversial, in other words, Alex could read volume v_a at day a and volume v_c at day c . For each test case, print the possible index of volume Ale"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
131078519 |
songsinger |
B |
Oct. 7, 2021, 2:47 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
0 |
|
|
131084926 |
Tony1234_ |
B |
Oct. 7, 2021, 3:42 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20377600 |
|
|
131084446 |
dextron99 |
B |
Oct. 7, 2021, 3:37 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20377600 |
|
|
131078979 |
sokian |
B |
Oct. 7, 2021, 2:51 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20377600 |
|
|
131078717 |
dim3x38on |
B |
Oct. 7, 2021, 2:49 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20377600 |
|
|
131078075 |
ostroumov |
B |
Oct. 7, 2021, 2:44 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20377600 |
|
|
131077874 |
nor |
B |
Oct. 7, 2021, 2:43 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20377600 |
|
|
131077662 |
Spheniscine |
B |
Oct. 7, 2021, 2:41 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20480000 |
|
|
131077626 |
SpyCheese |
B |
Oct. 7, 2021, 2:41 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20480000 |
|
|
131077447 |
xiaowuc1 |
B |
Oct. 7, 2021, 2:40 p.m. |
OK |
Kotlin 1.4 |
TESTS |
5 |
93 |
20480000 |
|
|
131078389 |
9646516 |
B |
Oct. 7, 2021, 2:47 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
171 |
24780800 |
|
|
131089587 |
lethan3 |
B |
Oct. 7, 2021, 4:52 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
171 |
24883200 |
|
|
131078431 |
jainmilind |
B |
Oct. 7, 2021, 2:47 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
171 |
24883200 |
|
|
131078350 |
bobib |
B |
Oct. 7, 2021, 2:46 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
171 |
24883200 |
|
|
131078813 |
Atul2608 |
B |
Oct. 7, 2021, 2:50 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
186 |
24780800 |
|
|
131079774 |
Bogdan_feysa |
B |
Oct. 7, 2021, 2:57 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
186 |
24883200 |
|
|
131078254 |
Egor |
B |
Oct. 7, 2021, 2:45 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
186 |
24883200 |
|
|
131077890 |
lightseba |
B |
Oct. 7, 2021, 2:43 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
186 |
24883200 |
|
|
131077982 |
arvindf232 |
B |
Oct. 7, 2021, 2:43 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
186 |
24985600 |
|
|
131100183 |
harsh__h |
B |
Oct. 7, 2021, 7:41 p.m. |
OK |
Kotlin 1.5 |
TESTS |
5 |
186 |
25600000 |
|
|
remove filters
Back to search problems