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"There are two rival donut shops. The first shop sells donuts at retail: each donut costs a dollars. The second shop sells donuts only in bulk: box of b donuts costs c dollars. So if you want to buy x donuts from this shop, then you have to buy the smallest number of boxes such that the total number of donuts in them is greater or equal to x . You want to determine two positive integer values: If any of these values doesn't exist then that value should be equal to -1 . If there are multiple possible answers, then print any of them. The printed values should be less or equal to 10^9 . It can be shown that under the given constraints such values always exist if any values exist at all. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of testcases. Each of the next t lines contains three integers a , b and c ( 1 <= a <= 10^9 , 2 <= b <= 10^9 , 1 <= c <= 10^9 ). For each testcase print two positive integers. For both shops print such x that buying x donuts in this shop is strictly cheaper than buying x donuts in the other shop. x should be greater than 0 and less or equal to 10^9 . If there is no such x , then print -1 . If there are multiple answers, then print any of them. In the first testcase buying any number of donuts will be cheaper in the second shop. For example, for 3 or 5 donuts you'll have to buy a box of 10 donuts for 4 dollars. 3 or 5 donuts in the first shop would cost you 15 or 25 dollars, respectively, however. For 20 donuts you'll have to buy two boxes for 8 dollars total. Note that 3 and 5 are also valid answers for the second shop, along with many other answers. In the second testcase buying any number of donuts will be either cheaper in the first shop or the same price. 8 donuts cost 32 dolla"... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
85089033 |
KCSB |
A |
June 26, 2020, 4:32 a.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85088955 |
sudipto3331 |
A |
June 26, 2020, 4:30 a.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85086428 |
tejasva.jugran |
A |
June 26, 2020, 3:34 a.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85078306 |
Suman_Mandol |
A |
June 25, 2020, 11:08 p.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85068848 |
darshilp326 |
A |
June 25, 2020, 7:22 p.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85067503 |
iamnobody12 |
A |
June 25, 2020, 7:02 p.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85066929 |
khasrulShihab |
A |
June 25, 2020, 6:54 p.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85060701 |
Surkanti_Akshitha |
A |
June 25, 2020, 5:34 p.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85060017 |
992619er |
A |
June 25, 2020, 5:28 p.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85093216 |
SUNNY24 |
A |
June 26, 2020, 5:53 a.m. |
OK |
GNU C11 |
TESTS |
48 |
31 |
3993600 |
|
|
85075853 |
mobarak_aiub |
A |
June 25, 2020, 9:44 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85084442 |
LJC001115 |
A |
June 26, 2020, 2:48 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85084351 |
ezboy |
A |
June 26, 2020, 2:46 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85083691 |
MoRanSky |
A |
June 26, 2020, 2:30 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85083160 |
JJLeo |
A |
June 26, 2020, 2:15 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85072468 |
whoisthat |
A |
June 25, 2020, 8:26 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85048257 |
absinthe |
A |
June 25, 2020, 4:27 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85087933 |
JY_Poi |
A |
June 26, 2020, 4:08 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85022049 |
sidne |
A |
June 25, 2020, 3:29 p.m. |
OK |
GNU C++11 |
TESTS |
48 |
30 |
4096000 |
|
|
85088868 |
chen_03 |
A |
June 26, 2020, 4:28 a.m. |
OK |
GNU C++11 |
TESTS |
48 |
31 |
3993600 |
|
|
85055941 |
ffgghh |
A |
June 25, 2020, 4:52 p.m. |
OK |
GNU C++14 |
TESTS |
48 |
30 |
3993600 |
|
|
85084828 |
Yeir |
A |
June 26, 2020, 2:57 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85093642 |
WaheguruAnurag |
A |
June 26, 2020, 5:59 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85092924 |
Fahad.sm |
A |
June 26, 2020, 5:49 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85089978 |
n_i_k_h_i_l |
A |
June 26, 2020, 4:50 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85088948 |
uprising_rk |
A |
June 26, 2020, 4:30 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85087677 |
gaurav26 |
A |
June 26, 2020, 4:03 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85086042 |
adarsh1130 |
A |
June 26, 2020, 3:26 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85085557 |
shiv4s |
A |
June 26, 2020, 3:14 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85085511 |
jainnish98 |
A |
June 26, 2020, 3:13 a.m. |
OK |
GNU C++14 |
TESTS |
48 |
31 |
3686400 |
|
|
85027121 |
abhishekad7 |
A |
June 25, 2020, 3:38 p.m. |
OK |
GNU C++17 |
TESTS |
48 |
30 |
3686400 |
|
|
85093816 |
Ahs_58 |
A |
June 26, 2020, 6:01 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85093294 |
santhosh3 |
A |
June 26, 2020, 5:54 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85093084 |
KillMonger10 |
A |
June 26, 2020, 5:51 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85089847 |
melks |
A |
June 26, 2020, 4:47 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85089586 |
sathvikng |
A |
June 26, 2020, 4:42 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85089481 |
Magician__1307 |
A |
June 26, 2020, 4:41 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85089433 |
giriamit1999 |
A |
June 26, 2020, 4:40 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85089068 |
WrongAnswerInfinity |
A |
June 26, 2020, 4:33 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85088760 |
HrujulThumar22 |
A |
June 26, 2020, 4:26 a.m. |
OK |
GNU C++17 |
TESTS |
48 |
31 |
3686400 |
|
|
85065760 |
haruki_K |
A |
June 25, 2020, 6:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
30 |
4608000 |
|
|
85085958 |
t_121 |
A |
June 26, 2020, 3:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85093766 |
Mormo_1703119 |
A |
June 26, 2020, 6 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85093186 |
arjunbangari |
A |
June 26, 2020, 5:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85089037 |
s.b.bhadiyadara33 |
A |
June 26, 2020, 4:32 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85087937 |
ketan_sarode |
A |
June 26, 2020, 4:08 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85087594 |
mohitb987 |
A |
June 26, 2020, 4:01 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85087363 |
Infuse |
A |
June 26, 2020, 3:56 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85087041 |
beast_sid |
A |
June 26, 2020, 3:49 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85085459 |
Ameliorate |
A |
June 26, 2020, 3:12 a.m. |
OK |
GNU C++17 (64) |
TESTS |
48 |
31 |
4608000 |
|
|
85023865 |
llzhh |
A |
June 25, 2020, 3:32 p.m. |
OK |
Go |
TESTS |
48 |
124 |
10649600 |
|
|
85042519 |
snow_bear_328 |
A |
June 25, 2020, 4:13 p.m. |
OK |
Go |
TESTS |
48 |
124 |
10854400 |
|
|
85078848 |
habibulka |
A |
June 25, 2020, 11:31 p.m. |
OK |
Java 11 |
TESTS |
48 |
171 |
23859200 |
|
|
85021098 |
nz_nAJn |
A |
June 25, 2020, 3:27 p.m. |
OK |
Java 11 |
TESTS |
48 |
187 |
23756800 |
|
|
85085295 |
wizard98 |
A |
June 26, 2020, 3:08 a.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
23961600 |
|
|
85045615 |
ankita1028 |
A |
June 25, 2020, 4:20 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
23961600 |
|
|
85035718 |
satya_2810 |
A |
June 25, 2020, 3:56 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
23961600 |
|
|
85035299 |
tirtho2107 |
A |
June 25, 2020, 3:55 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
23961600 |
|
|
85014918 |
anhtaihsgs |
A |
June 25, 2020, 3:17 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
23961600 |
|
|
85073239 |
srjvastri8 |
A |
June 25, 2020, 8:42 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
24064000 |
|
|
85069115 |
nitesh.dtu |
A |
June 25, 2020, 7:26 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
24064000 |
|
|
85065882 |
Piccadilly |
A |
June 25, 2020, 6:40 p.m. |
OK |
Java 11 |
TESTS |
48 |
202 |
24064000 |
|
|
85093534 |
kunalkatiyar9 |
A |
June 26, 2020, 5:57 a.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85085882 |
Manan8686 |
A |
June 26, 2020, 3:22 a.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85070501 |
algo.java |
A |
June 25, 2020, 7:49 p.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85067955 |
A5SAS51N |
A |
June 25, 2020, 7:08 p.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85065904 |
Magikarp1 |
A |
June 25, 2020, 6:41 p.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85033741 |
adarshm_26 |
A |
June 25, 2020, 3:52 p.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85015084 |
shivang_1234 |
A |
June 25, 2020, 3:17 p.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20377600 |
|
|
85085739 |
saiharish |
A |
June 26, 2020, 3:18 a.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20480000 |
|
|
85023899 |
pulkit14 |
A |
June 25, 2020, 3:32 p.m. |
OK |
Java 8 |
TESTS |
48 |
109 |
20787200 |
|
|
85093157 |
conquerorArpit |
A |
June 26, 2020, 5:52 a.m. |
OK |
Java 8 |
TESTS |
48 |
124 |
20377600 |
|
|
85081696 |
Spheniscine |
A |
June 26, 2020, 1:23 a.m. |
OK |
Kotlin |
TESTS |
48 |
124 |
20480000 |
|
|
85061646 |
ivanocj |
A |
June 25, 2020, 5:46 p.m. |
OK |
Kotlin |
TESTS |
48 |
140 |
21094400 |
|
|
85047559 |
sultazat |
A |
June 25, 2020, 4:25 p.m. |
OK |
Kotlin |
TESTS |
48 |
140 |
21196800 |
|
|
85027360 |
v4_adi |
A |
June 25, 2020, 3:38 p.m. |
OK |
Kotlin |
TESTS |
48 |
156 |
21708800 |
|
|
85018675 |
Ruslan_Rud |
A |
June 25, 2020, 3:23 p.m. |
OK |
Kotlin |
TESTS |
48 |
171 |
21708800 |
|
|
85083981 |
KanhuKeNanu |
A |
June 26, 2020, 2:37 a.m. |
OK |
Kotlin |
TESTS |
48 |
171 |
21708800 |
|
|
85051593 |
riantkb |
A |
June 25, 2020, 4:33 p.m. |
OK |
Mono C# |
TESTS |
48 |
62 |
9216000 |
|
|
85072330 |
Smiita |
A |
June 25, 2020, 8:23 p.m. |
OK |
MS C++ |
TESTS |
48 |
31 |
4096000 |
|
|
85017229 |
Clocklight |
A |
June 25, 2020, 3:21 p.m. |
OK |
MS C++ |
TESTS |
48 |
31 |
4096000 |
|
|
85019758 |
twix123 |
A |
June 25, 2020, 3:25 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
31 |
3686400 |
|
|
85063651 |
imraazib |
A |
June 25, 2020, 6:10 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
31 |
3788800 |
|
|
85080542 |
pengyule |
A |
June 26, 2020, 12:36 a.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
31 |
3993600 |
|
|
85089642 |
Mbox |
A |
June 26, 2020, 4:43 a.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
31 |
3993600 |
|
|
85017326 |
hyyy_ele |
A |
June 25, 2020, 3:21 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
31 |
3993600 |
|
|
85025163 |
SyberiaEmperor |
A |
June 25, 2020, 3:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
46 |
3686400 |
|
|
85084666 |
snnnnnn |
A |
June 26, 2020, 2:53 a.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
46 |
3788800 |
|
|
85061993 |
kongoujisawa2358 |
A |
June 25, 2020, 5:50 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
46 |
3788800 |
|
|
85061686 |
Asthebel99 |
A |
June 25, 2020, 5:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
46 |
3788800 |
|
|
85024541 |
Myao |
A |
June 25, 2020, 3:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
48 |
46 |
3788800 |
|
|
85016897 |
Loremon |
A |
June 25, 2020, 3:20 p.m. |
OK |
Node.js |
TESTS |
48 |
93 |
13414400 |
|
|
85086595 |
cokifigue |
A |
June 26, 2020, 3:38 a.m. |
OK |
Node.js |
TESTS |
48 |
109 |
13414400 |
|
|
85055382 |
explorer_sifat |
A |
June 25, 2020, 4:49 p.m. |
OK |
Node.js |
TESTS |
48 |
109 |
13414400 |
|
|
85031277 |
OmniSliver |
A |
June 25, 2020, 3:46 p.m. |
OK |
Node.js |
TESTS |
48 |
124 |
13414400 |
|
|
85039674 |
sarvagya8 |
A |
June 25, 2020, 4:06 p.m. |
OK |
Node.js |
TESTS |
48 |
124 |
14950400 |
|
|
85060712 |
crapplet |
A |
June 25, 2020, 5:35 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
155 |
23654400 |
|
|
85069512 |
snape_here |
A |
June 25, 2020, 7:32 p.m. |
OK |
PyPy 2 |
TESTS |
48 |
265 |
31948800 |
|
|
85060901 |
UTMoonlight |
A |
June 25, 2020, 5:37 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
155 |
21708800 |
|
|
85053808 |
PS41 |
A |
June 25, 2020, 4:40 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
155 |
22220800 |
|
|
85064005 |
zahin52 |
A |
June 25, 2020, 6:15 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
155 |
23552000 |
|
|
85033433 |
Achilles221B |
A |
June 25, 2020, 3:51 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
156 |
23040000 |
|
|
85022256 |
GoatTimeDavis |
A |
June 25, 2020, 3:29 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
170 |
21504000 |
|
|
85083627 |
anilsaxena |
A |
June 26, 2020, 2:28 a.m. |
OK |
PyPy 3 |
TESTS |
48 |
170 |
23142400 |
|
|
85056199 |
x3mka |
A |
June 25, 2020, 4:54 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
171 |
22220800 |
|
|
85024765 |
rishabhrathi22 |
A |
June 25, 2020, 3:33 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
171 |
23142400 |
|
|
85024050 |
Galaxy_Pegasus |
A |
June 25, 2020, 3:32 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
171 |
23142400 |
|
|
85060255 |
2019ucp1350 |
A |
June 25, 2020, 5:30 p.m. |
OK |
PyPy 3 |
TESTS |
48 |
171 |
23244800 |
|
|
85068029 |
ap1008 |
A |
June 25, 2020, 7:09 p.m. |
OK |
Python 2 |
TESTS |
48 |
187 |
6451200 |
|
|
85083052 |
KanhuKeNanu |
A |
June 26, 2020, 2:11 a.m. |
OK |
Python 3 |
TESTS |
48 |
108 |
6656000 |
|
|
85087294 |
checkingagain |
A |
June 26, 2020, 3:55 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85087146 |
checkingagain |
A |
June 26, 2020, 3:51 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85086991 |
checkingagain |
A |
June 26, 2020, 3:48 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85086952 |
checkingagain |
A |
June 26, 2020, 3:47 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85085825 |
checkingagain |
A |
June 26, 2020, 3:21 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85085363 |
_Kumarmohit_ |
A |
June 26, 2020, 3:09 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85085347 |
rg4 |
A |
June 26, 2020, 3:09 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85084006 |
WaAccept |
A |
June 26, 2020, 2:37 a.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85067976 |
LintuStorm |
A |
June 25, 2020, 7:09 p.m. |
OK |
Python 3 |
TESTS |
48 |
109 |
6656000 |
|
|
85024751 |
masa0216masa0216masa0216 |
A |
June 25, 2020, 3:33 p.m. |
OK |
Ruby |
TESTS |
48 |
62 |
6451200 |
|
|
85047095 |
ktn_yuta |
A |
June 25, 2020, 4:24 p.m. |
OK |
Rust |
TESTS |
48 |
46 |
3788800 |
|
|
85082591 |
Russell_Emerine |
A |
June 26, 2020, 1:56 a.m. |
OK |
Rust |
TESTS |
48 |
46 |
4096000 |
|
|
85023431 |
bqn |
A |
June 25, 2020, 3:31 p.m. |
OK |
Rust |
TESTS |
48 |
46 |
4096000 |
|
|
85056402 |
IvanDyachenko |
A |
June 25, 2020, 4:55 p.m. |
OK |
Scala |
TESTS |
48 |
545 |
39936000 |
|
|
85057032 |
IvanDyachenko |
A |
June 25, 2020, 4:59 p.m. |
OK |
Scala |
TESTS |
48 |
546 |
39936000 |
|
|
remove filters
Back to search problems