test
stringlengths
184
51.6M
hash
stringlengths
32
32
__inputs__ = ['ABC 3\nABC 1\n2(4(AB)3(XY))10C 30\n1000(1000(1000(1000(1000(1000(NM)))))) 999999\n0 0\n', 'ABC 3\nABC 0\n2(4(AB)3(XY))10C 3\n1000(1000(1000(1000(1000(1000(NM)))))) 999999\n0 0\n', 'ABC 3\nABC 2\n2(4(AB)3(XY))10C 30\n1000(1000(1000(1000(1000(1000(NM)))))) 999999\n0 0\n', 'ABC 3\nABC 0\n2(4(AB)3(XY))10C 3\...
9e12d768a923aa9e42e1ae3b6e5cc191
__inputs__ = ['ABC 3\nABC 0\n2(4(AB)3(XY))10C 30\n1000(1000(1000(1000(1000(1000(NM)))))) 999999\n0 0\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
0ee392a0d914f35f24505d922d7d0c74
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
79debd9e8a85e809c767943bc566dc43
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
2ad1fd479a2ca3d34ab7abe76a90fdb7
__inputs__ = ['5\n1 2 3 4 5\n', '4\n1 2 2 1\n', '3\n1 2 4\n', '6\n1 2 3 6 5 4\n', '10\n2 1 4 3 6 5 8 7 10 9\n', '7\n12 6 12 13 4 3 2\n', '15\n15 14 13 1 2 3 12 11 10 4 5 6 9 8 7\n', '16\n1 2 3 4 13 14 15 16 9 10 11 12 5 6 7 8\n', '6\n1000 1 2000 1 3000 1\n', '1\n0\n', '5\n1000000000 1 1000000000 1 1000000000\n', '5\n10...
43b4d44919abd479ce2d93416c2fbcaa
__inputs__ = ['5\n1 2 3 4 5\n', '4\n1 2 2 1\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
09532a073e40fdbc9f91d620d5e950cd
__inputs__ = ['2\n3 0\n3\n0 1 1\n1\n1000\n0\n', '2\n3 2\n3\n0 1 1\n1\n0000\n0\n', '2\n1 0\n3\n0 1 1\n1\n1000\n0\n', '2\n2 0\n3\n0 1 1\n0\n1100\n0\n', '2\n1 0\n3\n0 1 1\n0\n1100\n0\n', '2\n3 2\n3\n0 0 1\n1\n1000\n0\n', '2\n6 4\n3\n0 1 2\n1\n0000\n0\n', '2\n0 4\n3\n0 1 2\n1\n0000\n0\n', '2\n2 0\n0\n0 1 0\n0\n0000\n0\n', ...
d9779c70dd9e17005a64791b645429a8
__inputs__ = ['2\n3 2\n3\n0 1 1\n1\n1000\n0\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
2c7588a9822b9cd644c88938c1dd57b3
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
2040699488127e78c49e36e35eb6053b
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
cd78c30240135840d2dd24e4d863d684
__inputs__ = ['10\n470606482521 533212137322 116718867454 746976621474 457112271419 815899162072 641324977314 88281100571 9231169966 455007126951\n26 83 30 59 000 88 84 91 54 61\n', '14\n2094 5400 6231 5800 6001 5200 6350 7133 7986 8012 7537 7013 6477 5912\n34 54 61 32 52 61 21 43 65 12 45 21 1 4\n', '5\n4 2 6 3 5\n0 1...
fb72be468e6b070e2dd34abdc524a819
__inputs__ = ['10\n470606482521 533212137322 116718867454 746976621474 457112271419 815899162072 641324977314 88281100571 9231169966 455007126951\n26 83 30 59 100 88 84 91 54 61\n', '14\n4839 5400 6231 5800 6001 5200 6350 7133 7986 8012 7537 7013 6477 5912\n34 54 61 32 52 61 21 43 65 12 45 21 1 4\n', '5\n4 2 6 3 5\n1 1...
6ac8fd735283e8aaf5a22267b8acf390
__inputs__ = ['rbgrg\nrbbgbbr\nbgr\nrgbbrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n', 'rbgrg\ngbbrbbr\ngbr\nrgbbrgbr\nrrgbgrggb\ngbrggrbggr\nrrrrr\nbgbr\n0\n', 'rbgrg\nrbbgbbr\nbgr\nbgbrrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n', 'rbgrg\nrgbrbbb\nrbg\nrgbbrgbr\nrrgbgrggb\ngbrggrbggr\nrrrrr\nbgrb\n0\n', 'rggrb\nrg...
aac5b61c4a40ba8a5db4d7d383a5ca5f
__inputs__ = ['rbgrg\nrbbgbbr\nbgr\nbgrbrgbr\nbggrgbgrr\ngbrggrbggr\nrrrrr\nbgbr\n0\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
fc05f442320adefe006568d647e0c27e
__inputs__ = ['3 4 4 19 1\n42 3 99\n', '4 7 2 3 9\n1 2 3 4\n', '2 100 100 10000 10000\n100 100\n', '2 3 4 5 6\n1 2\n', '1 78 94 369 10000\n93\n', '1 94 78 369 10000\n93\n', '5 1 100 1 10000\n1 2 3 4 5\n', '5 100 1 10000 1\n1 2 3 4 5\n', '5 1 100 10000 1\n1 2 3 4 5\n', '5 100 1 1 10000\n1 2 3 4 5\n', '6 32 47 965 897\n7...
1bf8aec118da0f28376378339667d4c4
__inputs__ = ['3 4 4 19 1\n42 3 99\n', '4 7 2 3 9\n1 2 3 4\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
7e7d47fac10b90d8d9cf3887f67cecf3
__inputs__ = ['2\n2 3\n', '3\n1 2 3\n', '5\n1 2 3 4 5\n', '4\n2 3 4 5\n', '6\n1 2 3 4 5 6\n', '7\n8 9 10 11 12 13 14\n', '9\n2 3 4 5 6 7 8 9\n', '2\n10 10\n', '5\n1 2 2 3 5\n', '4\n7 8 9 10\n', '3\n30 20 10\n', '1\n1\n', '1\n2\n', '8\n1 2 3 4 5 6 7 8\n', '6\n3 6 9 12 15 18\n', '5\n10 20 30 40 50\n', '4\n100 200 300 400...
24e686f270767d0ff41cfa558945f803
__inputs__ = ['2\n2 3\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
dc757817dec77a81c228bb9bbf23e2c4
__inputs__ = ['abc\ncbaabc\n', 'aaabrytaaa\nayrat\n', 'ami\nno\n', 'r\nr\n', 'r\nb\n', 'randb\nbandr\n', 'aaaaaa\naaaaa\n', 'aaaaaa\naaaaaaa\n', 'qwerty\nywertyrewqqq\n', 'qwerty\nytrewq\n', 'azaza\nzazaz\n', 'mnbvcxzlkjhgfdsapoiuytrewq\nqwertyuiopasdfghjklzxcvbnm\n', 'imnothalfthemaniusedtobetheresashadowhangingoverme...
1b2399418436dcbe077643c756316fdf
__inputs__ = ['abc\ncbaabc\n', 'aaabrytaaa\nayrat\n', 'ami\nno\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
c4445de3496a1fd5ed272b38ede833b6
__inputs__ = ['2\n33 15 51 7 101\n41 80 40 13 46\n', '2\n0 0 0 0 1\n0 0 0 1 0\n', '4\n66 55 95 78 114\n70 98 8 95 95\n17 47 88 71 18\n23 22 9 104 38\n', '17\n66 15 -1 42 90\n67 108 104 16 110\n76 -1 -1 -1 96\n108 32 100 91 17\n87 -1 85 10 -1\n70 55 102 15 23\n-1 33 111 105 63\n-1 56 104 68 116\n56 111 102 89 63\n63 -1 ...
76bbb50c8f708f243c038f58d45173db
__inputs__ = ['2\n5 15 40 70 115\n50 45 40 30 15\n', '5\n119 119 119 119 119\n0 0 0 0 -1\n20 65 12 73 77\n78 112 22 23 11\n1 78 60 111 62\n', '4\n-1 20 40 77 119\n30 10 73 50 107\n21 29 -1 64 98\n117 65 -1 -1 -1\n', '3\n55 80 10 -1 -1\n15 -1 79 60 -1\n42 -1 13 -1 -1\n'] for __inp__ in __inputs__: import io sys....
49348a025c69d5d914f2bf7064151cc9
__inputs__ = ['10 5\n0\n21\n53\n41\n53\n', '5 5\n0\n1\n2\n3\n4\n', '10 6\n811966798\n734823552\n790326404\n929189974\n414343256\n560346537\n', '2 2\n788371161\n801743052\n', '10 6\n812796223\n122860157\n199259103\n597650585\n447742024\n521549402\n', '300 2\n822454942\n119374431\n', '300 2\n823284367\n507345500\n', '2 5...
81ede213acfa30a7eae376ec5778c005
__inputs__ = ['10 5\n0\n21\n53\n41\n53\n', '5 5\n0\n1\n2\n3\n4\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
b064946de1bce83faee110a354b0e207
__inputs__ = ['7\n1 2\n1 2\n3 2\n1 1 2 2 3 3\n3 3\n3 4 4 1 1 1 1 1 2\n2 2\n1 1 2 1\n4 2\n50 50 50 50 3 50 50 50\n4 2\n6 6 6 6 2 2 9 6\n2 9\n1 3 3 3 3 3 1 1 3 1 3 1 1 3 3 1 1 3\n', '7\n1 2\n1 2\n3 2\n1 1 2 2 3 6\n3 3\n3 4 4 1 1 1 1 1 2\n2 2\n1 1 2 1\n4 2\n50 50 50 50 3 50 50 50\n4 2\n6 6 6 6 2 2 9 6\n2 9\n1 3 3 3 3 3 1 ...
41cf39043a29c153ec4561e27c165463
__inputs__ = ['7\n1 2\n1 2\n3 2\n1 1 2 2 3 3\n3 3\n3 4 4 1 1 1 1 1 2\n2 2\n1 1 2 1\n4 2\n50 50 50 50 3 50 50 50\n4 2\n6 6 6 6 2 2 9 6\n2 9\n1 3 3 3 3 3 1 1 3 1 3 1 1 3 3 1 1 3\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() ...
651b05af00299800441ca2e115f1acb2
__inputs__ = ['1 1 1\n1\n1\n1 1\n', '2 4 3\n2 1\n1 1 2 2\n1 2\n2 2\n3 4\n', '3 6 3\n2 1 3\n1 2 3 1 2 3\n1 6\n2 6\n3 5\n', '2 4 3\n2 1\n1 1 2 2\n1 2\n2 4\n3 4\n', '2 4 3\n2 1\n1 2 2 2\n1 2\n2 4\n3 4\n', '3 6 3\n2 1 3\n1 2 3 2 2 3\n1 5\n2 6\n3 5\n', '3 6 3\n2 1 3\n2 2 3 1 2 3\n1 6\n2 6\n3 5\n', '2 4 3\n2 1\n2 1 2 2\n1 2\...
740fa5897fb340444b920072d2985d09
__inputs__ = ['2 4 3\n2 1\n1 1 2 2\n1 2\n2 3\n3 4\n', '3 6 3\n2 1 3\n1 2 3 1 2 3\n1 5\n2 6\n3 5\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
0b90ff2592e7c122cae3c082be5b0daf
__inputs__ = ['5\n24 11 8 3 16\n', '4\n5 5 5 5\n', '10\n33 18 45 28 8 19 89 86 2 4\n', '5\n24 11 8 1 16\n', '10\n33 4 45 28 8 19 89 86 2 4\n', '10\n33 4 26 28 8 19 89 86 2 4\n', '4\n6 8 5 5\n', '5\n31 11 8 2 16\n', '10\n11 2 41 17 8 25 89 28 3 4\n', '10\n11 2 41 17 8 33 89 28 3 4\n', '5\n31 11 1 1 16\n', '10\n11 2 41 1...
87d4e4b022f3fb2af4915a29af580cad
__inputs__ = ['5\n24 11 8 3 16\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
910b4753727a13c64475e95e877b8063
__inputs__ = ['5\n1 2 3 4 5\n', '3\n8 12 7\n', '3\n3 2 1\n', '5\n2 3 4 5 6\n', '8\n7 2 6 6 5 1 4 9\n', '10\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n', '1\n1\n', '1\n2\n', '5\n2 3 4 5 9\n', '8\n7 2 6 6 9 1 4 9\n', '3\n3 1 1\n', '3\n16 12 7\n', '8\n7 ...
019413517c0aaef47040f94b0851c405
__inputs__ = ['5\n1 2 3 4 5\n', '3\n8 12 7\n', '3\n3 2 1\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
9ce63f1a62429bc07eb9248d281e863c
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
a8dc37aaf682a44ba74260817e90de3e
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
2ad1fd479a2ca3d34ab7abe76a90fdb7
__inputs__ = ['2\n2 2\n1 4\n2 7\n2 1\n1 4\n2 7\n', '2\n2 2\n1 4\n2 7\n2 1\n1 4\n0 7\n', '2\n2 2\n1 4\n2 7\n2 1\n1 3\n0 7\n', '2\n2 0\n1 4\n2 7\n2 1\n1 4\n2 7\n', '2\n2 2\n1 4\n2 0\n2 1\n1 4\n0 7\n', '2\n2 1\n1 4\n2 7\n2 1\n1 4\n2 7\n', '2\n2 1\n1 0\n2 7\n2 1\n1 4\n2 7\n', '2\n2 2\n1 4\n2 7\n2 2\n1 4\n0 7\n', '2\n2 2\n1...
d8e49423f21edb04e4b5f7251fcd61fe
__inputs__ = ['2\n2 2\n1 4\n2 7\n2 1\n1 4\n2 7\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
0c5ab03069eafb930ae6ff62e851bbcc
__inputs__ = ['5 -2\n-3 8 -2 1 -6\n', '12 -3\n1 3 3 7 1 3 3 7 1 3 3 7\n', '5 10\n-1 -2 -3 -4 -5\n', '10 100\n1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000\n', '3 0\n1 -10 2\n', '5 0\n5 -10 -10 -10 6\n', '5 0\n-12 10 -9 10 -12\n', '5 0\n-3 8 -2 1 -6\n', '5 ...
a1bae2c53fae6a96fd0c2104d4b6f1b6
__inputs__ = ['5 -2\n-3 8 -2 1 -6\n', '12 -3\n1 3 3 7 1 3 3 7 1 3 3 7\n', '5 10\n-1 -2 -3 -4 -5\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
722c7b27df95f5abf5bfa170968df6a5
__inputs__ = ['7\n3 1 7 1 5 9 2\n', '7\n3 1 7 1 5 9 0\n', '7\n3 1 2 1 5 9 1\n', '7\n3 2 2 -2 1 3 1\n', '7\n1 2 2 0 1 2 1\n', '10\n0 1 1 0 2 1 4 2 2 10\n', '10\n0 1 1 0 2 1 2 2 1 10\n', '1\n68972\n', '10\n0 1 2 3 4 5 6 7 8 4\n', '10\n-1 1 2 3 4 5 6 7 8 4\n', '7\n3 1 2 1 5 9 0\n', '10\n-1 1 2 3 4 8 6 7 8 4\n', '10\n-1 1 ...
1dec4c7853db95d00f27456694353011
__inputs__ = ['7\n3 1 4 1 5 9 2\n', '10\n0 1 2 3 4 5 6 7 8 9\n', '1\n99999\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
6d2bfbc806d083d5ad0ad26112978024
__inputs__ = ['1 1\n', '2 3\n', '49 1808\n', '2 1\n', '2 2\n', '2 4\n', '3 1\n', '3 2\n', '3 3\n', '3 4\n', '3 5\n', '3 6\n', '3 7\n', '3 8\n', '3 9\n', '4 1\n', '4 2\n', '4 3\n', '4 4\n', '4 5\n', '4 6\n', '4 7\n', '4 8\n', '4 9\n', '4 10\n', '4 11\n', '4 12\n', '4 13\n', '4 14\n', '4 15\n', '4 16\n', '500 1\n', '500 ...
197133b1afe4abb4f050258388446c33
__inputs__ = ['1 1\n', '2 3\n', '49 1808\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
2d8c4a96685aeed87fec2bf9a506859e
__inputs__ = ['5\n1 1 5\n1 5 11\n2 1 2\n1 2 9\n2 1 2\n', '10\n1 -311 -186\n1 -1070 -341\n1 -1506 -634\n1 688 1698\n2 2 4\n1 70 1908\n2 1 2\n2 2 4\n1 -1053 1327\n2 5 4\n', '10\n1 -1365 -865\n1 1244 1834\n2 1 2\n1 -1508 -752\n2 3 2\n2 2 1\n1 -779 595\n1 -1316 877\n2 2 1\n1 -698 1700\n', '20\n1 1208 1583\n1 -258 729\n1 -4...
377f78ddaf77d99ab074bceaae30580e
__inputs__ = ['5\n1 1 5\n1 5 11\n2 1 2\n1 2 9\n2 1 2\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
23aea162b256462af57ee3f6a341c02d
__inputs__ = ['6\n1\n2\n3\n4\n10\n10000000000000000\n', '1\n4642392862013167\n', '1\n5897090464090076\n', '6\n1\n4\n3\n4\n10\n10000000000000000\n', '1\n3141480811161321\n', '1\n3202097780689747\n', '1\n5061211645916487\n', '1\n852857060842737\n', '1\n1123842695541782\n', '1\n1465836980046212\n', '1\n2020935501245160\n'...
067963e99a0a87fd0d7e3e531fe83ae7
__inputs__ = ['6\n1\n2\n3\n4\n10\n10000000000000000\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
c99ab79ecb0d50ca10d8889b99d1e72f
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
6172d95b106d441f5eec6e8855ba8e0d
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
2ad1fd479a2ca3d34ab7abe76a90fdb7
__inputs__ = ['5 2 1 4 10\n', '5 2 1 4 5\n', '1 1 1 2 1\n', '1000000000000 1000000 999999 1000000 1000000\n', '997167959139 199252 232602 952690 802746\n', '244641009859 748096 689016 889744 927808\n', '483524125987 264237 209883 668942 244358\n', '726702209411 813081 730750 893907 593611\n', '965585325539 329221 18716...
1387fed5cec7d180bb3f7d2cd8d83fec
__inputs__ = ['5 2 1 4 10\n', '5 2 1 4 5\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
6bddc3b5168782330151f175a20c799b
__inputs__ = ['ab\nbaaabba\n', 'ehfjaabjfedhddejjfcfijagefhjeahjcddhchahjbagi\nfbfdjbjhibjgjgaaajgdbcfdbhjcajcbbieijhcjgajhgaa\n', 'fbaaigiihhfaahgdbddgeggjdeigfadhfddja\nhbghjgijijcdafcbgiedichdeebaddfddb\n', 'fcagdciidcedeaicgfffgjefaefaachfbfj\naiecchjehdgbjfcdjdefgfhiddjajeddiigidaibejabd\n', 'ibifgcfdbfdhihbifagea...
a3e747b22c9c63036afe31e77032bd1e
__inputs__ = ['abcd\ndabc\n', 'abc\nxyz\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
876a80a613a38950eab4a4dc2684bf9a
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
a6614a0fc213b71259ab1c415957ed90
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
2ad1fd479a2ca3d34ab7abe76a90fdb7
__inputs__ = ['1\n2\n3\n', '2\n10\n3\n', '1\n1\n1\n', '1\n2\n1\n', '10\n10\n10\n', '5\n1\n3\n', '3\n1\n5\n', '6\n7\n1\n', '1\n8\n3\n', '9\n7\n2\n', '1\n1\n10\n', '9\n1\n1\n', '10\n5\n6\n', '8\n9\n7\n', '4\n2\n10\n', '2\n8\n3\n', '3\n5\n7\n', '1\n10\n1\n', '2\n2\n2\n', '5\n6\n1\n', '10\n1\n1\n', '1\n6\n1\n', '1\n9\n1\n'...
d46f0b16e4e872ce5f54c128b7f2a147
__inputs__ = ['1\n2\n3\n', '2\n10\n3\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
9e07c8e19fade59eb47e6fd92416f690
__inputs__ = ['5\nDDRRR\n', '6\nDDRRRR\n', '1\nD\n', '1\nR\n', '2\nDR\n', '3\nRDD\n', '3\nDRD\n', '4\nDRRD\n', '4\nDRRR\n', '4\nRDRD\n', '5\nDRDRR\n', '4\nRRRR\n', '5\nRDDRD\n', '5\nDDRRD\n', '5\nDRRRD\n', '5\nDDDDD\n', '6\nDRRDDR\n', '7\nRDRDRDD\n', '7\nRDRDDRD\n', '7\nRRRDDDD\n', '8\nRRRDDDDD\n', '9\nRRRDDDDDR\n', '9...
abd2d517aa11d05ebb9b5f8643ff127a
__inputs__ = ['5\nDDRRR\n', '6\nDDRRRR\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
905e67687eb15d83cfe1a258ddccc543
__inputs__ = ['10\n10 11 10 11 10 11 10 11 10 11\n', '20\n2 3 4 5 6 7 8 9 8 7 6 5 4 3 2 1 5 6 5 6\n', '8\n1 2 2 2 2 3 3 3\n', '4\n294368194 294368194 294368194 294368195\n', '3\n1 2 1000000000\n', '5\n650111756 650111755 650111754 650111755 650111756\n', '8\n1 2 3 2 3 2 3 2\n', '6\n1 2 3 4 5 6\n', '5\n473416369 4734163...
7285184da884255e1be809c82e89a728
__inputs__ = ['6\n1 1 2 2 2 3\n', '4\n1 2 3 2\n', '6\n2 4 1 1 2 2\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
28a32368c1f2095321606cfdfa9af231
__inputs__ = ['5\n5 4 3 2 1\n5\n7 7 7 7 7\n10\n186 8 42 24 154 40 10 56 122 141\n0\n', '5\n5 4 3 2 1\n5\n7 12 2 0 7\n10\n372 8 42 18 154 40 10 56 122 141\n0\n', '5\n5 4 3 4 1\n5\n7 11 7 7 14\n0\n186 8 42 24 154 21 10 56 122 72\n0\n', '5\n5 4 3 4 1\n5\n13 11 1 7 14\n0\n186 8 64 24 241 21 13 22 122 72\n0\n', '5\n5 4 5 4 ...
2b5db1bfc22c0fcd09209f7461870db8
__inputs__ = ['5\n5 4 3 2 1\n5\n7 7 7 7 7\n10\n186 8 42 24 154 40 10 56 122 72\n0\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
ea96a6066d572cdfeee05158f339c96d
__inputs__ = ['2\n2\n50 1 2\n50 2 1\n3\n100 1 3\n47 2 1\n74 3 2\n', '2\n2\n54 1 2\n50 2 1\n3\n100 1 3\n47 2 1\n74 3 2\n', '2\n2\n54 1 2\n50 2 1\n3\n100 1 3\n47 2 1\n5 3 2\n', '2\n2\n54 1 2\n50 2 1\n3\n100 1 3\n47 2 0\n5 4 2\n', '2\n2\n54 1 2\n52 2 1\n3\n100 1 3\n47 2 0\n5 4 2\n', '2\n2\n84 1 2\n52 2 1\n3\n100 1 3\n47 2...
ea3e3035b90c1c2a428618dbf9b67a94
__inputs__ = ['2\n2\n50 1 2\n50 2 1\n3\n100 1 3\n47 2 1\n74 3 2\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
ad761bcb3acc0b39a3266fb53de2054f
__inputs__ = ['IEAIAIO\n', 'BYOB\n', 'YISVOWEL\n', 'EZYYOIYUZXEVRTOUYXIQ\n', 'MTOESEPRFEIWAIWLAFJMGBIQB\n', 'ZUBQNDCHHKWNWRVSDSRRRTGZDDPNTVJFKTCNGWND\n', 'POKKJNWMNCSXBJLDWVG\n', 'KZTNJQLPZVHZKZWIB\n', 'A\n', 'Z\n', 'EZYYOIYUZXEVRTOUYXIQ\n', 'KZTNJQLPZVHZKZWIB\n', 'Z\n', 'MTOESEPRFEIWAIWLAFJMGBIQB\n', 'A\n', 'POKKJNWMN...
05c7028ddc93bd638c2c3ca5a51b3f1c
__inputs__ = ['IEAIAIO\n', 'BYOB\n', 'YISVOWEL\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
6487aff793481381995c44194706ad8d
__inputs__ = ['3 1 2\n1\n', '9 2 26\n2 3\n', '12 3 1\n2 5 6\n', '2 1 1\n1\n', '2 1 234\n1\n', '6 2 5\n1 3\n', '2 1 1000000000\n1\n', '1000000000 1 1\n1\n', '1000000000 2 2\n1 500000000\n', '8 1 8\n2\n', '1010000000 1 1\n1\n', '1000000000 2 2\n2 500000000\n', '2 1 1000010000\n1\n', '2 1 447\n1\n', '3 1 3\n1\n', '3 1 447...
96c90f41acd77bfa57d26dc2affd1fbe
__inputs__ = ['3 1 2\n1\n', '9 2 26\n2 3\n', '12 3 1\n2 5 6\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
290a11d2bf63ceeddaaa0bde5e7ef119
__inputs__ = ['10\n1\n248618\n3\n12 10 8\n6\n100 11 15 9 7 8\n4\n0 1 1 0\n2\n0 0\n2\n0 1\n2\n1 0\n2\n1 1\n3\n0 1 0\n3\n1 0 1\n', '10\n1\n248618\n3\n12 10 8\n6\n100 11 15 9 2 8\n4\n0 1 1 0\n2\n0 0\n2\n0 1\n2\n1 0\n2\n1 1\n3\n0 1 0\n3\n1 0 1\n', '10\n1\n451008\n3\n12 10 8\n6\n000 11 15 9 2 8\n4\n0 1 1 0\n2\n0 0\n2\n0 1\n...
63697d62dfcf3ccb3abbd0537e334bed
__inputs__ = ['10\n1\n248618\n3\n12 10 8\n6\n100 11 15 9 7 8\n4\n0 1 1 0\n2\n0 0\n2\n0 1\n2\n1 0\n2\n1 1\n3\n0 1 0\n3\n1 0 1\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
3f0ebed5a80968745177dd0c4f310db4
__inputs__ = ['3\nbaba\nba\naa\naaa\naba\nab\n', '13\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n', '1\nabababababbb\nab\n', '1\nabababababbb\naa\n', '3\nbaba\nb`\naa\naaa\naba\nab\n', '13\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\nb\na\n', '3\nbcba\nb`\n...
9a29bf4f14c7a586e1889237a09f96cf
__inputs__ = ['3\nbaba\nba\naa\naaa\naba\nab\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
7f9902f3f193fcd05ae63489f303209b
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
815b202f723eb3952fd145ebe68165b4
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
00712049cd508e000c5bb1c1177681c0
__inputs__ = ['xlmw mw xli tmgxyvi xlex m xsso mr ilx xvmt.\n', 'xlmw mw xli tmgxyvi xlex m ossx mr ilx xvmt.\n', 'xlmw mw xli tmgxyvi xlex m ossx mr ilx xwmt.\n', 'xlmw mw xli tmgxyvi xlex m orsx mr ilx xwmt.\n', 'xlmw mw xli tmgxyvi xlex l orsx mr ilx xwmt.\n', 'wmlx mw xli tmgxyvi xlex l orsx mr ilx xwmt.\n', 'wmlx ...
22f7b9277bab9abb3a00b260b5f0a16f
__inputs__ = ['xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
24863895ae57de24ba4fa2e28637753e
__inputs__ = ['6\n6 3\nabcbac\n3 6\naaa\n7 1000\nabczgyo\n5 4\nababa\n20 10\naaebdbabdbbddaadaadc\n20 5\necbedececacbcbccbdec\n', '1\n7 1782\nabcabca\n', '1\n364 1485\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccdddd...
56b11815967355704799899249107c0f
__inputs__ = ['6\n6 3\nabcbac\n3 6\naaa\n7 1000\nabczgyo\n5 4\nababa\n20 10\naaebdbabdbbddaadaadc\n20 5\necbedececacbcbccbdec\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
b33e333bb950024cbecbc5c38b02cb60
__inputs__ = ['5 3\n3 2 1\n', '5 3\n2 3 1\n', '5 1\n3\n', '5 2\n3 4\n', '20 19\n2 18 19 11 9 20 15 1 8 14 4 6 5 12 17 16 7 13 3\n', '10 1\n6\n', '20 18\n8 14 18 10 1 3 7 15 2 12 17 19 5 4 11 13 20 16\n', '10 2\n3 7\n', '100000 3\n43791 91790 34124\n', '20 17\n9 11 19 4 8 16 13 3 1 6 18 2 20 10 17 7 5\n', '10 3\n2 10 3\...
d541b8f71588c2a08b9289b770d763be
__inputs__ = ['5 3\n3 2 1\n', '5 3\n2 3 1\n', '5 1\n3\n', '5 2\n3 4\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
5f25cc4951b03cf7b51ca3d02eac8f62
__inputs__ = ['3 4\n0\n', '3 4\n2\n1 1\n1 3\n', '10 10\n0\n', '100 100\n0\n', '1000 1000\n0\n', '10000 10000\n1\n1 1\n', '200000 200000\n0\n', '200000 2\n0\n', '200000 20\n0\n', '200000 200\n0\n', '133742 69\n0\n', '2 200000\n0\n', '200 200000\n0\n', '2000 200000\n0\n', '5 6\n2\n1 1\n3 1\n', '9 5\n1\n2 1\n', '2 2\n4\n1...
da1c97b137c4e690dc81e8f6b1c97bb3
__inputs__ = ['3 4\n0\n', '3 4\n2\n1 1\n1 3\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
61d7173e2a37e8bff68472232232923a
__inputs__ = ['25\nneihsokcpuziafoytisrevinu\nuniversityofaizupckoshhen\n', '6\nbaabba\nbaabab\n', '25\nuniversityofaiztpckoshien\nuniversityofaizupbkoshhen\n', '25\nuniversityofaiztpckoshien\nnehhsokbpuziafoytisrevinu\n', '25\nneihsokcptziafoytisrevinu\nsniveruityofaizupbkoshhen\n', '6\nababba\nbaabab\n', '25\nneihsok...
f8fffd0347f8b809224415b176d6ab53
__inputs__ = ['25\nneihsokcpuziafoytisrevinu\nuniversityofaizupckoshien\n', '6\nabbaba\nbaabab\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
487044b0a1afa1abb08434a5a7a17a7a
__inputs__ = ['4 6\n1 2 5 2\n2 3 3 4\n', '2 3\n5 6\n5 5\n', '24 3\n11 8 8 12 17 4 4 25 39 37 31 32 38 34 29 29 34 39 39 39 17 9 24 6\n3 5 4 3 3 3 4 3 4 3 3 3 3 4 3 3 4 3 4 3 3 3 3 3\n', '43 5\n6 7 15 12 15 7 22 33 38 15 7 23 31 21 26 41 25 14 26 33 5 28 22 6 35 17 19 32 41 27 20 25 5 32 37 19 40 9 25 22 10 24 9\n3 5 3 ...
4d887c4d210aee02168deb4d31957aa8
__inputs__ = ['4 6\n1 2 5 2\n2 3 3 4\n', '2 3\n5 6\n5 5\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
e36a724be95ed136deca05c44ebe49a0
__inputs__ = ['2 10 20\n', '4 40 60\n', '2 1 2\n', '2 100 105\n', '3 1 2\n', '4 49 188\n', '5 1 200\n', '0 10 20\n', '8 40 60\n', '1 10 20\n', '8 40 0\n', '1 10 32\n', '8 10 0\n', '1 1 32\n', '8 10 -1\n', '1 1 57\n', '8 2 -1\n', '1 1 79\n', '8 3 -1\n', '1 1 30\n', '8 3 0\n', '1 1 36\n', '8 0 0\n', '2 1 36\n', '2 1 40\n...
6c20d0f382e96eb7e04a91c087f20f76
__inputs__ = ['2 10 20\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
7fc3a091a635dfec456645413d662379
__inputs__ = ['13 9\n514562255\n322655246\n135162979\n733845982\n473117129\n513967187\n965649829\n799122777\n661249521\n298618978\n659352422\n747778378\n723261619\n', '5 20\n11111111111111111111\n11111111111111111111\n11111111111111111111\n99999999999999999999\n11111111111111111119\n', '4 15\n222222222222222\n111111111...
e16c67a2084b60c7276ead84e2ce397f
__inputs__ = ['3 5\n91728\n11828\n11111\n', '3 3\n223\n232\n112\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
c74fd7b456f276ca448efe2d2fae3761
__inputs__ = ['2 6 5\n1 1 0 5000\n3 2 0 5500\n2 2 0 6000\n15 0 2 9000\n9 0 1 7000\n8 0 2 6500\n', '2 4 5\n1 2 0 5000\n2 1 0 4500\n2 1 0 3000\n8 0 1 6000\n', '2 5 5\n1 1 0 1\n2 2 0 100\n3 2 0 10\n9 0 1 1000\n10 0 2 10000\n', '2 4 5\n1 1 0 1\n2 2 0 10\n8 0 1 100\n9 0 2 1000\n', '1 2 1\n10 1 0 16\n20 0 1 7\n', '1 2 10\n20...
ffc37c75ff5cec9e40ddf6c0fa8c2c44
__inputs__ = ['2 6 5\n1 1 0 5000\n3 2 0 5500\n2 2 0 6000\n15 0 2 9000\n9 0 1 7000\n8 0 2 6500\n', '2 4 5\n1 2 0 5000\n2 1 0 4500\n2 1 0 3000\n8 0 1 6000\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL_...
7b2f006c1fe820cb8e26c3ab278134a8
__inputs__ = ['4\n1 2\n2 3\n2 3\n', '4\n1 2\n1 3\n2 4\n', '3\n1 2\n1 3\n', '4\n1 2\n2 3\n2 2\n', '4\n1 2\n2 3\n2 0\n', '4\n0 2\n2 3\n2 2\n', '4\n1 2\n2 3\n0 0\n', '3\n0 2\n2 3\n', '6\n2 2\n2 3\n3 4\n2 5\n5 6\n', '4\n1 2\n2 3\n0 2\n', '4\n1 1\n2 3\n2 0\n', '4\n0 2\n2 4\n2 2\n', '4\n0 2\n2 3\n0 2\n', '3\n1 1\n2 3\n', '6\...
91e9116ad7b3801f55c8125d4b3be4a8
__inputs__ = ['3\n1 2\n2 3\n', '6\n1 2\n2 3\n3 4\n2 5\n5 6\n', '4\n1 2\n2 3\n2 4\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
fd81bba2382de5308a1c8db247c102c7
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
84d1431066233900495e82b37be57c86
def is_eq(a, b): if a == b: return True elif isinstance(a, (int, float)) and isinstance(b, (int, float)): return abs(a - b) < 1e-4 elif isinstance(a, list) and isinstance(b, list): if len(a) != len(b): return False for x, y in zip(a, b): if not is_eq(...
0e2bce571f4d6a4fcdd7f75f811ad1c5
__inputs__ = ['2 1\n', '2525 -425\n', '1 0\n', '42687 -70956\n', '23294 13184\n', '97692 12674\n', '24115 24178\n', '66977 75123\n', '55684 -111366\n', '13582 27162\n', '79303 -158603\n', '76435 152867\n', '100000 51090\n', '100000 -8286\n', '100000 -87789\n', '100000 182670\n', '100000 -38560\n', '100000 -199998\n', '...
d4f0ec8d40fb81d1a0dd6bbd2e21bf08
__inputs__ = ['2 1\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
718aaaa67eac50a15245f54a39e6d24d
__inputs__ = ['2\n20 14\n20 16\n', '2\n20 14\n20 14\n', '2\n32 14\n20 14\n', '2\n20 14\n36 14\n', '2\n20 8\n36 14\n', '2\n28 8\n36 14\n', '2\n20 16\n20 14\n', '2\n32 20\n20 14\n', '2\n20 14\n20 10\n', '2\n20 16\n20 10\n', '2\n20 4\n20 10\n', '2\n32 14\n20 4\n', '2\n20 8\n20 10\n', '2\n16 8\n36 14\n', '2\n32 26\n20 14\n...
403ccf0c3a26987b8782b9cb7cfe2946
__inputs__ = ['2\n20 14\n20 16\n'] for __inp__ in __inputs__: import io sys.stdin = io.TextIOWrapper(io.BytesIO(__inp__.encode()), encoding='utf8') __run_prog__() print("___SENTINEL___")
a147a32d556e66506018deb65cedade6