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'Jay managed to create a problem of difficulty x and decided to make it the second problem for Codeforces Round #921. But Yash fears that this problem will make the contest highly unbalanced, and the coordinator will reject it. So, he decided to break it up into a problemset of n sub-problems such that the difficulties of all the sub-problems are a positive integer and their sum is equal to x . The coordinator, Aleksey, defines the balance of a problemset as the GCD of the difficulties of all sub-problems in the problemset. Find the maximum balance that Yash can achieve if he chooses the difficulties of the sub-problems optimally. The first line of input contains a single integer t ( 1 <= q t <= q 10^3 ) denoting the number of test cases. Each test case contains a single line of input containing two integers x ( 1 <= q x <= q 10^8 ) and n ( 1 <= q n <= q x ). For each test case, print a single line containing a single integer denoting the maximum balance of the problemset Yash can achieve. For the first test case, one possible way is to break up the problem of difficulty 10 into a problemset having three problems of difficulties 4 , 2 and 4 respectively, giving a balance equal to 2 . For the second test case, there is only one way to break up the problem of difficulty 5 into a problemset of 5 problems with each problem having a difficulty 1 giving a balance equal to 1 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
243699869 |
bkifhr9 |
B |
Jan. 28, 2024, 3:07 a.m. |
OK |
Clang++17 Diagnostics |
TESTS |
78 |
170 |
0 |
|
|
243704706 |
2445928989 |
B |
Jan. 28, 2024, 4:14 a.m. |
OK |
Clang++20 Diagnostics |
TESTS |
78 |
109 |
0 |
|
|
243676954 |
pallavshrm27 |
B |
Jan. 27, 2024, 8:12 p.m. |
OK |
Clang++20 Diagnostics |
TESTS |
78 |
202 |
7372800 |
|
|
243690613 |
phantrongnghia510 |
B |
Jan. 27, 2024, 11:53 p.m. |
OK |
Clang++20 Diagnostics |
TESTS |
78 |
234 |
0 |
|
|
243683139 |
Nishant984 |
B |
Jan. 27, 2024, 9:22 p.m. |
OK |
GNU C11 |
TESTS |
78 |
46 |
307200 |
|
|
243710003 |
jiangzw |
B |
Jan. 28, 2024, 5:20 a.m. |
OK |
GNU C11 |
TESTS |
78 |
46 |
307200 |
|
|
243705558 |
Calvin65 |
B |
Jan. 28, 2024, 4:25 a.m. |
OK |
GNU C11 |
TESTS |
78 |
436 |
307200 |
|
|
243687723 |
zedanov |
B |
Jan. 27, 2024, 10:43 p.m. |
OK |
GNU C++17 |
TESTS |
78 |
31 |
0 |
|
|
243695092 |
SathvikGoud |
B |
Jan. 28, 2024, 1:47 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
31 |
204800 |
|
|
243713997 |
jitu7033 |
B |
Jan. 28, 2024, 6 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243713751 |
VorpalSword |
B |
Jan. 28, 2024, 5:57 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243713664 |
diveshchauhan792004 |
B |
Jan. 28, 2024, 5:56 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243713214 |
Partik_Malasi |
B |
Jan. 28, 2024, 5:52 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243713149 |
Partik_Malasi |
B |
Jan. 28, 2024, 5:52 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243714002 |
_samit_ |
B |
Jan. 28, 2024, 6 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243714171 |
yolo.lyc |
B |
Jan. 28, 2024, 6:01 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243714084 |
Trilliverse |
B |
Jan. 28, 2024, 6 a.m. |
OK |
GNU C++17 |
TESTS |
78 |
46 |
0 |
|
|
243699787 |
BYR_KKK |
B |
Jan. 28, 2024, 3:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
31 |
0 |
|
|
243698823 |
HHHHHchain |
B |
Jan. 28, 2024, 2:50 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
31 |
0 |
|
|
243693197 |
EasonLiang |
B |
Jan. 28, 2024, 1:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
31 |
0 |
|
|
243712283 |
wjy_axxx |
B |
Jan. 28, 2024, 5:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243713395 |
ddhw111 |
B |
Jan. 28, 2024, 5:54 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243711817 |
Zass11 |
B |
Jan. 28, 2024, 5:39 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243711488 |
yxyxyx |
B |
Jan. 28, 2024, 5:35 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243707508 |
Zjiajun |
B |
Jan. 28, 2024, 4:51 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243707261 |
Gayatri_Loungani |
B |
Jan. 28, 2024, 4:47 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243707118 |
star-night-rain |
B |
Jan. 28, 2024, 4:46 a.m. |
OK |
GNU C++17 (64) |
TESTS |
78 |
46 |
0 |
|
|
243670500 |
____noOne____ |
B |
Jan. 27, 2024, 7:20 p.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
31 |
0 |
|
|
243668672 |
Mustafa_Elghisha |
B |
Jan. 27, 2024, 7:06 p.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
31 |
0 |
|
|
243691050 |
Wind_Flute |
B |
Jan. 28, 2024, 12:05 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
31 |
0 |
|
|
243695983 |
Dynamic_Pigeon |
B |
Jan. 28, 2024, 2:03 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
31 |
0 |
|
|
243700412 |
qqqqqqqwy |
B |
Jan. 28, 2024, 3:15 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
31 |
0 |
|
|
243687376 |
dennisyakovlev40 |
B |
Jan. 27, 2024, 10:36 p.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
31 |
102400 |
|
|
243714049 |
pailanikitha714 |
B |
Jan. 28, 2024, 6 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
46 |
0 |
|
|
243714083 |
KuNaL8103 |
B |
Jan. 28, 2024, 6 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
46 |
0 |
|
|
243714197 |
iAMtornado |
B |
Jan. 28, 2024, 6:01 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
46 |
0 |
|
|
243714179 |
scanner |
B |
Jan. 28, 2024, 6:01 a.m. |
OK |
GNU C++20 (64) |
TESTS |
78 |
46 |
0 |
|
|
243714198 |
fabiowg |
B |
Jan. 28, 2024, 6:01 a.m. |
OK |
Java 21 |
TESTS |
78 |
296 |
409600 |
|
|
243707844 |
JAY.SHREE.RAM |
B |
Jan. 28, 2024, 4:55 a.m. |
OK |
Java 21 |
TESTS |
78 |
296 |
409600 |
|
|
243673282 |
DriveLilah |
B |
Jan. 27, 2024, 7:40 p.m. |
OK |
Java 21 |
TESTS |
78 |
296 |
409600 |
|
|
243674895 |
mangos194 |
B |
Jan. 27, 2024, 7:53 p.m. |
OK |
Java 21 |
TESTS |
78 |
311 |
307200 |
|
|
243701157 |
V1GYAT |
B |
Jan. 28, 2024, 3:25 a.m. |
OK |
Java 21 |
TESTS |
78 |
327 |
307200 |
|
|
243674807 |
kbliu |
B |
Jan. 27, 2024, 7:52 p.m. |
OK |
Java 21 |
TESTS |
78 |
343 |
307200 |
|
|
243709509 |
prateeksama2003 |
B |
Jan. 28, 2024, 5:14 a.m. |
OK |
Java 21 |
TESTS |
78 |
343 |
409600 |
|
|
243703752 |
priyaroy3370 |
B |
Jan. 28, 2024, 4 a.m. |
OK |
Java 21 |
TESTS |
78 |
358 |
0 |
|
|
243684729 |
ryanhmercer |
B |
Jan. 27, 2024, 9:46 p.m. |
OK |
Java 21 |
TESTS |
78 |
358 |
819200 |
|
|
243705176 |
BlizGale |
B |
Jan. 28, 2024, 4:20 a.m. |
OK |
Java 21 |
TESTS |
78 |
374 |
204800 |
|
|
243707824 |
achyut88 |
B |
Jan. 28, 2024, 4:55 a.m. |
OK |
Java 8 |
TESTS |
78 |
156 |
0 |
|
|
243685238 |
Harwinvanak |
B |
Jan. 27, 2024, 9:55 p.m. |
OK |
Java 8 |
TESTS |
78 |
170 |
0 |
|
|
243714089 |
coderman2004 |
B |
Jan. 28, 2024, 6 a.m. |
OK |
Java 8 |
TESTS |
78 |
171 |
0 |
|
|
243669306 |
Sumitsingh7 |
B |
Jan. 27, 2024, 7:11 p.m. |
OK |
Java 8 |
TESTS |
78 |
171 |
5836800 |
|
|
243709598 |
siraz16 |
B |
Jan. 28, 2024, 5:15 a.m. |
OK |
Java 8 |
TESTS |
78 |
186 |
0 |
|
|
243699465 |
Gavind |
B |
Jan. 28, 2024, 3 a.m. |
OK |
Java 8 |
TESTS |
78 |
187 |
0 |
|
|
243704675 |
prakhar_30 |
B |
Jan. 28, 2024, 4:13 a.m. |
OK |
Java 8 |
TESTS |
78 |
202 |
0 |
|
|
243697615 |
Gavind |
B |
Jan. 28, 2024, 2:30 a.m. |
OK |
Java 8 |
TESTS |
78 |
202 |
0 |
|
|
243689225 |
chiragsingh876 |
B |
Jan. 27, 2024, 11:18 p.m. |
OK |
Java 8 |
TESTS |
78 |
202 |
0 |
|
|
243685837 |
EricM08 |
B |
Jan. 27, 2024, 10:05 p.m. |
OK |
Java 8 |
TESTS |
78 |
202 |
0 |
|
|
243681551 |
PotatoPerson |
B |
Jan. 27, 2024, 9:02 p.m. |
OK |
Kotlin 1.7 |
TESTS |
78 |
326 |
0 |
|
|
243684365 |
NajlSadek |
B |
Jan. 27, 2024, 9:40 p.m. |
OK |
MS C++ 2017 |
TESTS |
78 |
46 |
0 |
|
|
243707093 |
fww |
B |
Jan. 28, 2024, 4:45 a.m. |
OK |
MS C++ 2017 |
TESTS |
78 |
62 |
0 |
|
|
243690933 |
NajlSadek |
B |
Jan. 28, 2024, 12:01 a.m. |
OK |
MS C++ 2017 |
TESTS |
78 |
62 |
0 |
|
|
243699915 |
aluckyboy |
B |
Jan. 28, 2024, 3:07 a.m. |
OK |
MS C++ 2017 |
TESTS |
78 |
140 |
0 |
|
|
243655813 |
samurai_0028 |
B |
Jan. 27, 2024, 4:43 p.m. |
OK |
Perl |
TESTS |
78 |
1404 |
0 |
|
|
243680065 |
fiveIsDoor |
B |
Jan. 27, 2024, 8:44 p.m. |
OK |
PyPy 3 |
TESTS |
78 |
171 |
3174400 |
|
|
243684649 |
4rn4vg |
B |
Jan. 27, 2024, 9:45 p.m. |
OK |
PyPy 3 |
TESTS |
78 |
187 |
4300800 |
|
|
243701022 |
231414 |
B |
Jan. 28, 2024, 3:23 a.m. |
OK |
PyPy 3 |
TESTS |
78 |
202 |
3891200 |
|
|
243695742 |
aksonov |
B |
Jan. 28, 2024, 1:59 a.m. |
OK |
PyPy 3 |
TESTS |
78 |
202 |
4198400 |
|
|
243696660 |
aksonov |
B |
Jan. 28, 2024, 2:15 a.m. |
OK |
PyPy 3 |
TESTS |
78 |
218 |
3891200 |
|
|
243705644 |
deveshbedmutha |
B |
Jan. 28, 2024, 4:26 a.m. |
OK |
PyPy 3 |
TESTS |
78 |
296 |
4710400 |
|
|
243711343 |
helltractor |
B |
Jan. 28, 2024, 5:34 a.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
202 |
3379200 |
|
|
243689536 |
NitroSpear |
B |
Jan. 27, 2024, 11:25 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
202 |
3584000 |
|
|
243689381 |
_aadiupadhyay_ |
B |
Jan. 27, 2024, 11:22 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
202 |
4505600 |
|
|
243688812 |
RobinFromTheHood |
B |
Jan. 27, 2024, 11:08 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
202 |
10035200 |
|
|
243703435 |
ProCoder12 |
B |
Jan. 28, 2024, 3:55 a.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
217 |
3379200 |
|
|
243667518 |
hxu10 |
B |
Jan. 27, 2024, 6:57 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
217 |
3481600 |
|
|
243668256 |
eugalt |
B |
Jan. 27, 2024, 7:02 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
217 |
3584000 |
|
|
243665841 |
gardengnome |
B |
Jan. 27, 2024, 6:48 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
217 |
9011200 |
|
|
243690169 |
RobinFromTheHood |
B |
Jan. 27, 2024, 11:41 p.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
218 |
4915200 |
|
|
243691041 |
amaturecoder |
B |
Jan. 28, 2024, 12:04 a.m. |
OK |
PyPy 3-64 |
TESTS |
78 |
218 |
5324800 |
|
|
243667471 |
OLOGY |
B |
Jan. 27, 2024, 6:57 p.m. |
OK |
Python 2 |
TESTS |
78 |
967 |
0 |
|
|
243669417 |
cctt |
B |
Jan. 27, 2024, 7:12 p.m. |
OK |
Python 3 |
TESTS |
78 |
249 |
0 |
|
|
243693997 |
XXJJXJ |
B |
Jan. 28, 2024, 1:25 a.m. |
OK |
Python 3 |
TESTS |
78 |
546 |
0 |
|
|
243712195 |
ayush_jhajharia |
B |
Jan. 28, 2024, 5:42 a.m. |
OK |
Python 3 |
TESTS |
78 |
561 |
0 |
|
|
243711915 |
singh.eureka |
B |
Jan. 28, 2024, 5:39 a.m. |
OK |
Python 3 |
TESTS |
78 |
561 |
0 |
|
|
243654824 |
cohermit |
B |
Jan. 27, 2024, 4:42 p.m. |
OK |
Python 3 |
TESTS |
78 |
592 |
0 |
|
|
243700668 |
21wh1a05i7 |
B |
Jan. 28, 2024, 3:18 a.m. |
OK |
Python 3 |
TESTS |
78 |
904 |
0 |
|
|
243679897 |
sahil45 |
B |
Jan. 27, 2024, 8:43 p.m. |
OK |
Python 3 |
TESTS |
78 |
904 |
0 |
|
|
243707791 |
vented |
B |
Jan. 28, 2024, 4:54 a.m. |
OK |
Python 3 |
TESTS |
78 |
951 |
0 |
|
|
243683564 |
smugi |
B |
Jan. 27, 2024, 9:28 p.m. |
OK |
Python 3 |
TESTS |
78 |
951 |
0 |
|
|
243700906 |
231414 |
B |
Jan. 28, 2024, 3:21 a.m. |
OK |
Python 3 |
TESTS |
78 |
982 |
0 |
|
|
243711278 |
PLA_Nh |
B |
Jan. 28, 2024, 5:33 a.m. |
OK |
Rust 2021 |
TESTS |
78 |
46 |
0 |
|
|
243678942 |
spookywooky |
B |
Jan. 27, 2024, 8:32 p.m. |
OK |
Rust 2021 |
TESTS |
78 |
77 |
512000 |
|
|
243705248 |
TecTrixer |
B |
Jan. 28, 2024, 4:21 a.m. |
OK |
Rust 2021 |
TESTS |
78 |
93 |
0 |
|
|
remove filters
Back to search problems