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.
Problems
B"Spring has come, and the management of the AvtoBus bus fleet has given the order to replace winter tires with summer tires on all buses. You own a small bus service business and you have just received an order to replace n tires. You know that the bus fleet owns two types of buses: with two axles (these buses have 4 wheels) and with three axles (these buses have 6 wheels). You don't know how many buses of which type the AvtoBus bus fleet owns, so you wonder how many buses the fleet might have. You have to determine the minimum and the maximum number of buses that can be in the fleet if you know that the total number of wheels for all buses is n . The first line contains an integer t ( 1 <= t <= 1 ,000 ) -- the number of test cases. The following lines contain description of test cases. The only line of each test case contains one integer n ( 1 <= n <= 10^{18} ) -- the total number of wheels for all buses. For each test case print the answer in a single line using the following format. Print two integers x and y ( 1 <= x <= y ) -- the minimum and the maximum possible number of buses that can be in the bus fleet. If there is no suitable number of buses for the given n , print the number -1 as the answer. In the first test case the total number of wheels is 4 . It means that there is the only one bus with two axles in the bus fleet. In the second test case it's easy to show that there is no suitable number of buses with 7 wheels in total. In the third test case the total number of wheels is 24 . The following options are possible: So the minimum number of buses is 4 and the maximum number of buses is 6 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
157207422 |
mtasfi |
A |
May 14, 2022, 12:58 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
6 |
31 |
0 |
|
|
157257936 |
Lin_YuHuai |
A |
May 15, 2022, 4:36 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157256543 |
yaotianqi |
A |
May 15, 2022, 4:08 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157253486 |
luoZH111 |
A |
May 15, 2022, 2:38 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157253204 |
mjx233 |
A |
May 15, 2022, 2:29 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157251636 |
abhi_jitnag123 |
A |
May 15, 2022, 1:28 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157251029 |
AnosVoldigoad |
A |
May 15, 2022, 12:57 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157241976 |
Oolrich |
A |
May 14, 2022, 7:17 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157241751 |
MahmoudSerag |
A |
May 14, 2022, 7:12 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157239121 |
abhipatnaikdkl |
A |
May 14, 2022, 6:30 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157237884 |
AtharvaDing |
A |
May 14, 2022, 6:12 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
0 |
0 |
|
|
157258495 |
YuvrajSakshith |
A |
May 15, 2022, 4:46 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157258011 |
akshitgarg09 |
A |
May 15, 2022, 4:38 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157257874 |
nik4o |
A |
May 15, 2022, 4:35 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157257434 |
wifiiii |
A |
May 15, 2022, 4:28 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157257330 |
Lizel |
A |
May 15, 2022, 4:26 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157255984 |
ee1190466 |
A |
May 15, 2022, 3:47 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157254242 |
ershisiqiaomingyueye |
A |
May 15, 2022, 2:57 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157253703 |
HHU_fl |
A |
May 15, 2022, 2:44 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157253216 |
practice_sip |
A |
May 15, 2022, 2:29 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157253131 |
kritinsharma |
A |
May 15, 2022, 2:27 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
0 |
0 |
|
|
157258353 |
Richw818 |
A |
May 15, 2022, 4:44 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157257553 |
Abhichauhan |
A |
May 15, 2022, 4:30 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157255884 |
wrc |
A |
May 15, 2022, 3:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157251426 |
Eter.nal |
A |
May 15, 2022, 1:17 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157241101 |
EDkinGG |
A |
May 14, 2022, 7:01 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157237779 |
john4567 |
A |
May 14, 2022, 6:10 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157237367 |
john4567 |
A |
May 14, 2022, 6:05 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157235688 |
Abhi_sahu |
A |
May 14, 2022, 5:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157225281 |
pinkfloyed |
A |
May 14, 2022, 3:47 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
157224126 |
Virtual_Dark |
A |
May 14, 2022, 3:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
0 |
0 |
|
|
remove filters
Back to search problems