Educational Codeforces Round 181 (Rated for 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
2125 Educational Codeforces Round 181 (Rated for Div. 2) FINISHED False 7200 23210723 July 22, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 27197 ) B Left and Down PROGRAMMING greedy math number theory

There is a robot located in the cell ((a,b)) of an infinite grid. Misha wants to move it to the cell ((0,0)). To do this, he has fixed some integer (k). Misha can perform the following operation: choose two integers (dx) and (dy) (both from (0) to (k) inclusive) and move the robot (dx) cells to the left (in the direction of decreasing (x) coordinate) and (dy) cells down (in the direction of decreasing (y) coordinate). In other words, move the robot from ((x,y)) to ((x - dx, y - dy)). The cost of the operation is: (1), if the chosen pair ((dx,dy)) is used for the first time; (0), if the pair ((dx,dy)) has been chosen before. Note that if (dx \ne dy), the pairs ((dx, dy)) and ((dy, dx)) are considered different. Help Misha bring the robot to the cell ((0,0)) with minimum total cost. Note that you don't have to minimize the number of operations. The first line contains a single integer (t) ((1 \le t \le 10^4)) — the number of test cases. The only line of each test case contains three integers (a, b), and (k) ((1 \le a, b, k \le 10^{18})). For each test case, output a single integer — the minimum total cost of operations required to move the robot to the cell ((0,0)). In the first test case, the operation ((3,5)) can be applied once. The robot will immediately go to ((0,0)), and the cost of the operation will be (1). In the second test case, the operations: ((1,1)), ((0,1)), and ((1,1)) can be applied. After the first operation, the robot will be at cell ((1,2)), after the second one — at ((1,1)), and after the third one — at ((0,0)). The cost of the first and second operations is (1), while the third is (0), as the pair ((1,1)) has already been used in the first operation. In the third test case, the pair ((4,6)) can be chosen three times in a row. In the fourth test case, the operations: ((4,2)) a

Tutorials

Educational Codeforces Round 181 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
330399627 shahadat26 B July 22, 2025, 4:27 p.m. OK C# 10 TESTS 4 140 3174400
330409366 FrontierAlchemist B July 22, 2025, 5:19 p.m. OK C# 13 TESTS 4 108 3072000
330400090 justcse18_sahabuddin B July 22, 2025, 4:28 p.m. OK C# 13 TESTS 4 108 3481600
330400083 drixmux B July 22, 2025, 4:28 p.m. OK C# 13 TESTS 4 155 4812800
330409264 FrontierAlchemist B July 22, 2025, 5:18 p.m. OK C# 13 TESTS 4 202 3072000
330405290 Vish2503 B July 22, 2025, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 4 31 0
330448860 kevlu8 B July 23, 2025, 2:49 a.m. OK C++17 (GCC 7-32) TESTS 4 31 102400
330443955 241liuxiantao B July 23, 2025, 1:53 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330444936 vrooooom B July 23, 2025, 2:05 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330456999 sekiro666 B July 23, 2025, 4:21 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330456648 DangKhoizzzz B July 23, 2025, 4:17 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330456192 turtie9od B July 23, 2025, 4:11 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330452513 ChinmayShri B July 23, 2025, 3:28 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330449818 244chentian B July 23, 2025, 2:59 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330445932 chenxi2009 B July 23, 2025, 2:16 a.m. OK C++17 (GCC 7-32) TESTS 4 46 0
330440071 xuxiaopeng B July 23, 2025, 1:03 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
330452154 Ferry.x B July 23, 2025, 3:24 a.m. OK C++20 (GCC 13-64) TESTS 4 31 0
330432265 Mulhamadla B July 22, 2025, 9:57 p.m. OK C++20 (GCC 13-64) TESTS 4 31 0
330459558 uamalik B July 23, 2025, 4:55 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330465266 Karthik1812 B July 23, 2025, 5:58 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330464438 Marrelia B July 23, 2025, 5:50 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330463934 roys22127 B July 23, 2025, 5:44 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330463772 AJ7787_ B July 23, 2025, 5:42 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330460316 iampranav B July 23, 2025, 5:04 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330458833 -0v0- B July 23, 2025, 4:45 a.m. OK C++20 (GCC 13-64) TESTS 4 46 0
330394740 ravish99055 B July 22, 2025, 4:14 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 0
330463044 ZenithT B July 23, 2025, 5:35 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 30 102400
330447901 S1amese B July 23, 2025, 2:39 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330444893 itsAMd22 B July 23, 2025, 2:04 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330441102 guharoypragyayan B July 23, 2025, 1:18 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330440095 lucky1426shrma B July 23, 2025, 1:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330436691 Midnigth.micho B July 23, 2025, 12:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330429255 Sharhaan B July 22, 2025, 9 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330420685 Haze__ B July 22, 2025, 7:04 p.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330464881 LiSai B July 23, 2025, 5:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 4 31 0
330438676 bluemegane B July 23, 2025, 12:43 a.m. OK C# 8 TESTS 4 124 3072000
330411855 Shafeen_code4ever B July 22, 2025, 5:39 p.m. OK GNU C11 TESTS 4 62 102400
330424582 codemastervansh B July 22, 2025, 7:52 p.m. OK GNU C11 TESTS 4 77 102400
330396867 Gudivada_Yagnesh B July 22, 2025, 4:20 p.m. OK GNU C11 TESTS 4 78 0
330414376 Jaiaid B July 22, 2025, 6:02 p.m. OK GNU C11 TESTS 4 92 102400
330397723 Rakib_CSE B July 22, 2025, 4:22 p.m. OK GNU C11 TESTS 4 92 102400
330409696 shanzad0o0 B July 22, 2025, 5:22 p.m. OK GNU C11 TESTS 4 93 0
330397628 adityar_101 B July 22, 2025, 4:22 p.m. OK GNU C11 TESTS 4 93 0
330400459 Chiron1216 B July 22, 2025, 4:29 p.m. OK GNU C11 TESTS 4 139 0
330399147 DarshNahar B July 22, 2025, 4:26 p.m. OK Go TESTS 4 468 1433600
330451963 daulat_309 B July 23, 2025, 3:21 a.m. OK Java 21 TESTS 4 202 1126400
330458991 rajatXnowhere B July 23, 2025, 4:47 a.m. OK Java 21 TESTS 4 203 819200
330439512 punitpunde B July 23, 2025, 12:55 a.m. OK Java 21 TESTS 4 218 0
330452330 singhdevansh024 B July 23, 2025, 3:25 a.m. OK Java 21 TESTS 4 218 819200
330400536 MeanMachin B July 22, 2025, 4:29 p.m. OK Java 21 TESTS 4 233 0
330400039 sakshams7778 B July 22, 2025, 4:28 p.m. OK Java 21 TESTS 4 233 2048000
330401506 MeanMachin B July 22, 2025, 4:31 p.m. OK Java 21 TESTS 4 234 409600
330411287 gamezovladislav B July 22, 2025, 5:34 p.m. OK Java 21 TESTS 4 234 512000
330401677 sergiokno479 B July 22, 2025, 4:32 p.m. OK Java 21 TESTS 4 249 0
330393587 sameerSmd B July 22, 2025, 4:11 p.m. OK Java 21 TESTS 4 249 307200
330397138 adhikaridebarghya2004 B July 22, 2025, 4:20 p.m. OK Java 8 TESTS 4 140 0
330392787 s_anand98 B July 22, 2025, 4:09 p.m. OK Java 8 TESTS 4 171 0
330403433 sarthaKKharKa_18 B July 22, 2025, 4:38 p.m. OK Java 8 TESTS 4 202 0
330457375 Rishabh_Sengar1 B July 23, 2025, 4:26 a.m. OK Java 8 TESTS 4 249 0
330431637 pratyushbirole B July 22, 2025, 9:44 p.m. OK Java 8 TESTS 4 249 0
330428074 NotWay_1 B July 22, 2025, 8:41 p.m. OK Java 8 TESTS 4 249 0
330418966 Rajdweep B July 22, 2025, 6:45 p.m. OK Java 8 TESTS 4 249 0
330415004 ..pk B July 22, 2025, 6:07 p.m. OK Java 8 TESTS 4 264 0
330460098 nidhi1112 B July 23, 2025, 5:01 a.m. OK Java 8 TESTS 4 265 0
330450515 sadgirpooja20 B July 23, 2025, 3:07 a.m. OK Java 8 TESTS 4 265 0
330396657 RYRYRYRY B July 22, 2025, 4:19 p.m. OK Kotlin 1.9 TESTS 4 218 0
330415804 L-S-S B July 22, 2025, 6:15 p.m. OK Kotlin 1.9 TESTS 4 249 409600
330465523 the_demon_sid B July 23, 2025, 6 a.m. OK Node.js TESTS 4 249 10752000
330399725 n.ysslakshmi2001 B July 22, 2025, 4:27 p.m. OK PyPy 3 TESTS 4 218 6656000
330419416 thinkphp B July 22, 2025, 6:50 p.m. OK PyPy 3 TESTS 4 296 7680000
330434221 seifhafez45 B July 22, 2025, 10:50 p.m. OK PyPy 3 TESTS 4 296 8499200
330435424 nikonssq B July 22, 2025, 11:30 p.m. OK PyPy 3 TESTS 4 312 9113600
330400771 o_e_a_e_o_e_e_e_a_e B July 22, 2025, 4:30 p.m. OK PyPy 3 TESTS 4 343 7987200
330394717 BladedArchon B July 22, 2025, 4:14 p.m. OK PyPy 3 TESTS 4 343 8294400
330397642 russellhantz B July 22, 2025, 4:22 p.m. OK PyPy 3 TESTS 4 374 8192000
330428246 hugoback01 B July 22, 2025, 8:44 p.m. OK PyPy 3-64 TESTS 4 93 3174400
330393757 niharavtar B July 22, 2025, 4:11 p.m. OK PyPy 3-64 TESTS 4 108 3788800
330417677 jvatsal0709 B July 22, 2025, 6:32 p.m. OK PyPy 3-64 TESTS 4 108 4505600
330405532 devangAD B July 22, 2025, 4:50 p.m. OK PyPy 3-64 TESTS 4 109 3788800
330404329 DRDIV B July 22, 2025, 4:43 p.m. OK PyPy 3-64 TESTS 4 124 4198400
330464820 aayrron04 B July 23, 2025, 5:53 a.m. OK PyPy 3-64 TESTS 4 124 4608000
330402584 nemesis-lance B July 22, 2025, 4:34 p.m. OK PyPy 3-64 TESTS 4 124 4710400
330400432 _astartes B July 22, 2025, 4:29 p.m. OK PyPy 3-64 TESTS 4 124 4710400
330418005 alexwice B July 22, 2025, 6:35 p.m. OK PyPy 3-64 TESTS 4 124 5632000
330410887 eugenekoran B July 22, 2025, 5:31 p.m. OK PyPy 3-64 TESTS 4 124 5632000
330398831 Pratima25 B July 22, 2025, 4:25 p.m. OK Python 3 TESTS 4 77 204800
330392733 anishv276 B July 22, 2025, 4:09 p.m. OK Python 3 TESTS 4 77 204800
330409909 MichaelSerrato B July 22, 2025, 5:23 p.m. OK Python 3 TESTS 4 78 204800
330398047 Divya2690 B July 22, 2025, 4:23 p.m. OK Python 3 TESTS 4 78 3788800
330401150 igl318706 B July 22, 2025, 4:31 p.m. OK Python 3 TESTS 4 93 307200
330394942 LimitlessOps B July 22, 2025, 4:14 p.m. OK Python 3 TESTS 4 93 307200
330408586 Gravity_Dealer B July 22, 2025, 5:12 p.m. OK Python 3 TESTS 4 93 409600
330410777 pranshu11 B July 22, 2025, 5:30 p.m. OK Python 3 TESTS 4 93 512000
330402371 jsaddict044 B July 22, 2025, 4:33 p.m. OK Python 3 TESTS 4 93 1228800
330440113 eugalt B July 23, 2025, 1:04 a.m. OK Python 3 TESTS 4 93 1638400
330451518 Spheniscine B July 23, 2025, 3:17 a.m. OK Rust 2021 TESTS 4 46 0

remove filters

Back to search problems