Codeforces Round 1031 (Div. 2)

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
2113 Codeforces Round 1031 (Div. 2) FINISHED False 7200 26427323 June 15, 2025, 9:05 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 20428 ) A Shashliks PROGRAMMING greedy math

You are the owner of a popular shashlik restaurant, and your grill is the heart of your kitchen. However, the grill has a peculiarity: after cooking each shashlik, its temperature drops. You need to cook as many portions of shashlik as possible, and you have an unlimited number of portions of two types available for cooking: The first type requires a temperature of at least (a) degrees at the start of cooking, and after cooking, the grill's temperature decreases by (x) degrees. The second type requires a temperature of at least (b) degrees at the start of cooking, and after cooking, the grill's temperature decreases by (y) degrees. Initially, the grill's temperature is (k) degrees. Determine the maximum total number of portions of shashlik that can be cooked. Note that the grill's temperature can be negative. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The only line of each test case contains five integers (k), (a), (b), (x), and (y) ((1 \le k, a, b, x, y \le 10^9)) — the initial temperature of the grill, the required temperature for cooking the first and second types of shashlik, respectively, as well as the temperature drop after cooking the first and second types of shashlik, respectively. For each test case, output a single integer — the maximum number of portions of shashlik that you can cook. In the first test case, it is advantageous to cook (7) portions of the second type of shashlik; after that, the grill's temperature will be (3) degrees, and we can cook one more portion of the first type of shashlik. In the second test case, we cannot cook either type of shashlik because the grill is too cold. In the fourth test case, it is advantageous to cook (8) portions of the first type of shashlik; after that, it will be possible to cook another (2) portions of the second type

Tutorials

Codeforces Round #1031 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
324527985 User0009 A June 15, 2025, 1:06 p.m. OK C# 10 TESTS 3 124 3276800
324518167 og.kostya A June 15, 2025, 11:47 a.m. OK C# 13 TESTS 3 77 102400
324516539 IRacle A June 15, 2025, 11:32 a.m. OK C# 13 TESTS 3 109 2867200
324540196 yashi_11 A June 15, 2025, 3 p.m. OK C++17 (GCC 7-32) TESTS 3 30 0
324593243 anupam_762 A June 16, 2025, 4:40 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324584356 Celuga_with_love A June 16, 2025, 2:48 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324583774 siddharth46 A June 16, 2025, 2:38 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324580264 qwerdkr A June 16, 2025, 1:28 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324564849 shivamdubey9963 A June 15, 2025, 6:56 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324565220 orange_grape A June 15, 2025, 7 p.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324598165 Phat_Of_Bug A June 16, 2025, 5:48 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324597173 liuxinfa666666 A June 16, 2025, 5:35 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324597092 Phat_Of_Bug A June 16, 2025, 5:34 a.m. OK C++17 (GCC 7-32) TESTS 3 31 0
324544044 raviranjan1801 A June 15, 2025, 3:31 p.m. OK C++20 (GCC 13-64) TESTS 3 30 0
324515812 12112111 A June 15, 2025, 11:27 a.m. OK C++20 (GCC 13-64) TESTS 3 30 102400
324532563 leonov_vasya A June 15, 2025, 1:50 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324582908 AdnanChy1 A June 16, 2025, 2:22 a.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324576731 Lever A June 15, 2025, 11:29 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324568876 nabilehsanul A June 15, 2025, 7:59 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324555842 harshil7_ A June 15, 2025, 5:19 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324554839 aradhyaagrawal2605 A June 15, 2025, 5:09 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324534251 parvshah A June 15, 2025, 2:06 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324529829 chetanyadav256 A June 15, 2025, 1:24 p.m. OK C++20 (GCC 13-64) TESTS 3 31 0
324580532 hsqgrjs A June 16, 2025, 1:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324521405 Halaat_Kharab_Hein A June 15, 2025, 12:02 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324518977 thetwoface A June 15, 2025, 11:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324516440 RESILIENT1 A June 15, 2025, 11:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324515684 DeepinGrass A June 15, 2025, 11:26 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 0
324589356 msp_008987 A June 16, 2025, 3:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 102400
324521738 maspy A June 15, 2025, 12:03 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 30 307200
324593253 MirazHossain_847 A June 16, 2025, 4:40 a.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
324574895 adityasinghm05 A June 15, 2025, 10:22 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
324573767 singharpit2492 A June 15, 2025, 9:47 p.m. OK C++23 (GCC 14-64, msys2) TESTS 3 31 0
324576938 bluemegane A June 15, 2025, 11:37 p.m. OK C# 8 TESTS 3 109 3174400
324567397 ruban A June 15, 2025, 7:34 p.m. OK FPC TESTS 3 62 61952000
324577574 zerojanuary A June 16, 2025, 12:04 a.m. OK GNU C11 TESTS 3 61 0
324578839 shubhayandas2004 A June 16, 2025, 12:52 a.m. OK GNU C11 TESTS 3 62 0
324522949 NOOB_W A June 15, 2025, 12:15 p.m. OK GNU C11 TESTS 3 62 0
324541040 SakuraKy A June 15, 2025, 3:07 p.m. OK GNU C11 TESTS 3 62 102400
324540045 ghostForcerr A June 15, 2025, 2:59 p.m. OK GNU C11 TESTS 3 77 0
324533431 Seshi_kiran16 A June 15, 2025, 1:59 p.m. OK GNU C11 TESTS 3 77 102400
324546300 tempTam A June 15, 2025, 3:50 p.m. OK GNU C11 TESTS 3 92 102400
324511214 psssgopikrishna24 A June 15, 2025, 11:01 a.m. OK GNU C11 TESTS 3 92 102400
324521795 Manish_5076 A June 15, 2025, 12:04 p.m. OK GNU C11 TESTS 3 93 0
324547783 Sudhanva_Muralidharan A June 15, 2025, 4:03 p.m. OK GNU C11 TESTS 3 93 0
324551926 rajatXnowhere A June 15, 2025, 4:41 p.m. OK Java 21 TESTS 3 202 819200
324517066 pruthvinathreddyy A June 15, 2025, 11:37 a.m. OK Java 21 TESTS 3 203 102400
324548904 Balu2907 A June 15, 2025, 4:13 p.m. OK Java 21 TESTS 3 203 614400
324522684 I_AM_SPEED A June 15, 2025, 12:13 p.m. OK Java 21 TESTS 3 217 0
324543940 tekka_ity A June 15, 2025, 3:30 p.m. OK Java 21 TESTS 3 217 819200
324547213 InfusedParticle A June 15, 2025, 3:58 p.m. OK Java 21 TESTS 3 218 716800
324557094 ikiku A June 15, 2025, 5:32 p.m. OK Java 21 TESTS 3 218 819200
324515840 iamalizaidi A June 15, 2025, 11:27 a.m. OK Java 21 TESTS 3 218 819200
324590725 NpHardcore_05 A June 16, 2025, 4:06 a.m. OK Java 21 TESTS 3 218 1331200
324548145 MAFIA_GOD A June 15, 2025, 4:06 p.m. OK Java 21 TESTS 3 218 1433600
324536255 sam_131526 A June 15, 2025, 2:26 p.m. OK Java 8 TESTS 3 124 0
324597478 .diplo__mat A June 16, 2025, 5:39 a.m. OK Java 8 TESTS 3 140 0
324598666 sleempy A June 16, 2025, 5:53 a.m. OK Java 8 TESTS 3 155 0
324516105 Dan1c A June 15, 2025, 11:29 a.m. OK Java 8 TESTS 3 156 0
324516992 abhayrajnegi0416 A June 15, 2025, 11:36 a.m. OK Java 8 TESTS 3 171 0
324568568 Sumitsingh7 A June 15, 2025, 7:54 p.m. OK Java 8 TESTS 3 171 6860800
324538340 feonex A June 15, 2025, 2:44 p.m. OK Java 8 TESTS 3 218 0
324545715 aprataksh A June 15, 2025, 3:45 p.m. OK Java 8 TESTS 3 233 0
324545466 killer4639 A June 15, 2025, 3:43 p.m. OK Java 8 TESTS 3 233 0
324545345 tq11 A June 15, 2025, 3:42 p.m. OK Java 8 TESTS 3 233 0
324558203 AnatolyS A June 15, 2025, 5:43 p.m. OK Kotlin 1.9 TESTS 3 233 0
324543446 _Zuno_ A June 15, 2025, 3:26 p.m. OK Node.js TESTS 3 108 6758400
324557425 snokes A June 15, 2025, 5:35 p.m. OK PyPy 3 TESTS 3 233 8806400
324549420 mrvandana A June 15, 2025, 4:17 p.m. OK PyPy 3 TESTS 3 312 9523200
324519223 KishoreKarthick89 A June 15, 2025, 11:57 a.m. OK PyPy 3 TESTS 3 312 9830400
324551703 yin_yin81 A June 15, 2025, 4:39 p.m. OK PyPy 3 TESTS 3 312 9932800
324539073 sc2uderia A June 15, 2025, 2:51 p.m. OK PyPy 3 TESTS 3 327 9932800
324534084 unknow754389 A June 15, 2025, 2:05 p.m. OK PyPy 3 TESTS 3 342 10035200
324514772 codsila A June 15, 2025, 11:21 a.m. OK PyPy 3 TESTS 3 343 9523200
324574105 siuhou A June 15, 2025, 9:57 p.m. OK PyPy 3-64 TESTS 3 93 4403200
324523116 gardengnome A June 15, 2025, 12:17 p.m. OK PyPy 3-64 TESTS 3 124 4096000
324517465 ChanduCforce A June 15, 2025, 11:40 a.m. OK PyPy 3-64 TESTS 3 124 7987200
324562357 golomb A June 15, 2025, 6:26 p.m. OK PyPy 3-64 TESTS 3 139 5017600
324515302 Om_Singh_ A June 15, 2025, 11:24 a.m. OK PyPy 3-64 TESTS 3 140 5939200
324576415 mvkhanh A June 15, 2025, 11:16 p.m. OK PyPy 3-64 TESTS 3 140 7270400
324537595 Rohidul A June 15, 2025, 2:38 p.m. OK PyPy 3-64 TESTS 3 155 5120000
324541883 NavinKumarM A June 15, 2025, 3:13 p.m. OK PyPy 3-64 TESTS 3 155 5734400
324522359 shashanksumanth A June 15, 2025, 12:09 p.m. OK PyPy 3-64 TESTS 3 155 5939200
324518976 ChickenTamer A June 15, 2025, 11:54 a.m. OK PyPy 3-64 TESTS 3 155 6144000
324549752 Nikrient A June 15, 2025, 4:21 p.m. OK Python 3 TESTS 3 77 307200
324523481 Sakaar1922 A June 15, 2025, 12:21 p.m. OK Python 3 TESTS 3 77 1638400
324550540 223t1a05d6 A June 15, 2025, 4:28 p.m. OK Python 3 TESTS 3 77 4608000
324598130 Ashwaths A June 16, 2025, 5:47 a.m. OK Python 3 TESTS 3 78 204800
324530078 Harikaran14 A June 15, 2025, 1:27 p.m. OK Python 3 TESTS 3 93 102400
324556017 Srutee_Sarkar A June 15, 2025, 5:21 p.m. OK Python 3 TESTS 3 93 204800
324529122 shivanshusaxena250 A June 15, 2025, 1:18 p.m. OK Python 3 TESTS 3 93 204800
324532251 def337485 A June 15, 2025, 1:47 p.m. OK Python 3 TESTS 3 93 307200
324515382 roro28 A June 15, 2025, 11:24 a.m. OK Python 3 TESTS 3 93 307200
324545203 Ruthwik12 A June 15, 2025, 3:41 p.m. OK Python 3 TESTS 3 93 409600
324528197 sankxt143 A June 15, 2025, 1:09 p.m. OK Rust 2021 TESTS 3 46 102400
324529643 silicalet A June 15, 2025, 1:23 p.m. OK Rust 2021 TESTS 3 62 102400

remove filters

Back to search problems