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"The game of Berland poker is played with a deck of n cards, m of which are jokers. k players play this game ( n is divisible by k ). At the beginning of the game, each player takes frac{n}{k} cards from the deck (so each card is taken by exactly one player). The player who has the maximum number of jokers is the winner, and he gets the number of points equal to x - y , where x is the number of jokers in the winner's hand, and y is the maximum number of jokers among all other players. If there are two or more players with maximum number of jokers, all of them are winners and they get 0 points. Here are some examples: Given n , m and k , calculate the maximum number of points a player can get for winning the game. The first line of the input contains one integer t ( 1 <= t <= 500 ) -- the number of test cases. Then the test cases follow. Each test case contains three integers n , m and k ( 2 <= n <= 50 , 0 <= m <= n , 2 <= k <= n , k is a divisors of n ). For each test case, print one integer -- the maximum number of points a player can get for winning the game. Test cases of the example are described in the statement. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
81837390 |
quanprobrvt |
A |
May 29, 2020, 1:04 a.m. |
OK |
FPC |
TESTS |
6 |
31 |
0 |
|
1000 |
82480031 |
KCSB |
A |
June 4, 2020, 12:06 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82301366 |
Sau_rav |
A |
June 2, 2020, 11:30 a.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81982962 |
tokibinalam186 |
A |
May 30, 2020, 4:14 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81978069 |
AB_Turjo |
A |
May 30, 2020, 3 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81967257 |
tasja |
A |
May 30, 2020, 12:30 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81942080 |
Rakibul1210 |
A |
May 30, 2020, 6:58 a.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81919396 |
jehad10 |
A |
May 29, 2020, 6:25 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81890118 |
sjleepy |
A |
May 29, 2020, 1:40 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
81886435 |
mickeygee |
A |
May 29, 2020, 12:56 p.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82384207 |
kpchouhan7 |
A |
June 3, 2020, 10:05 a.m. |
OK |
GNU C11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82411893 |
basel-99 |
A |
June 3, 2020, 3:31 p.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82353460 |
vouryex |
A |
June 3, 2020, 2:07 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82479483 |
CaoRui2019 |
A |
June 4, 2020, 11:58 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82459763 |
OldDog233 |
A |
June 4, 2020, 7:47 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82458296 |
cfk5160 |
A |
June 4, 2020, 7:28 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82456212 |
Jannat12 |
A |
June 4, 2020, 7 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82401968 |
luogu_bot5 |
A |
June 3, 2020, 1:44 p.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82389252 |
jasonEinstien |
A |
June 3, 2020, 11:08 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82374902 |
Dreamfarer |
A |
June 3, 2020, 8:12 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82354665 |
Neeraj9436 |
A |
June 3, 2020, 2:40 a.m. |
OK |
GNU C++11 |
TESTS |
6 |
15 |
0 |
|
1000 |
82288281 |
mittalsagar163 |
A |
June 2, 2020, 8:50 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82448973 |
shahyakeen |
A |
June 4, 2020, 5:11 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82449284 |
V_S_M |
A |
June 4, 2020, 5:18 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82413042 |
coder_282 |
A |
June 3, 2020, 3:43 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82392717 |
vijay_shankar |
A |
June 3, 2020, 11:50 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82367346 |
bachoppi |
A |
June 3, 2020, 6:39 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82350490 |
Pyshot |
A |
June 3, 2020, 12:19 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82311644 |
thattukada |
A |
June 2, 2020, 1:25 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82306003 |
_harshitsureka |
A |
June 2, 2020, 12:22 p.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82300946 |
utkjet |
A |
June 2, 2020, 11:25 a.m. |
OK |
GNU C++14 |
TESTS |
6 |
15 |
0 |
|
1000 |
82438424 |
AnonySharma |
A |
June 3, 2020, 11:40 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82426287 |
Asapi |
A |
June 3, 2020, 6:23 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82426080 |
sahilss1499 |
A |
June 3, 2020, 6:20 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82424242 |
nikhil077 |
A |
June 3, 2020, 5:55 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82423918 |
rounak_0501 |
A |
June 3, 2020, 5:50 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82401564 |
adityapathak1630 |
A |
June 3, 2020, 1:39 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82394758 |
MatijaL |
A |
June 3, 2020, 12:15 p.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82379035 |
rahulsingh28082000 |
A |
June 3, 2020, 8:58 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82378983 |
yash523 |
A |
June 3, 2020, 8:58 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
82369437 |
Idefyncode_10 |
A |
June 3, 2020, 7:05 a.m. |
OK |
GNU C++17 |
TESTS |
6 |
15 |
0 |
|
1000 |
81981848 |
Manel_Nesquik |
A |
May 30, 2020, 3:57 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82457343 |
achvanov |
A |
June 4, 2020, 7:15 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82430954 |
dismint |
A |
June 3, 2020, 7:41 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82373376 |
avantikasparihar |
A |
June 3, 2020, 7:53 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82286270 |
KBC |
A |
June 2, 2020, 8:28 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82239279 |
Crazy_hedgehog |
A |
June 1, 2020, 4:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82218609 |
old_school |
A |
June 1, 2020, 12:59 p.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82213169 |
ddvddv |
A |
June 1, 2020, 11:56 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82009202 |
satyamkumar05062001 |
A |
May 31, 2020, 4:37 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
82002217 |
vjudge4 |
A |
May 31, 2020, 1:09 a.m. |
OK |
GNU C++17 (64) |
TESTS |
6 |
15 |
0 |
|
1000 |
81817544 |
piyush2894 |
A |
May 28, 2020, 5:59 p.m. |
OK |
Go |
TESTS |
6 |
31 |
0 |
|
1000 |
82405559 |
Oopsimbad |
A |
June 3, 2020, 2:24 p.m. |
OK |
Go |
TESTS |
6 |
31 |
102400 |
|
1000 |
82345989 |
peakle |
A |
June 2, 2020, 9:05 p.m. |
OK |
Go |
TESTS |
6 |
46 |
0 |
|
1000 |
81957614 |
Andrey_R |
A |
May 30, 2020, 10:23 a.m. |
OK |
Haskell |
TESTS |
6 |
30 |
0 |
|
1000 |
82013402 |
tirth485 |
A |
May 31, 2020, 5:58 a.m. |
OK |
Java 11 |
TESTS |
6 |
155 |
0 |
|
1000 |
82000958 |
shivamnarware |
A |
May 30, 2020, 11:59 p.m. |
OK |
Java 11 |
TESTS |
6 |
155 |
0 |
|
1000 |
81939534 |
devesh08 |
A |
May 30, 2020, 6:24 a.m. |
OK |
Java 11 |
TESTS |
6 |
155 |
0 |
|
1000 |
81933460 |
mr___hacker____ |
A |
May 30, 2020, 4:41 a.m. |
OK |
Java 11 |
TESTS |
6 |
155 |
0 |
|
1000 |
81810295 |
the_royal_raj |
A |
May 28, 2020, 5:01 p.m. |
OK |
Java 11 |
TESTS |
6 |
155 |
0 |
|
1000 |
82238795 |
tmlu48 |
A |
June 1, 2020, 4:31 p.m. |
OK |
Java 11 |
TESTS |
6 |
170 |
0 |
|
1000 |
81934915 |
abhi123valani |
A |
May 30, 2020, 5:10 a.m. |
OK |
Java 11 |
TESTS |
6 |
170 |
0 |
|
1000 |
81813201 |
mikit |
A |
May 28, 2020, 5:19 p.m. |
OK |
Java 11 |
TESTS |
6 |
170 |
0 |
|
1000 |
82340978 |
iammanishmg |
A |
June 2, 2020, 7:15 p.m. |
OK |
Java 11 |
TESTS |
6 |
171 |
0 |
|
1000 |
82316364 |
typewriter999 |
A |
June 2, 2020, 2:18 p.m. |
OK |
Java 11 |
TESTS |
6 |
171 |
0 |
|
1000 |
82301370 |
cis_pie |
A |
June 2, 2020, 11:30 a.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
82226793 |
horseprabhat625 |
A |
June 1, 2020, 2:28 p.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81875153 |
_maverick |
A |
May 29, 2020, 10:42 a.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81866024 |
Pranay2516 |
A |
May 29, 2020, 8:49 a.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81857344 |
chaitanya11 |
A |
May 29, 2020, 7:07 a.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81852333 |
luchy0120 |
A |
May 29, 2020, 6:09 a.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81822984 |
niteshgowda |
A |
May 28, 2020, 7:01 p.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81816905 |
yash49 |
A |
May 28, 2020, 5:53 p.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
81809523 |
Heavenrj |
A |
May 28, 2020, 4:57 p.m. |
OK |
Java 8 |
TESTS |
6 |
93 |
0 |
|
1000 |
82040763 |
darshan287 |
A |
May 31, 2020, 12:55 p.m. |
OK |
Java 8 |
TESTS |
6 |
108 |
0 |
|
1000 |
82028169 |
Luay |
A |
May 31, 2020, 9:44 a.m. |
OK |
JavaScript |
TESTS |
6 |
46 |
512000 |
|
1000 |
81843184 |
Spheniscine |
A |
May 29, 2020, 3:26 a.m. |
OK |
Kotlin |
TESTS |
6 |
93 |
0 |
|
1000 |
81975915 |
neerj.ydv |
A |
May 30, 2020, 2:30 p.m. |
OK |
Kotlin |
TESTS |
6 |
139 |
0 |
|
1000 |
81812891 |
HanaYukii |
A |
May 28, 2020, 5:17 p.m. |
OK |
Kotlin |
TESTS |
6 |
140 |
0 |
|
1000 |
82385350 |
whiter4bbit |
A |
June 3, 2020, 10:19 a.m. |
OK |
Kotlin |
TESTS |
6 |
140 |
0 |
|
1000 |
81956253 |
Bloodwyn |
A |
May 30, 2020, 10:05 a.m. |
OK |
Kotlin |
TESTS |
6 |
140 |
0 |
|
1000 |
81862880 |
little_angel |
A |
May 29, 2020, 8:09 a.m. |
OK |
Kotlin |
TESTS |
6 |
140 |
0 |
|
1000 |
81887537 |
710 |
A |
May 29, 2020, 1:08 p.m. |
OK |
Kotlin |
TESTS |
6 |
155 |
0 |
|
1000 |
81814263 |
fuadul |
A |
May 28, 2020, 5:28 p.m. |
OK |
Kotlin |
TESTS |
6 |
156 |
0 |
|
1000 |
81809781 |
TRR |
A |
May 28, 2020, 4:58 p.m. |
OK |
Mono C# |
TESTS |
6 |
61 |
0 |
|
1000 |
81998679 |
sanek_2bas |
A |
May 30, 2020, 10:09 p.m. |
OK |
Mono C# |
TESTS |
6 |
62 |
0 |
|
1000 |
81913381 |
satir_2000 |
A |
May 29, 2020, 5:02 p.m. |
OK |
MS C++ |
TESTS |
6 |
15 |
0 |
|
1000 |
81908265 |
YTICpoch |
A |
May 29, 2020, 4:14 p.m. |
OK |
MS C++ |
TESTS |
6 |
15 |
307200 |
|
1000 |
82285788 |
sakshi3801 |
A |
June 2, 2020, 8:23 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
15 |
0 |
|
1000 |
82416173 |
bhargavbhatiya |
A |
June 3, 2020, 4:17 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
15 |
0 |
|
1000 |
81870978 |
langfeihenkechi |
A |
May 29, 2020, 9:50 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
15 |
102400 |
|
1000 |
81977183 |
nik1998 |
A |
May 30, 2020, 2:48 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
30 |
0 |
|
1000 |
81928764 |
Yan-Drozh |
A |
May 29, 2020, 9:31 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
30 |
0 |
|
1000 |
81834425 |
Propangolin |
A |
May 28, 2020, 11:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
30 |
0 |
|
1000 |
82379565 |
Nick_after_concont |
A |
June 3, 2020, 9:06 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
30 |
0 |
|
1000 |
81999167 |
Jackcao |
A |
May 30, 2020, 10:32 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
30 |
0 |
|
1000 |
81887814 |
GracieZh |
A |
May 29, 2020, 1:12 p.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
30 |
307200 |
|
1000 |
82390121 |
weijiu |
A |
June 3, 2020, 11:19 a.m. |
OK |
MS C++ 2017 |
TESTS |
6 |
31 |
0 |
|
1000 |
82275410 |
Mohamed_Fakhry |
A |
June 2, 2020, 6:17 a.m. |
OK |
Node.js |
TESTS |
6 |
93 |
1126400 |
|
1000 |
82004155 |
AliAbdallah |
A |
May 31, 2020, 2:23 a.m. |
OK |
Node.js |
TESTS |
6 |
93 |
1126400 |
|
1000 |
81855160 |
yTKONOS |
A |
May 29, 2020, 6:43 a.m. |
OK |
PascalABC.NET |
TESTS |
6 |
296 |
0 |
|
1000 |
81818277 |
beethoven97 |
A |
May 28, 2020, 6:07 p.m. |
OK |
PyPy 2 |
TESTS |
6 |
124 |
102400 |
|
1000 |
82038234 |
shreyansv1 |
A |
May 31, 2020, 12:15 p.m. |
OK |
PyPy 2 |
TESTS |
6 |
124 |
102400 |
|
1000 |
81998209 |
mir.panov |
A |
May 30, 2020, 9:53 p.m. |
OK |
PyPy 2 |
TESTS |
6 |
124 |
1331200 |
|
1000 |
82026476 |
kit.shiron |
A |
May 31, 2020, 9:18 a.m. |
OK |
PyPy 2 |
TESTS |
6 |
139 |
0 |
|
1000 |
82007762 |
CKP_ |
A |
May 31, 2020, 4:02 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
0 |
|
1000 |
81890162 |
tachyon777 |
A |
May 29, 2020, 1:41 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
0 |
|
1000 |
81875305 |
beta_rr |
A |
May 29, 2020, 10:44 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
0 |
|
1000 |
81874978 |
Anuranjan_Pandey |
A |
May 29, 2020, 10:40 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
0 |
|
1000 |
81831236 |
hulky_bulky |
A |
May 28, 2020, 9:39 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
0 |
|
1000 |
81827976 |
princebelkovetz |
A |
May 28, 2020, 8:23 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
0 |
|
1000 |
82384926 |
tflave |
A |
June 3, 2020, 10:13 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
124 |
1331200 |
|
1000 |
81959687 |
Galkowsky |
A |
May 30, 2020, 10:50 a.m. |
OK |
PyPy 3 |
TESTS |
6 |
139 |
0 |
|
1000 |
81997119 |
340951987 |
A |
May 30, 2020, 9:16 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
139 |
1433600 |
|
1000 |
81969872 |
myvegatablehasexplode |
A |
May 30, 2020, 1:07 p.m. |
OK |
PyPy 3 |
TESTS |
6 |
139 |
1433600 |
|
1000 |
81996746 |
elistark |
A |
May 30, 2020, 9:05 p.m. |
OK |
Python 2 |
TESTS |
6 |
171 |
0 |
|
1000 |
81827486 |
hackerbaba |
A |
May 28, 2020, 8:13 p.m. |
OK |
Python 2 |
TESTS |
6 |
171 |
0 |
|
1000 |
81824233 |
FailBetterNextTime |
A |
May 28, 2020, 7:20 p.m. |
OK |
Python 2 |
TESTS |
6 |
171 |
0 |
|
1000 |
82019269 |
Gemini7 |
A |
May 31, 2020, 7:27 a.m. |
OK |
Python 3 |
TESTS |
6 |
78 |
0 |
|
1000 |
82367581 |
iamvedant.vg |
A |
June 3, 2020, 6:41 a.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82364449 |
1927shivamsingh |
A |
June 3, 2020, 6 a.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82345384 |
ajay19293 |
A |
June 2, 2020, 8:51 p.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82315159 |
scambret |
A |
June 2, 2020, 2:04 p.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82261920 |
mmhaxor1 |
A |
June 2, 2020, 1:24 a.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82221974 |
dineshreddy01 |
A |
June 1, 2020, 1:38 p.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82209089 |
mananjagani145 |
A |
June 1, 2020, 11:12 a.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82161957 |
Wodewarrior |
A |
May 31, 2020, 9:09 p.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
82142594 |
frankhannes |
A |
May 31, 2020, 4:52 p.m. |
OK |
Python 3 |
TESTS |
6 |
93 |
0 |
|
1000 |
81942005 |
utkarsh2102 |
A |
May 30, 2020, 6:57 a.m. |
OK |
Ruby |
TESTS |
6 |
62 |
0 |
|
1000 |
81846898 |
duanhv |
A |
May 29, 2020, 4:42 a.m. |
OK |
Ruby |
TESTS |
6 |
77 |
102400 |
|
1000 |
remove filters
Back to search problems