messages
listlengths
1
1
ground_truth
stringlengths
88
726k
dataset
stringclasses
2 values
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem C: Seishun 18 Kippu\n\nA...
[{"type": "stdin_stdout", "input": "4 4\nA B G\nA B 34 3\nB C 80 -1\nA G 40 0\nB G 80 -1\n10 6\nKusatsu Tokyo Aizu\nTokyo Nagoya 120 3\nKusatsu Nagoya 40 0\nKusatsu Kanazawa 40 0\nKanazawa Aizu 67 1\nTojyo Kanazawa 40 0\nTpkyo @jzu 80 4\n0 0", "output": "3\n17\n"}, {"type": "stdin_stdout", "input": "4 4\nA B G\nA B 34 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nHakone Ekiden is one of the Japa...
[{"type": "stdin_stdout", "input": "10\nU\nD\nU\nD\nU\nD\nU\nD\nU\nD", "output": "608"}, {"type": "stdin_stdout", "input": "8\nT\nD\nD\nD\nD\nD\nD\nC", "output": "0\n"}, {"type": "stdin_stdout", "input": "8\nT\nD\nD\nD\nD\nD\nC\nC", "output": "0\n"}, {"type": "stdin_stdout", "input": "8\nT\nD\nD\nD\nD\nE\nC\nC", "outpu...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem statement\n\nHere are N ...
[{"type": "stdin_stdout", "input": "2 15\n3 3 4 13 3\n1 11 0 1 2", "output": "4.230769\n"}, {"type": "stdin_stdout", "input": "2 15\n3 3 4 10 3\n1 11 0 1 2", "output": "4.300000\n"}, {"type": "stdin_stdout", "input": "2 13\n3 3 4 10 3\n1 11 0 1 2", "output": "4.100000\n"}, {"type": "stdin_stdout", "input": "2 13\n3 3 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven a non-negative decimal int...
[{"type": "stdin_stdout", "input": "-10", "output": "11111111111111111111111111110110\n00000000000000000000000000001001\n11111111111111111111111111101100\n01111111111111111111111111111011\n"}, {"type": "stdin_stdout", "input": "-12", "output": "11111111111111111111111111110100\n00000000000000000000000000001011\n1111111...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "50\n6\nbxyxcz\n4\nzzcy\n2\nzb\n2\nyb\n6\nzzbxyx\n4\nbxzb\n4\naaca\n4\nbzyx\n4\nxaac\n2\nbb\n2\nzb\n6\ncabcbb\n6\nyxzbbb\n2\nxz\n2\ncc\n6\nazcaza\n4\nyyaa\n2\nxb\n2\nyb\n6\nzaxxxz\n4\nbyab\n4\naxxz\n2\nay\n2\nyb\n2\ncx\n4\nzyab\n6\nybcyya\n6\nxayzaz\n4\nzacx\n6\nzzyxbz\n2\ncc\n4\nbycx...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOur brave travelers reached an i...
[{"type": "stdin_stdout", "input": "20 20\n####################\n############.####.##\n#######..####..#####\n######............##\n######.....#...###.#\n#####E..........##.#\n#.##.#.........#####\n##NR....KO.....#####\n##B........#...#####\n#Y.W...H.......#####\n#####Z.....#...#####\n######...#.#...#####\n#A.......#.#....
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n people sitting in a ...
[{"type": "stdin_stdout", "input": "735134400\n", "output": "1 367567202 735134403 1102701604 1470268805 1837836006 2205403207 2572970408 2940537609 3308104810 3675672011 4043239212 4410806413 4778373614 5145940815 5513508016 5881075217 6248642418 6983776820 7351344021 7718911222 8454045624 8821612825 9189180026 955674...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given an integer n (n β‰₯ ...
[{"type": "stdin_stdout", "input": "97 100\n93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 93 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet s be some string consisting ...
[{"type": "stdin_stdout", "input": "99985 45273\n", "output": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWhile playing with geometric fig...
[{"type": "stdin_stdout", "input": "100\n", "output": "19801\n"}, {"type": "stdin_stdout", "input": "72\n", "output": "10225\n"}, {"type": "stdin_stdout", "input": "94\n", "output": "17485\n"}, {"type": "stdin_stdout", "input": "77\n", "output": "11705\n"}, {"type": "stdin_stdout", "input": "86\n", "output": "14621\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor years, the Day of city N was...
[{"type": "stdin_stdout", "input": "100 7 7\n1656 322 975 921 115 647 61 232 127 277 839 797 261 968 788 381 191 117 663 959 475 166 471 984 17 473 57 809 65 881 1109 725 587 933 466 537 1017 706 927 173 636 372 644 82 835 893 792 494 808 977 479 109 1858 21 625 104 626 569 524 504 16 257 274 285 404 629 247 609 521 60...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn addition to complaints about ...
[{"type": "stdin_stdout", "input": "10 15 50 10\n10 12\n6 8\n4 14\n6 14\n10 15\n1 14\n1 11\n3 11\n2 10\n7 13\n6 17\n18 45\n25 31\n6 42\n9 39\n6 25\n20 42\n11 12\n38 44\n8 49\n5 21\n12 46\n5 21\n15 31\n10 46\n5 15\n2 14\n7 8\n9 13\n4 7\n3 11\n4 15\n8 15\n7 10\n3 10\n", "output": "8 17\n1 4 6 10 11 12 13 14 "}, {"type": ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecently Ivan the Fool decided t...
[{"type": "stdin_stdout", "input": "100000 100000\n", "output": "870472905\n"}, {"type": "stdin_stdout", "input": "52702 64157\n", "output": "1000000005\n"}, {"type": "stdin_stdout", "input": "24538 86821\n", "output": "1000000005\n"}, {"type": "stdin_stdout", "input": "99999 100000\n", "output": "758107445\n"}, {"type...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call an array t dominated ...
[{"type": "stdin_stdout", "input": "4\n1\n1\n6\n1 2 3 4 5 1\n9\n4 1 2 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n6\n3\n2\n"}, {"type": "stdin_stdout", "input": "4\n1\n1\n6\n1 2 3 4 5 2\n9\n4 1 2 4 5 4 3 2 1\n4\n3 3 3 3\n", "output": "-1\n5\n3\n2\n"}, {"type": "stdin_stdout", "input": "4\n1\n1\n6\n1 2 3 4 5 2\n9\n4 1 4 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAnu has created her own function...
[{"type": "stdin_stdout", "input": "100\n8650752 65536 131072 134217728 2112 8 0 0 0 0 0 1 0 0 268435456 1024 0 18890756 0 0 0 135364608 6291464 0 0 0 0 0 32 0 16384 0 0 0 0 33554560 256 0 16 0 0 536870912 536870912 0 0 128 0 0 4096 2048 0 0 0 0 268435456 64 1 0 0 262144 524288 0 8192 0 0 0 2 2 512 131072 0 0 67108864 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe next lecture in a high schoo...
[{"type": "stdin_stdout", "input": "14\n137698508 528184026 54130884 239033739 1038011779 720680829 605286542 89272810 284191042 179359950 186766648 570400677 107541072 25121211\n195343970 709242622 422954170 980941827 265963618 812646456 943660193 344102432 295006337 221455256 203711937 632473368 334173424 49206958\n"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRecall that the sequence b is a ...
[{"type": "stdin_stdout", "input": "10\n10\n-1 5 10 2 -8 -7 -6 5 -3 -1\n10\n2 2 1 4 5 6 12 3 9 10\n1\n6\n1\n-7\n11\n5 -4 1 2 3 -5 -7 -10 -2 1 12\n4\n-4 -5 -6 1\n7\n1 2 6 1 2 -6 -2\n5\n-1 -5 4 -2 -9\n1\n9\n3\n1 -1 1\n", "output": "7\n12\n6\n-7\n14\n-3\n4\n1\n9\n1\n"}, {"type": "stdin_stdout", "input": "10\n10\n-1 5 17 3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVivek has encountered a problem....
[{"type": "stdin_stdout", "input": "5\n2 5\nB.GGG\n.B.G.\n3 6\nBB#.GG\nB.#B.G\n.#.#G.\n3 2\n..\n..\n..\n1 4\nBBB.\n4 9\n###B##.B#\n.####.##G\n##.###.#.\n...B#.B#.\n", "output": "Yes\nYes\nYes\nYes\nYes\n"}, {"type": "stdin_stdout", "input": "5\n2 5\nB.GGG\n.B.G.\n3 6\nBB#.GG\nB.#B.G\n.#.#G.\n3 2\n..\n..\n..\n1 4\nBBB.\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s[1 ... n...
[{"type": "stdin_stdout", "input": "6\n8\nbbdcaaaa\n8\nasdfghjk\n8\nceaaaabb\n8\nbbaaddcc\n1\nz\n2\nac\n", "output": "0\n7\n4\n5\n1\n1\n"}, {"type": "stdin_stdout", "input": "6\n8\nbbdcaaaa\n8\nasdfghjk\n8\nceaaaabb\n8\nbbaaddcc\n1\nz\n2\nbc\n", "output": "0\n7\n4\n5\n1\n1\n"}, {"type": "stdin_stdout", "input": "6\n8\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIgor had a sequence d_1, d_2, .....
[{"type": "stdin_stdout", "input": "50\n-3950\n900000000 180000000 900000000 -360000000 360000000 -180000000 -540000000 720000000 540000000 900000000 335247004 -900000000 -180000000 -360000000 0 -1290903016 540000000 540000000 -180000000 -900000000 -540000000 360000000 180000000 0 540000000 -540000000 360000000 -900000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs Sherlock Holmes was investiga...
[{"type": "stdin_stdout", "input": "64 28\n+54\n+44\n+55\n-3\n+33\n-54\n-54\n-7\n+33\n+54\n+54\n+26\n-54\n+14\n-54\n-47\n+25\n-54\n-54\n-54\n-52\n+54\n+54\n+54\n+54\n+20\n+7\n+54\n+4\n+32\n+46\n-54\n-47\n+15\n+32\n-54\n+7\n+62\n-16\n-54\n+3\n+54\n+54\n+54\n+54\n-54\n+54\n-54\n+54\n-52\n+27\n-7\n+54\n-5\n-54\n-18\n+1\n+...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe Smart Beaver from ABBYY was ...
[{"type": "stdin_stdout", "input": "10 50 200\n10 1 22\n2 9 6\n4 2 98\n6 6 38\n5 1 67\n6 7 17\n10 4 29\n6 5 97\n3 8 51\n1 6 31\n5 9 72\n4 5 50\n2 1 3\n10 2 27\n1 10 78\n9 9 48\n8 7 81\n5 8 64\n9 4 78\n7 5 90\n9 8 83\n7 1 99\n5 5 43\n1 2 37\n3 3 6\n4 3 61\n9 6 25\n1 3 46\n2 10 18\n1 4 68\n2 4 75\n3 10 67\n7 8 82\n5 7 1\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nQwerty the Ranger took up a gove...
[{"type": "stdin_stdout", "input": "1000000 1000000 1000000 1000000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "1000000 1000000 1000000 1010000\n", "output": "1000000\n"}, {"type": "stdin_stdout", "input": "100000 100000 1000000 1000000\n", "output": "999999\n"}, {"type": "stdin_stdout", "input": "12...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPolycarpus has an array, consist...
[{"type": "stdin_stdout", "input": "100\n968 793 -628 -416 942 -308 977 168 728 -879 952 781 -425 -475 -480 738 -740 142 -319 -116 -701 -183 41 324 -918 -391 -176 781 763 888 475 -617 134 -802 -133 -211 855 -869 -236 503 550 387 137 -221 -957 -800 -56 -673 440 -791 -217 -959 -892 886 -593 427 890 223 -425 -342 -262 693...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA girl named Xenia has a cupboar...
[{"type": "stdin_stdout", "input": "1 10010000\n", "output": "20020001\n"}, {"type": "stdin_stdout", "input": "3 15787624\n", "output": "10525083\n"}, {"type": "stdin_stdout", "input": "2 10001000\n", "output": "10001001\n"}, {"type": "stdin_stdout", "input": "1 10010001\n", "output": "20020003\n"}, {"type": "stdin_std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe'll call a set of positive int...
[{"type": "stdin_stdout", "input": "5000\n", "output": "50000000 49916790 49912500 49896000 49808682 49803600 49787136 49766400 49674240 49612500 49603708 49601160 49561600 49545216 49520625 49509306 49500000 49413375 49412580 49397040 49392000 49305564 49280000 49268736 49218750 49207500 49193760 49172480 49152000 491...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFox Ciel wants to write a task f...
[{"type": "stdin_stdout", "input": "524125987\n", "output": "262\nNNYYNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNYYNYNNYNNNYNNNNNNYNNNNNNNYNNNNNNNNYNNNNNNNNNYNNNNNNNNNNNYNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNN...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt the children's day, the child...
[{"type": "stdin_stdout", "input": "134596 17540\n", "output": "16924\n17540 17539 17538 17537 17536 17535 17534 17533 17532 17531 17530 17529 17528 17527 17526 17525 17524 17523 17522 17521 17520 17519 17518 17517 17516 17515 17514 17513 17512 17511 17510 17509 17508 17507 17506 17505 17504 17503 17502 17501 17500 174...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nOn a history lesson the teacher ...
[{"type": "stdin_stdout", "input": "10\n10 10\n13 15\n6 14\n10 15\n4 15\n11 12\n11 15\n8 15\n1 11\n1 9\n", "output": "10 14 6 12 4 11 13 8 2 1\n"}, {"type": "stdin_stdout", "input": "10\n10 10\n13 15\n6 14\n10 15\n4 15\n11 12\n11 15\n5 15\n1 11\n1 9\n", "output": "10 14 6 12 4 11 13 5 2 1\n"}, {"type": "stdin_stdout", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a n Γ— m field cons...
[{"type": "stdin_stdout", "input": "14 29\n**.*************..*.*********\n**..****.*********.**.*.****.\n********.**..*..*...*....**..\n****.**.***.*.***..*..***.*..\n***.****.***..*.***.*.****.*.\n*.*..***.***********.*.*.****\n****.*.***.*..****.**.**..***\n.*******..**...***.*.********\n*...**********...**...*.***.*...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya loves computer games. Fina...
[{"type": "stdin_stdout", "input": "100 10000\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya likes everything infinite....
[{"type": "stdin_stdout", "input": "-1000000000 1000000000 1000000000\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-1000000000 1001000000 1000000000\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "119057893 -516914539 -39748277\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "-19889377...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a description of a...
[{"type": "stdin_stdout", "input": "10 20\n....................\n.........*..........\n....................\n....................\n....................\n....................\n....................\n....................\n...*..............*.\n.........*..........\n", "output": "YES\n9 10\n"}, {"type": "stdin_stdout", "in...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya has a pack of 54 cards (52...
[{"type": "stdin_stdout", "input": "13 4\nAH TC J2 4D\nQD 4S 3C KS\n6S 8S 5S 9H\n2D JS 7H JD\nKD QS JC 6C\nAD 3S 8C 7D\nAS 2S 9C KC\n3D J1 9D 8D\n4H 7C TH 4C\n9S QC QH 2C\n2H 6H KH TD\n3H 8H 5C TS\nAC 5D 5H JH\n", "output": "Solution exists.\nReplace J1 with 6D and J2 with 7S.\nPut the first square to (1, 1).\nPut the ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs you have noticed, there are l...
[{"type": "stdin_stdout", "input": "100\n84 94 72 32 61 90 61 2 76 42 35 82 90 29 51 27 65 99 38 41 44 73 100 58 56 64 54 31 14 58 57 64 90 49 73 80 74 19 31 86 73 44 39 43 28 95 23 5 85 5 74 81 34 44 86 30 50 57 94 56 53 42 53 87 92 78 53 49 78 60 37 63 41 19 15 68 25 77 87 48 23 100 54 27 68 84 43 92 76 55 2 94 100 2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Timofey likes integers a ...
[{"type": "stdin_stdout", "input": "239 100\n95 225 152 10 96 20 192 51 150 138 105 206 33 41 29 127 53 75 118 9 21 43 119 52 174 139 86 161 207 19 203 215 228 30 66 64 32 44 217 54 131 0 74 117 22 129 109 171 172 141 181 237 107 151 193 140 142 85 55 182 160 42 185 106 11 97 65 163 195 63 128 226 194 184 173 216 84 13...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n<image>\n\nIt's the end of July ...
[{"type": "stdin_stdout", "input": "433 3\nFZDDHMJGBZCHFUXBBPIEBBEFDWOMXXEPOMDGSMPIUZOMRZQNSJAVNATGIWPDFISKFQXJNVFXPHOZDAEZFDAHDXXQKZMGNSGKQNWGNGJGJZVVITKNFLVCPMZSDMCHBTVAWYVZLIXXIADXNYILEYNIQHKMOGMVOCWGHCWIYMPEPADSJAAKEGTUSEDWAHMNYJDIHBKHVUHLYGNGZDBULRXLSAJHPCMNWCEAAPYMHDTYWPADOTJTXTXUKLCHWKUSZRHEKQEFPVJEJJHRWCKYOIWAL...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPetya learned a new programming ...
[{"type": "stdin_stdout", "input": "10\n^ 59\n& 1021\n& 510\n^ 470\n& 1022\n& 251\n& 760\n& 1016\n| 772\n| 515\n", "output": "3\n& 1023\n| 775\n^ 232\n"}, {"type": "stdin_stdout", "input": "10\n^ 59\n& 1021\n& 510\n^ 34\n& 1022\n& 251\n& 760\n& 1016\n| 772\n| 515\n", "output": "3\n& 1023\n| 775\n^ 24\n"}, {"type": "std...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the year of 30XX participants...
[{"type": "stdin_stdout", "input": "10 10 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n2 1 15 1\n7 1 4 1\n10 1 7 1\n2 1 7 1\n3 1 2 1\n5 1 2 1\n10 1 5 1\n6 1 9 1\n", "output": "3\n4\n6\n3\n3\n4\n3\n3\n4\n3\n"}, {"type": "stdin_stdout", "input": "10 10 1 8 4\n10\n2 3 4 5 6 7 8 9\n10\n1 1 3 1\n2 1 7 1\n2 1 15 1\n7 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given a string s consist...
[{"type": "stdin_stdout", "input": "100\nyeywsnxcwslfyiqbbeoaawtmioksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqgu\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "100\nyeywsnxcwslfyiqbbeoiawtmaoksfdndptxxcwzfmrpcixjbzvicijofjrbcvzaedglifuoczgjlqylddnsvsjfmfsccxbdveqgu\n", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA necklace can be described as a...
[{"type": "stdin_stdout", "input": "-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "o----------o----------o----------o----------o----------o----------o----------o----------o----------o\n", "output": "YES\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYakko, Wakko and Dot, world-famo...
[{"type": "stdin_stdout", "input": "-16 2\n", "output": "5/6\n"}, {"type": "stdin_stdout", "input": "-16 3\n", "output": "2/3\n"}, {"type": "stdin_stdout", "input": "-12 2\n", "output": "5/6\n"}, {"type": "stdin_stdout", "input": "3 -12\n", "output": "2/3\n"}, {"type": "stdin_stdout", "input": "-12 3\n", "output": "2/3...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem:\n\nN boxes are arranged...
[{"type": "stdin_stdout", "input": "60 5\n60 28\n32 38\n31 44\n48 30\n14 34", "output": "YES\nYES\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "60 5\n60 28\n32 38\n31 44\n48 30\n14 4", "output": "YES\nYES\nYES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "60 5\n60 28\n32 38\n31 44\n48 30\n25 4", "output": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLittle Arjit is in love with Dee...
[{"type": "stdin_stdout", "input": "2\n2\n16\n\nELMPBS", "output": "Arjit\nDeepa\n"}, {"type": "stdin_stdout", "input": "2\n2\n16\n\nELLPBS", "output": "Arjit\nDeepa\n"}, {"type": "stdin_stdout", "input": "2\n4\n10\n\nSBMPLE", "output": "Deepa\nDeepa\n"}, {"type": "stdin_stdout", "input": "2\n4\n14\n\nSAMQLE", "output"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nRajat is a guy who always wants ...
[{"type": "stdin_stdout", "input": "98\n100026500 100010776 19170 diamond\n100024464 99996319 5706 heart\n100005436 99990832 32392 diamond\n100000292 99982871 12383 spade\n100019912 99993613 25668 club\n100004664 99996953 15142 heart\n100006868 99979224 25548 diamond\n100012316 99990126 3036 diamond\n100000288 99991248...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe cat Snuke wants to play a po...
[{"type": "stdin_stdout", "input": "-10", "output": "pon\n"}, {"type": "stdin_stdout", "input": "151", "output": "pon\n"}, {"type": "stdin_stdout", "input": "-20", "output": "pon\n"}, {"type": "stdin_stdout", "input": "-15", "output": "hon\n"}, {"type": "stdin_stdout", "input": "115", "output": "hon\n"}, {"type": "stdi...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTakahashi has a maze, which is a...
[{"type": "stdin_stdout", "input": "-1 13\n-.,#/\n/#/$.\n.$./,", "output": "0\n"}, {"type": "stdin_stdout", "input": "-1 13\n-/,#.\n/#/$.\n.$./,", "output": "0\n"}, {"type": "stdin_stdout", "input": "-2 13\n-/,#.\n/#/$.\n.$./,", "output": "0\n"}, {"type": "stdin_stdout", "input": "-2 19\n-/,#.\n/#/$.\n.$./,", "output":...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nGiven is a string S consisting o...
[{"type": "stdin_stdout", "input": "aaaccacabaababb", "output": "11\n"}, {"type": "stdin_stdout", "input": "abbccacabaababa", "output": "13\n"}, {"type": "stdin_stdout", "input": "abbccaaabaababc", "output": "12\n"}, {"type": "stdin_stdout", "input": "`abab`cbbba`c`b", "output": "14\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe restaurant AtCoder serves th...
[{"type": "stdin_stdout", "input": "123\n123\n161\n123\n123", "output": "681\n"}, {"type": "stdin_stdout", "input": "123\n123\n161\n123\n163", "output": "721\n"}, {"type": "stdin_stdout", "input": "123\n123\n161\n123\n263", "output": "821\n"}, {"type": "stdin_stdout", "input": "123\n123\n123\n123\n123", "output": "643"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNiwango-kun has \\\\(N\\\\) chic...
[{"type": "stdin_stdout", "input": "4\n3 12 6 4", "output": "18\n"}, {"type": "stdin_stdout", "input": "4\n2 9 3 8", "output": "12\n"}, {"type": "stdin_stdout", "input": "4\n2 5 3 11", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n2 9 3 11", "output": "2\n"}, {"type": "stdin_stdout", "input": "4\n2 0 2 10", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider the following game:\n\n...
[{"type": "stdin_stdout", "input": "36 17", "output": "644469316\n"}, {"type": "stdin_stdout", "input": "36 18", "output": "653755501\n"}, {"type": "stdin_stdout", "input": "36 22", "output": "667405665\n"}, {"type": "stdin_stdout", "input": "59 22", "output": "723249007\n"}, {"type": "stdin_stdout", "input": "49 17", ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEnter a positive integer n of 4,...
[{"type": "stdin_stdout", "input": "2\n-1\n207", "output": "10\n0\n1521520\n"}, {"type": "stdin_stdout", "input": "2\n-1\n254", "output": "10\n0\n2796160\n"}, {"type": "stdin_stdout", "input": "2\n-1\n326", "output": "10\n0\n5881204\n"}, {"type": "stdin_stdout", "input": "2\n-1\n100", "output": "10\n0\n176851\n"}, {"ty...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe screen that displays digital...
[{"type": "stdin_stdout", "input": "3\n0\n5\n1\n1\n1\n-1", "output": "0111111\n1010010\n1101011\n0000110\n"}, {"type": "stdin_stdout", "input": "3\n0\n9\n1\n1\n0\n-1", "output": "0111111\n1010000\n1101001\n0111111\n"}, {"type": "stdin_stdout", "input": "3\n0\n5\n1\n1\n2\n-1", "output": "0111111\n1010010\n1101011\n10110...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\n$N$ sages are sitting around a r...
[{"type": "stdin_stdout", "input": "5\n1 1 0 1 0\n1 3 1 -2 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5\n1 1 0 1 0\n1 3 1 -1 4", "output": "0\n"}, {"type": "stdin_stdout", "input": "5\n1 1 0 0 2\n1 3 0 2 13", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n1 0 0 1 0\n2 3 6 1 2", "output": "3\n"},...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDr. Asimov, a robotics researche...
[{"type": "stdin_stdout", "input": "1\nC A C\n1\nE C A\n10\nF A B\n0", "output": "0.00000000\n0.00000000\n0.07220459\n"}, {"type": "stdin_stdout", "input": "1\nC A C\n2\nE C A\n10\nF A B\n0", "output": "0.00000000\n0.12500000\n0.07220459\n"}, {"type": "stdin_stdout", "input": "1\nC A C\n1\nF C A\n10\nF A B\n0", "output...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider car trips in a country ...
[{"type": "stdin_stdout", "input": "2 0\n1 1\n5 4\n2 5\n2 2 1 1\n2 3 2 2\n3 4 2 2\n4 5 2 1\n6 6\n1 6\n1 2 2 1\n2 3 2 1\n3 6 2 2\n1 4 2 30\n6 5 3 23\n5 6 2 30\n11 7\n1 6\n1 2 1 30\n2 3 1 30\n3 1 1 30\n3 4 100 30\n4 5 2 30\n5 6 1 30\n6 4 1 30\n0 0", "output": "unreachable\n5.0000000000\n6.0000000000\n12.4692246782\n"}, {...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nPrincess in Danger\n\nPrincess c...
[{"type": "stdin_stdout", "input": "2 1 0 1 0 1\n0 1 2\n3 1 1 2 0 1\n2\n1 2 1\n1 2 1\n3 2 1 2 0 1\n2\n0 2 1\n1 2 1\n4 4 1 4 1 3\n2\n0 1 2\n1 2 4\n0 2 1\n5 0 3\n5 3 2 6 0 3\n1 2\n2 1 2\n1 0 1\n3 4 1\n2 4 1\n4 1 2\n3 0 2\n5 1 2 6 0 3\n1 2\n4 2 4\n2 2 1\n4 3 2\n0 -1 5\n1 4 2\n2 0 1\n0 0 0 0 0 0", "output": "Help!\nHelp!\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nProblem statement\n\nWe played a...
[{"type": "stdin_stdout", "input": "5\n0 1 0 3 4\n30 1 0 3 4\n90 2 0 6 8\n120 1 1 1 1\n132 2 1 2 2", "output": "5.00000000 1.00000000\n1.41421356 0.20000000"}, {"type": "stdin_stdout", "input": "5\n0 2 0 3 4\n16 1 0 1 4\n155 2 0 6 13\n103 1 1 1 1\n132 -1 1 1 2", "output": "10.295630 2.316667\n1.000000 0.483333\n"}, {"t...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nC: Mod! Mod!\n\nstory\n\nThat's ...
[{"type": "stdin_stdout", "input": "6\n1 25 1 10 1 3", "output": "4\n"}, {"type": "stdin_stdout", "input": "6\n0 15 1 10 2 3", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n0 15 0 10 2 3", "output": "6\n"}, {"type": "stdin_stdout", "input": "6\n0 15 0 10 2 4", "output": "6\n"}, {"type": "stdin_stdout", "input...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nproblem\n\nI want to put as many...
[{"type": "stdin_stdout", "input": "87 15\n12 66", "output": "1305\n"}, {"type": "stdin_stdout", "input": "87 29\n12 66", "output": "2523\n"}, {"type": "stdin_stdout", "input": "27 27\n16 16", "output": "473\n"}, {"type": "stdin_stdout", "input": "27 32\n16 16", "output": "352\n"}, {"type": "stdin_stdout", "input": "-1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor a given weighted directed gr...
[{"type": "stdin_stdout", "input": "2 -1\n-1 2 8\n-1 15 4\n-1 0 12\n1 -2 3\n-1 0 4\n3 -1 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 -1\n-1 2 8\n-1 10 4\n-1 0 12\n1 -2 3\n-1 0 4\n3 -1 1", "output": "-1\n"}, {"type": "stdin_stdout", "input": "2 -1\n-1 2 8\n-1 10 4\n-1 0 12\n1 -2 3\n-1 0 4\n3 -1 2", "outp...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFor given integers m and n, comp...
[{"type": "stdin_stdout", "input": "-1 1", "output": "1000000006\n"}, {"type": "stdin_stdout", "input": "-2 1", "output": "1000000005\n"}, {"type": "stdin_stdout", "input": "-4 1", "output": "1000000003\n"}, {"type": "stdin_stdout", "input": "-3 1", "output": "1000000004\n"}, {"type": "stdin_stdout", "input": "-5 1", "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThe heat during the last few day...
[{"type": "stdin_stdout", "input": "5 2\n11 4 10 2 -1\n", "output": "8.333333333333334\n"}, {"type": "stdin_stdout", "input": "5 2\n11 4 10 1 -1\n", "output": "8.333333333333334\n"}, {"type": "stdin_stdout", "input": "5 2\n11 4 10 1 0\n", "output": "8.333333333333334\n"}, {"type": "stdin_stdout", "input": "5 3\n1 7 15 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMedicine faculty of Berland Stat...
[{"type": "stdin_stdout", "input": "10\n5620 2478 4051 7060 10510 2170 6912 2031 1781 7454\n1 1 1 1 1 1 1 1 1 1\n", "output": "5620\n"}, {"type": "stdin_stdout", "input": "10\n5620 1555 4051 7060 10510 2170 6912 2031 1781 7454\n1 1 1 1 1 1 1 1 1 1\n", "output": "5620\n"}, {"type": "stdin_stdout", "input": "10\n6870 354...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFormula 1 officials decided to i...
[{"type": "stdin_stdout", "input": "4 2\n29 16 13 10\n20 10 10 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4 3\n50 30 20 10\n15 10 7 10\n", "output": "3\n"}, {"type": "stdin_stdout", "input": "4 4\n29 16 13 10\n20 10 8 -1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "4 3\n51 30 20 10\n15 10 7...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBerkomnadzor β€” Federal Service f...
[{"type": "stdin_stdout", "input": "35\n-0.0.0.47\n+0.0.0.39/32\n+0.0.0.23\n+0.0.0.6/31\n-0.0.0.2\n+0.0.0.8/32\n+0.0.0.54/32\n-0.0.0.43\n-0.0.0.31/32\n-0.0.0.0\n+0.0.0.26/32\n-0.0.0.42\n+0.0.0.52\n-0.0.0.10/31\n+0.0.0.53\n+0.0.0.28/32\n-0.0.0.19/32\n-0.0.0.12\n-0.0.0.16/31\n-0.0.0.35/32\n+0.0.0.51\n+0.0.0.24/31\n-0.0.0...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nBob is a duck. He wants to get t...
[{"type": "stdin_stdout", "input": "10\n324839129156 133475576222 1946579156099 185514358673 88712073883 243757012712 950854402304 21947060440 598567289966 674328002732\nGLLLLLLLLW\n", "output": "26365097587258\n"}, {"type": "stdin_stdout", "input": "10\n324839129156 133475576222 987711341463 185514358673 88712073883 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIvan recently bought a detective...
[{"type": "stdin_stdout", "input": "17\n15 4 3 6 5 11 8 8 9 10 15 12 13 14 17 16 17\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "17\n16 4 3 6 7 6 10 8 9 10 11 12 13 14 15 16 17\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "17\n9 4 3 6 7 6 10 8 9 10 11 12 13 14 15 16 17\n", "output": "8\n"}, {"typ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThis morning Tolik has understoo...
[{"type": "stdin_stdout", "input": "782 19\n", "output": "1 1\n782 19\n1 2\n782 18\n1 3\n782 17\n1 4\n782 16\n1 5\n782 15\n1 6\n782 14\n1 7\n782 13\n1 8\n782 12\n1 9\n782 11\n1 10\n782 10\n1 11\n782 9\n1 12\n782 8\n1 13\n782 7\n1 14\n782 6\n1 15\n782 5\n1 16\n782 4\n1 17\n782 3\n1 18\n782 2\n1 19\n782 1\n2 1\n781 19\n2...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a country with n citize...
[{"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 9\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n", "output": "7 10 2 4 7 10 3 7 9 9\n"}, {"type": "stdin_stdout", "input": "10\n7 9 4 4 7 6 3 7 9 8\n10\n1 3 2\n1 10 5\n1 5 3\n1 5 2\n1 2 9\n1 2 7\n1 2 10\n1 5 7\n1 6 10\n1 10 9\n",...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere is a white sheet of paper ...
[{"type": "stdin_stdout", "input": "676584 172869 696986 939949\n217531 247380 771662 973703\n630670 592931 1018961 967883\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "347722 718484 584813 736820\n280059 317406 1617512 588815\n388486 281361 399827 854715\n", "output": "YES\n"}, {"type": "stdin_stdout", "i...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn the Catowice city next weeken...
[{"type": "stdin_stdout", "input": "5\n4 6\n1 1\n3 3\n1 2\n2 2\n4 4\n4 2\n\n6 6\n3 4\n2 3\n3 2\n1 1\n3 3\n4 4\n\n6 8\n1 1\n3 1\n2 2\n3 3\n3 2\n1 2\n4 4\n2 4\n\n5 8\n4 4\n3 5\n3 4\n5 5\n1 3\n3 3\n2 2\n1 1\n\n5 10\n5 2\n2 3\n4 4\n2 1\n4 4\n3 1\n2 3\n3 3\n5 5\n1 1\n", "output": "Yes\n1 3\n2 \n1 3 4 \nYes\n1 5\n1 \n2 3 4 5...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nLet's call two numbers similar i...
[{"type": "stdin_stdout", "input": "97\n1363 1365 1366 1369 1370 1372 1379 1381 1382 1385 1386 1388 1427 1429 1430 1433 1434 1436 1443 1445 1446 1449 1450 1452 1619 1621 1622 1625 1626 1628 1635 1637 1638 1641 1642 1644 1683 1685 1686 1689 1690 1692 1699 1701 1702 1705 1706 1708 2387 2389 2390 2393 2394 2396 2403 2405 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe just discovered a new data st...
[{"type": "stdin_stdout", "input": "30\nmnidamnida\nopmnida\nadinm_masu\nus`m_masu\nuseddesu\nadinmmasu\nmnida_po\ndnmnida\nmasumnida\nusam_po\nmnidadesu\nuted_masu\nmnida_mnida\nadinm_mnida\nusammasu\nmasu_desu\nvsammnida\ngenki_desu\nmm_mnida\nadinmmnida\nop_mnida\nadinm_desu\nused_desu\nusam_desu\nadinmdesu\nsarangh...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nYou are given three strings a, b...
[{"type": "stdin_stdout", "input": "4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim\n", "output": "NO\nYES\nYES\nNO\n"}, {"type": "stdin_stdout", "input": "4\naaa\nbbb\nccc\nabc\nbca\ncca\naabb\nbbaa\nbaba\niim\nmii\niim\n", "output": "NO\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "4\naa`\ncb...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nWe guessed a permutation p consi...
[{"type": "stdin_stdout", "input": "5\n6\n3 2 5 6\n2 4 6\n3 1 3 4\n2 1 3\n4 1 2 4 6\n5\n2 2 3\n2 1 2\n2 1 4\n2 4 5\n7\n3 1 2 6\n4 1 3 5 6\n2 1 2\n3 4 5 7\n6 1 2 3 4 5 6\n3 1 3 6\n2\n2 1 2\n5\n2 2 5\n3 2 3 5\n4 2 3 4 5\n5 1 2 3 4 5\n", "output": "3 1 4 6 2 5 \n3 2 1 4 5 \n2 1 6 3 5 4 7 \n1 2 \n2 5 3 4 1 \n"}, {"type": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nZookeeper is playing a game. In ...
[{"type": "stdin_stdout", "input": "3\nAAA\nBABA\nAABBBABBBB\n", "output": "3\n2\n0\n"}, {"type": "stdin_stdout", "input": "3\nAAA\nAABA\nAABBBABBBB\n", "output": "3\n2\n0\n"}, {"type": "stdin_stdout", "input": "3\nAAB\nBABA\nAABBBABBBB\n", "output": "1\n2\n0\n"}, {"type": "stdin_stdout", "input": "3\nAAB\nBABA\nBBBBAB...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAshish has two strings a and b, ...
[{"type": "stdin_stdout", "input": "4\n3 3\nabc\nbcd\n4 2\nabba\nazza\n2 1\nzz\naa\n6 2\naaabba\nddddcc\n", "output": "\nNo\nYes\nNo\nYes\n"}, {"type": "stdin_stdout", "input": "4\n1 3\nabc\nbcd\n4 2\nabba\nazza\n2 1\nzz\naa\n6 2\naaabba\nddddcc\n", "output": "NO\nYES\nNO\nYES\n"}, {"type": "stdin_stdout", "input": "4\...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAt the school where Vasya is stu...
[{"type": "stdin_stdout", "input": "3\n12 6 4\n2 1 2 4\n1 1 2 3\n2 1 1\n1\n1\n3 15 4\n1 1 2 2\n1 2 1 2\n", "output": "4\n0\n2\n"}, {"type": "stdin_stdout", "input": "3\n12 6 4\n2 1 2 4\n1 1 3 3\n2 1 1\n1\n1\n3 15 4\n1 1 2 2\n1 2 1 2\n", "output": "3\n0\n2\n"}, {"type": "stdin_stdout", "input": "3\n12 6 4\n2 1 2 7\n1 1 ...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are n robots driving along...
[{"type": "stdin_stdout", "input": "1\n20 170\n4 6 8 9 10 13 14 16 18 20 23 28 30 32 33 38 42 43 45 46\nL L L L L L L L L L R R R L L R R L R R\n", "output": "5 5 9 11 9 11 15 15 19 19 5 137 1 1 5 137 126 169 169 126\n"}, {"type": "stdin_stdout", "input": "1\n20 170\n4 1 8 9 10 13 14 16 18 20 23 28 30 32 33 38 42 43 45...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nFibonacci strings are defined as...
[{"type": "stdin_stdout", "input": "50 100\na\na\nb\na\na\nb\nb\nb\na\na\nb\nb\na\na\na\na\nb\nb\na\nb\nb\nb\na\na\na\na\na\na\nb\nb\na\nb\na\nb\na\nb\na\nb\nb\nb\na\na\nb\na\na\na\nb\na\nb\na\na\na\nb\na\nb\na\na\nb\na\na\nb\na\na\na\na\nb\na\nb\na\nb\nb\na\nb\nb\nb\na\nb\nb\nb\nb\nb\nb\nb\nb\nb\nb\na\na\na\nb\nb\nb\n...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nEveryone knows that 2010 FIFA Wo...
[{"type": "stdin_stdout", "input": "4\nTeMnHVvWKpwlpubwyhzqvc\nAWJwc\nbhbxErlydiwtoxy\nEVASMeLpfqwjkke\nAWJwc-TeMnHVvWKpwlpubwyhzqvc 43:73\nbhbxErlydiwtoxy-TeMnHVvWKpwlpubwyhzqvc 38:99\nbhbxErlydiwtoxy-AWJwc 33:84\nEVASMeLpfqwjkke-TeMnHVvWKpwlpubwyhzqvc 79:34\nEVASMeLpfqwjkke-AWJwc 243:7\nEVASMeLpfqwjkke-bhbxErlydiwtox...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nA subsequence of length |x| of s...
[{"type": "stdin_stdout", "input": "ctkhagrifaztmnxhmqztzibnmzzkojiztvrkfeoqegvwtbxlvvjhebshqaicsovtkcdovytimjggglyxlvglgunbohnkxargymbqvzgsnvjzgxivdgnaesgxqcruaopjuqsyyorrobnelehjnxcetveehlbmeskptivsuhuqupbieumycwczxyqjtwfofehfkpqmjngygwxkaviuyouiippgvlxjgtkxmhcwtzacbllsybgiujyryngapfwjkkyapfgxtcdpc\nctkhagrifaztmnxhm...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima and his friends have been p...
[{"type": "stdin_stdout", "input": "100\n4 4 2 5 4 2 2 3 4 4 3 2 3 3 1 3 4 3 3 4 1 3 1 4 5 3 4 3 1 1 1 3 3 2 3 4 3 4 2 2 1 5 1 4 5 1 1 1 3 3 1 1 3 2 5 4 2 5 2 4 5 4 4 1 1 2 1 1 4 5 1 1 5 3 3 2 5 5 5 1 4 1 4 1 1 3 2 3 4 4 2 5 5 2 5 1 1 3 5 3\n", "output": "5\n"}, {"type": "stdin_stdout", "input": "100\n3 3 1 4 2 4 4 3 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAs a tradition, every year befor...
[{"type": "stdin_stdout", "input": "0111001111110010000001111100110100111110001100100001111111110000010010111010010010010111000110001111\n", "output": "777947548\n"}, {"type": "stdin_stdout", "input": "0110011110111000001101001010101000011011101001001101000000111101010101111101010011101001111010111001\n", "output": "41...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDima, Inna and Seryozha have gat...
[{"type": "stdin_stdout", "input": "88 10\n6 64 43 1 1 1 8 15 39 1 95 2 1 80 36 40 25 2 52 24 29 26 16 45 96 99 1 91 16 97 67 1 39 91 1 41 72 67 93 84 1 12 67 53 26 1 14 39 94 92 28 75 10 16 81 97 77 22 1 1 41 90 51 49 90 74 5 61 1 45 88 1 40 7 4 59 16 33 6 4 92 1 38 20 4 53 10 80\n70 45 1 73 52 1 20 78 68 98 1 95 2 61...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nTwo chess pieces, a rook and a k...
[{"type": "stdin_stdout", "input": "a1\nb2\n", "output": "44\n"}, {"type": "stdin_stdout", "input": "a8\nd4\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "c1\nd2\n", "output": "42\n"}, {"type": "stdin_stdout", "input": "g1\ne6\n", "output": "39\n"}, {"type": "stdin_stdout", "input": "h8\ng2\n", "output": "43...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nNot so long ago as a result of c...
[{"type": "stdin_stdout", "input": "1000 -1000\n", "output": "white\n"}, {"type": "stdin_stdout", "input": "0000 -1000\n", "output": "black\n"}, {"type": "stdin_stdout", "input": "-1059 -929\n", "output": "black\n"}, {"type": "stdin_stdout", "input": "-215 -996\n", "output": "black\n"}, {"type": "stdin_stdout", "input"...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAmr is a young coder who likes m...
[{"type": "stdin_stdout", "input": "100 10000\n100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 100 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nAndrewid the Android is a galaxy...
[{"type": "stdin_stdout", "input": "100\n15 86 17 88 19 90 21 92 23 94 25 96 27 98 29 0 31 2 33 4 35 6 37 8 39 10 41 12 43 14 45 16 47 18 49 20 51 22 53 24 55 26 57 28 59 30 61 32 63 34 65 36 67 38 69 40 71 42 73 44 75 46 77 48 79 50 81 52 83 54 85 56 87 58 89 60 91 62 93 64 95 66 97 68 99 70 1 72 3 74 5 76 7 78 9 80 1...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nStudents in a class are making t...
[{"type": "stdin_stdout", "input": "1000000 1000000\n", "output": "3000000\n"}, {"type": "stdin_stdout", "input": "1000000 999999\n", "output": "2999998\n"}, {"type": "stdin_stdout", "input": "1000000 666667\n", "output": "2500000\n"}, {"type": "stdin_stdout", "input": "999999 1000000\n", "output": "3000000\n"}, {"type...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDuring the programming classes V...
[{"type": "stdin_stdout", "input": "10\n991309218 517452607 870021923 978357992 136426010 10601767 302627526 883615372 163475700 600546765\n", "output": "991309218 517452607 870021923 517452607 136426010 136426010 978357992 302627526 870021923 "}, {"type": "stdin_stdout", "input": "10\n991309218 517452607 870021923 978...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMisha and Vanya have played seve...
[{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000\n", "output": "2"}, {"type": "stdin_stdout", "input": "2 1000000000 1000000000\n", "output": "1000000000"}, {"type": "stdin_stdout", "input": "1 1000000000 1000000000\n", "output": "2000000000"}, {"type": "stdin_stdout", "input": "999999999 1000000000...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nDo you remember a kind cartoon \...
[{"type": "stdin_stdout", "input": "08:17\n", "output": "248.5 102\n"}, {"type": "stdin_stdout", "input": "08:31\n", "output": "255.5 186\n"}, {"type": "stdin_stdout", "input": "19:55\n", "output": "237.5 330\n"}, {"type": "stdin_stdout", "input": "20:45\n", "output": "262.5 270\n"}, {"type": "stdin_stdout", "input": "...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nVasya the programmer lives in th...
[{"type": "stdin_stdout", "input": "999999 1000000\n", "output": "Equal\n"}, {"type": "stdin_stdout", "input": "999997 1000000\n", "output": "Dasha\n"}, {"type": "stdin_stdout", "input": "1000000 999993\n", "output": "Masha\n"}, {"type": "stdin_stdout", "input": "999997 1000001\n", "output": "Dasha\n"}, {"type": "stdin...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nMishka has got n empty boxes. Fo...
[{"type": "stdin_stdout", "input": "100\n981 288 186 186 292 876 341 288 663 360 783 907 292 186 341 292 360 1510 360 360 1230 398 783 288 366 398 876 981 398 907 133 360 288 981 907 186 360 288 186 981 186 288 907 876 288 907 876 360 341 292 907 694 907 783 284 981 907 292 876 398 895 876 154 341 876 33 288 186 981 34...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nConsider a system of n water tap...
[{"type": "stdin_stdout", "input": "20 30\n48 97 14 31 83 22 83 56 19 87 59 7 7 89 24 82 34 40 6 24\n10 4 47 46 11 18 32 55 16 32 53 37 43 32 41 46 57 14 60 44\n", "output": "878.2222222222222\n"}, {"type": "stdin_stdout", "input": "20 30\n48 97 14 31 83 22 83 56 19 87 59 7 7 89 24 82 34 40 6 24\n10 4 85 46 11 18 32 55...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nSaMer has written the greatest t...
[{"type": "stdin_stdout", "input": "80\n8861 -8846 -3257 8263 -8045 4549 9626 -6582 5755 -3559 5813 -7411 9151 -1847 2441 4201 2381 4651 -6571 199 -6737 -6333 -9433 -4967 9041 -9319 6801 5813 -2731 -8599 7681 -1303 -7333 6067 -1847 -6333 6047 -7907 -7333 8677 -937 829 2441 -5702 -8045 -3037 -4882 -7703 9001 -5702 -2039...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nIn one very old text file there ...
[{"type": "stdin_stdout", "input": "35 13\n", "output": "2690352397519398400\n"}, {"type": "stdin_stdout", "input": "35 1\n", "output": "3116285494907301262\n"}, {"type": "stdin_stdout", "input": "35 22\n", "output": "194766400194871296\n"}, {"type": "stdin_stdout", "input": "35 7\n", "output": "3116285483787165100\n"}...
code_stdio
[ { "content": "You are an expert Python programmer. You will be given a question (problem specification) and will generate a correct Python program that matches the specification and passes all tests.\n\nSolve the following coding problem using the programming language python:\n\nThere are N boxes .The i^th box ...
[{"type": "stdin_stdout", "input": "148\n73761 46895 80132 64100 77363 71933 148262 20265 47228 96450 44190 46966 61774 11261 4900 8339 1432 35044 30970 96225 60061 44983 46365 66010 75670 308 137 72235 2456 45330 86317 65055 82950 3531 72441 155789 95196 21416 64165 125814 24346 83918 63079 19045 55998 77371 58574 874...
code_stdio