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\nIkta loves fast programs. Recent... | [{"type": "stdin_stdout", "input": "001", "output": "2\n"}, {"type": "stdin_stdout", "input": "000", "output": "1\n"}, {"type": "stdin_stdout", "input": "178", "output": "0\n"}, {"type": "stdin_stdout", "input": "209", "output": "0\n"}, {"type": "stdin_stdout", "input": "375", "output": "0\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\nProblem\n\nYou brought a flat, h... | [{"type": "stdin_stdout", "input": "7828 5000 20 -1 1069 300", "output": "0.2806361085\n"}, {"type": "stdin_stdout", "input": "7828 10252 13 -1 292 464", "output": "1.5890410959\n"}, {"type": "stdin_stdout", "input": "7828 10252 13 -1 574 464", "output": "0.8083623693\n"}, {"type": "stdin_stdout", "input": "4997 2843 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\nYou are given a set $T$, which i... | [{"type": "stdin_stdout", "input": "4\n2 1 3", "output": "0:\n2: 1\n8: 3\n10: 1 3\n"}, {"type": "stdin_stdout", "input": "4\n2 0 3", "output": "0:\n1: 0\n8: 3\n9: 0 3\n"}, {"type": "stdin_stdout", "input": "4\n2 1 2", "output": "0:\n2: 1\n4: 2\n6: 1 2\n"}, {"type": "stdin_stdout", "input": "4\n2 0 1", "output": "0:\n1:... | 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\nTanechka is shopping in the toy ... | [{"type": "stdin_stdout", "input": "100000000000000 100000000000000\n", "output": "49999999999999\n"}, {"type": "stdin_stdout", "input": "100000000010000 100000000000000\n", "output": "49999999999999\n"}, {"type": "stdin_stdout", "input": "105925489085800 100000000001000\n", "output": "50000000000499\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\nYou are given n points on the pl... | [{"type": "stdin_stdout", "input": "20\n-2967010 48581504\n-2967318 48581765\n-2967443 48581988\n-2967541 48582265\n-2967443 48582542\n-2967318 48582765\n-2967010 48583026\n-2966691 48583154\n-2966252 48583234\n-2965813 48583154\n-2965494 48583026\n-2965186 48582765\n-2965061 48582542\n-2964963 48582265\n-2965061 48581... | 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\nSomeone give a strange birthday ... | [{"type": "stdin_stdout", "input": "33 2\n3 13\n17 3\n2 6\n5 33\n4 18\n1 2\n31 5\n4 19\n3 16\n1 3\n9 2\n10 3\n5 1\n5 28\n21 4\n7 2\n1 4\n5 24\n30 5\n14 3\n3 11\n27 5\n8 2\n22 4\n12 3\n20 4\n26 5\n4 23\n32 5\n25 5\n15 3\n29 5\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "33 2\n3 13\n17 3\n2 6\n5 33\n4 18\n1... | 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 kingdom of Lazyland is the h... | [{"type": "stdin_stdout", "input": "18 12\n6 3 6 6 6 6 6 6 6 12 1 3 6 6 10 6 6 6\n47 4 41 56 75 24 29 10 100 112 53 48 79 30 87 135 60 87\n", "output": "185\n"}, {"type": "stdin_stdout", "input": "18 12\n6 3 6 6 6 6 6 6 6 12 1 3 6 6 10 6 6 6\n47 4 41 56 75 24 29 10 100 112 53 48 79 30 87 135 10 87\n", "output": "148\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 only difference between easy... | [{"type": "stdin_stdout", "input": "50 50\n1 -9 8 -9 5 -4 -4 3 -2 -1 3 -8 -6 -6 2 -5 -1 -2 -5 10 2 0 10 10 5 -3 12 -1 -9 9 -10 4 7 0 -6 0 -1 4 8 0 -3 -8 10 10 6 6 -3 -5 -3 -8\n28 41\n28 49\n49 49\n6 38\n22 30\n50 50\n41 45\n30 32\n17 44\n24 25\n27 39\n17 39\n50 50\n10 14\n11 12\n18 28\n11 20\n36 42\n45 49\n29 36\n32 44... | 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\nPolycarp is a head of a circus t... | [{"type": "stdin_stdout", "input": "10\n0011101001\n1000101110\n", "output": "1 2 5 8 9\n"}, {"type": "stdin_stdout", "input": "10\n1111000011\n1111111100\n", "output": "1 2 3 5 6\n"}, {"type": "stdin_stdout", "input": "10\n0011101001\n1010101110\n", "output": "1 2 3 5 8 "}, {"type": "stdin_stdout", "input": "10\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\nYou are given a tree (an undirec... | [{"type": "stdin_stdout", "input": "7\n2 1 1\n3 2 0\n4 2 1\n5 2 0\n6 7 1\n7 2 1\n", "output": "34\n"}, {"type": "stdin_stdout", "input": "7\n2 1 1\n3 2 0\n4 2 1\n5 4 0\n6 7 1\n7 2 1\n", "output": "32\n"}, {"type": "stdin_stdout", "input": "7\n2 1 1\n3 2 1\n4 2 1\n5 2 0\n6 7 1\n7 2 1\n", "output": "37\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\nYou are given a connected undire... | [{"type": "stdin_stdout", "input": "28 27 378\n1 2 1000000000\n2 3 1000000000\n3 4 1000000000\n4 5 1000000000\n5 6 1000000000\n6 7 1000000000\n7 8 1000000000\n8 9 1000000000\n9 10 1000000000\n10 11 1000000000\n11 12 1000000000\n12 13 1000000000\n13 14 1000000000\n14 15 1000000000\n15 16 1000000000\n16 17 1000000000\n17... | 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\nAndrew was very excited to parti... | [{"type": "stdin_stdout", "input": "100000000\n30\n30\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "100000000\n60\n30\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "100000000\n31\n33\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "100000000\n98\n99\n", "output": "0\n"}, {"type": "stdin_s... | 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\nNew Year is coming! Vasya has pr... | [{"type": "stdin_stdout", "input": "1\n50 1\n2 1 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 100000000 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\nWu got hungry after an intense t... | [{"type": "stdin_stdout", "input": "1\n100 31\n10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 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\nOn February 14 Denis decided to ... | [{"type": "stdin_stdout", "input": "5\n8 6\n1 2 4 1 2 7 1 2\n5 3\n3 2 3 2 1\n10 8\n7 4 7 6 2 3 0 1 -1 1\n15 10\n3 14 4 8 2 1 4 5 21 2 0 4 2 1 3\n7 5\n1 2 3 4 2 6 2\n", "output": "3 2\n2 2\n4 2\n4 1\n3 3\n"}, {"type": "stdin_stdout", "input": "5\n8 6\n1 2 4 1 2 7 1 2\n5 3\n3 2 3 2 1\n10 8\n7 4 7 6 2 3 0 1 -1 1\n15 10\n3... | 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\nShubham has a binary string s. A... | [{"type": "stdin_stdout", "input": "18\n010\n100100011010\n001\n010101\n101\n1100111101101110\n101100\n0001100101001100\n111110101100\n01100\n0110111100\n110101\n10000011001010010001\n0011\n00001010110100000101\n11011101110\n011000011101000010\n1001111110001000\n", "output": "1\n4\n0\n2\n1\n4\n1\n6\n2\n1\n2\n2\n6\n0\n6... | 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 is an interactive problem.\... | [{"type": "stdin_stdout", "input": "10\n1 10 6 4 3 5 10 9 3 8 1 2 6 4 7 5 2 9 7 8\n", "output": "First\n1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 \n"}, {"type": "stdin_stdout", "input": "10\n10 1 9 8 7 2 4 5 6 3 10 1 9 8 7 2 4 5 6 3\n", "output": "First\n1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 \n"}, {"type": "stdin_s... | 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 goes to visit his classmat... | [{"type": "stdin_stdout", "input": "7\n7 3\n1 3\n18 6\n1865 4\n12 2\n2 10\n22 5\n", "output": "3\n1\n4\n467\n6\n1\n5\n"}, {"type": "stdin_stdout", "input": "7\n7 3\n1 3\n18 6\n987 4\n12 2\n2 10\n22 12\n", "output": "3\n1\n4\n248\n6\n1\n3\n"}, {"type": "stdin_stdout", "input": "7\n7 3\n1 3\n18 6\n1865 4\n12 2\n4 10\n22 ... | 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 cities in Berland. T... | [{"type": "stdin_stdout", "input": "3\n\n6 7\n1 2\n1 3\n2 5\n2 4\n5 1\n3 6\n6 2\n\n2 2\n1 2\n2 1\n\n6 8\n1 2\n1 5\n2 6\n6 1\n2 3\n3 4\n4 2\n5 4\n", "output": "\n0 0 1 2 0 1 \n0 0 \n0 0 2 1 1 0 \n"}, {"type": "stdin_stdout", "input": "3\n\n6 7\n1 2\n1 3\n2 5\n2 4\n5 1\n3 6\n6 2\n\n2 2\n1 2\n2 1\n\n6 8\n1 2\n1 5\n2 6\n6 ... | 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, consis... | [{"type": "stdin_stdout", "input": "1\n0000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "1\n0000011111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111100\n", "output": "NO\... | 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 overslept the alarm clock, ... | [{"type": "stdin_stdout", "input": "10 8 2\n0 -1 0 -1 -1 0 0 -1 -1\n-1 0 -1 0 0 -1 -1 0 -1\n-1 -1 -1 0 -1 -1 0 0 0\n0 0 0 0 -1 0 0 0 -1\n0 -1 -1 0 -1 -1 -1 0 0\n-1 -1 -1 0 -1 -2 0 -1 0\n0 0 0 0 -1 0 0 0 -1\n0 0 -1 0 -1 0 0 -1 0\n-1 0 0 0 -1 -1 -1 0 0\n-1 -1 -1 0 0 0 -1 -1 0\n", "output": "-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\nTwo players play a game. The gam... | [{"type": "stdin_stdout", "input": "100 100 1 1 100 100\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "100 100 10 10 13 14\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "000 100 1 1 100 100\n", "output": "Second\n"}, {"type": "stdin_stdout", "input": "100 32 71 12 71 22\n", "output": "Seco... | 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 Little Elephant has got a pr... | [{"type": "stdin_stdout", "input": "128\n1 2 4 6 8 17 20 20 23 33 43 49 49 49 52 73 74 75 82 84 85 87 90 91 102 103 104 105 111 111 401 142 142 152 155 160 175 176 178 181 183 184 187 188 191 193 326 202 202 214 224 225 236 239 240 243 246 247 249 249 257 257 261 264 265 271 277 281 284 284 286 289 290 296 297 303 305 ... | 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 loves lucky numbers. ... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "40744\n"}, {"type": "stdin_stdout", "input": "999999998\n", "output": "40742\n"}, {"type": "stdin_stdout", "input": "603356456\n", "output": "31623\n"}, {"type": "stdin_stdout", "input": "820040584\n", "output": "36407\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\nThis problem uses a simplified n... | [{"type": "stdin_stdout", "input": "10 14\n3 2\n7 2\n6 4\n8 1\n3 9\n5 6\n6 3\n4 1\n2 5\n7 10\n9 5\n7 1\n8 10\n3 4\n", "output": "unknown topology\n"}, {"type": "stdin_stdout", "input": "10 14\n3 2\n7 2\n6 4\n8 1\n3 9\n5 6\n6 3\n4 1\n2 1\n7 10\n9 5\n7 1\n8 10\n3 4\n", "output": "unknown topology\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\nGeorge woke up and saw the curre... | [{"type": "stdin_stdout", "input": "00:01\n00:00\n", "output": "00:01\n"}, {"type": "stdin_stdout", "input": "05:50\n05:44\n", "output": "00:06\n"}, {"type": "stdin_stdout", "input": "00:00\n01:00\n", "output": "23:00\n"}, {"type": "stdin_stdout", "input": "12:33\n23:33\n", "output": "13:00\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\nPiegirl was asked to implement t... | [{"type": "stdin_stdout", "input": "10 10\n933168403 308417110 823216696 818565876 448948583 884328249 809244579 473034231 407137956 871269623\n1302355559 145998557 644003076 138712151 839886312 479712343 709513279 138285801 858528549 643830064\n", "output": "11375801438\n"}, {"type": "stdin_stdout", "input": "10 10\n9... | 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\nImagine that you are in a buildi... | [{"type": "stdin_stdout", "input": "5000 2081 3619 5000\n", "output": "557114846\n"}, {"type": "stdin_stdout", "input": "5000 2314 1234 5000\n", "output": "546628648\n"}, {"type": "stdin_stdout", "input": "5000 1031 4782 5000\n", "output": "981271392\n"}, {"type": "stdin_stdout", "input": "5000 4998 5000 5000\n", "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\nLeonid wants to become a glass c... | [{"type": "stdin_stdout", "input": "5 30 10\nH 8\nH 9\nV 1\nH 2\nH 5\nH 3\nH 1\nV 2\nH 13\nV 3\n", "output": "110\n105\n84\n84\n84\n84\n84\n63\n51\n34\n"}, {"type": "stdin_stdout", "input": "5 15 10\nH 8\nH 9\nV 1\nH 2\nH 6\nH 4\nH 1\nV 2\nH 13\nV 3\n", "output": "40\n40\n32\n24\n24\n24\n24\n18\n12\n8\n"}, {"type": "st... | 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\nKyoya Ootori has a bag with n co... | [{"type": "stdin_stdout", "input": "47\n20\n21\n16\n18\n24\n20\n25\n13\n20\n22\n26\n24\n17\n18\n21\n22\n21\n23\n17\n15\n24\n19\n18\n21\n20\n19\n26\n25\n20\n17\n17\n17\n26\n32\n20\n21\n25\n28\n24\n21\n21\n17\n28\n20\n20\n31\n19\n", "output": "295545118\n"}, {"type": "stdin_stdout", "input": "25\n35\n43\n38\n33\n47\n44\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\nYou are given a rooted tree with... | [{"type": "stdin_stdout", "input": "15\n1 2 3 1 2 3 3 1 1 3 2 2 1 2 3\n1 2\n1 3\n1 4\n1 14\n1 15\n2 5\n2 6\n2 7\n3 8\n3 9\n3 10\n4 11\n4 12\n4 13\n", "output": "6 5 4 3 2 3 3 1 1 3 2 2 1 2 3 \n"}, {"type": "stdin_stdout", "input": "15\n1 2 3 1 2 3 3 1 1 3 2 2 1 2 3\n1 2\n1 3\n1 4\n1 14\n1 15\n2 5\n2 6\n2 7\n3 8\n3 9\n3... | 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\nBessie the cow and her best frie... | [{"type": "stdin_stdout", "input": "AB\nXC\nXB\nAC\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "XB\nAC\nBX\nAC\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "AC\nBX\nCB\nAX\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "AC\nXB\nBA\nCX\n", "output": "Yes\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\nTed has a pineapple. This pineap... | [{"type": "stdin_stdout", "input": "749399100 103031711 761562532\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "178769979 103031711 761562532\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "4363010 696782227 701145238\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "723634470 2814619 940... | 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 two strings a and ... | [{"type": "stdin_stdout", "input": "bbbbaabbababbaaaaababbaaabbbbaaabbbababbbbabaabababaabaaabbbabababbbabababaababaaaaa\nbbabaaaabaaaabbaaabbbabaaabaabbbababbbbbbbbbbabbababbaababbbaaabababaaabbbbaaababaaaaab\n", "output": "bbbbbbbabbababbaababbbaaabababaaabbbbaaababaaaaab\n"}, {"type": "stdin_stdout", "input": "bbbba... | 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 probably know, Anton goes... | [{"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 and Petya take part in a C... | [{"type": "stdin_stdout", "input": "26\n3 -1 71 -1 42\n85 72 48 38 -1\n-1 -1 66 24 -1\n46 -1 60 99 107\n53 106 51 -1 104\n-1 17 135 54 -1\n44 107 66 65 102\n47 40 62 34 5\n-1 10 -1 98 -1\n-1 69 47 85 75\n12 62 -1 15 -1\n48 63 72 32 99\n116 104 111 -1 -1\n92 -1 52 -1 11\n118 25 97 1 108\n-1 78 97 37 -1\n87 47 -1 -1 21\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\nVasily has a deck of cards consi... | [{"type": "stdin_stdout", "input": "100\n9 9 72 55 14 8 55 58 35 67 3 18 73 92 41 49 15 60 18 66 9 26 97 47 43 88 71 97 19 34 48 96 79 53 8 24 69 49 12 23 77 12 21 88 66 9 29 13 61 69 54 77 41 13 4 68 37 74 7 6 29 76 55 72 89 4 78 27 29 82 18 83 12 4 32 69 89 85 66 13 92 54 38 5 26 56 17 55 29 4 17 39 29 94 3 67 85 98 ... | 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\nOne day Alex was creating a cont... | [{"type": "stdin_stdout", "input": "____________________________________________________________________________________________________\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "__________________________________________________________________________________________________`_\n", "output": "NO\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\nYou have a fraction <image>. You... | [{"type": "stdin_stdout", "input": "99999 100000 13\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "69168 84860 4\n", "output": "107\n"}, {"type": "stdin_stdout", "input": "25102 31579 2\n", "output": "174\n"}, {"type": "stdin_stdout", "input": "13805 15538 3\n", "output": "164\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\nHacker Zhorik wants to decipher ... | [{"type": "stdin_stdout", "input": "50 50\n5733 740 547 3647 5382 5109 6842 7102 5879 1502 3574 1628 7905 4357 8569 9564 8268 3542 2487 8532 425 7713 2585 925 6458 2697 2844 69 324 9030 495 4428 6724 3524 3304 4874 1303 2098 1136 1048 2464 7316 274 9586 534 2450 2368 8060 7795 70692\n1918 4122 6806 4914 6517 6278 9842 ... | 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 busses in Berland are equipp... | [{"type": "stdin_stdout", "input": "102 1\n1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "102 1\n1 1 1 1 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\nLet's introduce a number system ... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "48999999753\n"}, {"type": "stdin_stdout", "input": "1000000100\n", "output": "49000004653\n"}, {"type": "stdin_stdout", "input": "1517731607\n", "output": "74368848496\n"}, {"type": "stdin_stdout", "input": "1000001100\n", "output": "49000053653\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\nTask is simple. You are provided... | [{"type": "stdin_stdout", "input": "4\n{ { { } .\n} { .\n{ } { } | } -\n{ } { } } .\n\nFLPMAS", "output": "1\n2\n-1\n-1\n"}, {"type": "stdin_stdout", "input": "4\n{ { { } .\n} | -\n{ } { } { } .\n{ } { } } .\n\nASMPLE", "output": "1\n-1\n0\n-1\n"}, {"type": "stdin_stdout", "input": "4\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\nThere are N integers X_1, X_2, \... | [{"type": "stdin_stdout", "input": "3\n111 110\n111 11100\n-2 1111011010", "output": "10990\n"}, {"type": "stdin_stdout", "input": "3\n011 110\n111 11100\n-2 1111011010", "output": "11090\n"}, {"type": "stdin_stdout", "input": "3\n010 110\n111 11100\n-2 1111011010", "output": "11091\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\nGiven are 1-digit positive integ... | [{"type": "stdin_stdout", "input": "96 1", "output": "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111\n"}, {"type": "stdin_stdout", "input": "10 40", "output": "10101010101010101010101010101010101010101010101010101010101010101010101010101010\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\nE869120 is initially standing at... | [{"type": "stdin_stdout", "input": "10\n1 2\n3 4\n5 6\n7 8\n9 10\n11 12\n13 14\n15 16\n17 18\n19 20", "output": "148.660687473185055226120082139313966514489855137208"}, {"type": "stdin_stdout", "input": "2\n96000 -72000\n-72000 54000", "output": "120000.000000000000000000000000000000000000000000000000"}, {"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\nThere are N integers, A_1, A_2, ... | [{"type": "stdin_stdout", "input": "2\n1000010000 1000000000", "output": "1000010000\n"}, {"type": "stdin_stdout", "input": "2\n1000000000 1000001000", "output": "1000001000\n"}, {"type": "stdin_stdout", "input": "2\n1001000000 1000001000", "output": "1001000000\n"}, {"type": "stdin_stdout", "input": "2\n1001100000 100... | 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 positive integer... | [{"type": "stdin_stdout", "input": "1074", "output": "1024\n"}, {"type": "stdin_stdout", "input": "1023", "output": "1000\n"}, {"type": "stdin_stdout", "input": "1298", "output": "1296\n"}, {"type": "stdin_stdout", "input": "1357", "output": "1331\n"}, {"type": "stdin_stdout", "input": "1746", "output": "1728\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\nConsider an infinite sequence a_... | [{"type": "stdin_stdout", "input": "5\n56 114834\n72 -134386\n100 190757\n192 -132693\n240 133108", "output": "438699\n"}, {"type": "stdin_stdout", "input": "5\n56 114834\n72 -134386\n100 190757\n192 -132693\n240 261716", "output": "567307\n"}, {"type": "stdin_stdout", "input": "5\n56 114834\n72 -149861\n100 190757\n19... | 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. Find... | [{"type": "stdin_stdout", "input": "1001", "output": "513172208\n"}, {"type": "stdin_stdout", "input": "1000", "output": "972926972"}, {"type": "stdin_stdout", "input": "108", "output": "875619122\n"}, {"type": "stdin_stdout", "input": "111", "output": "130571620\n"}, {"type": "stdin_stdout", "input": "101", "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\nCreate a program that converts t... | [{"type": "stdin_stdout", "input": "3559 9 5\n2425 12 2\n2980 9 14", "output": "heisei 1571 9 5\nheisei 437 12 2\nheisei 992 9 14\n"}, {"type": "stdin_stdout", "input": "3559 9 5\n2425 12 2\n2980 9 7", "output": "heisei 1571 9 5\nheisei 437 12 2\nheisei 992 9 7\n"}, {"type": "stdin_stdout", "input": "3080 6 3\n2027 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\nA popular game in a certain coun... | [{"type": "stdin_stdout", "input": "6 6\nS.1..4\n5..3..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0", "output": "3 12\nNA\n"}, {"type": "stdin_stdout", "input": "6 6\nS.1..4\n3..5..\n..4.1.\n4...5.\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0", "output": "2 10\nNA\n"}, {"type": "stdin_stdout", "input": "6 6\nS.1..4\n4..... | 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 Japan, temperature is usually... | [{"type": "stdin_stdout", "input": "22485", "output": "11227\n"}, {"type": "stdin_stdout", "input": "37535", "output": "18752\n"}, {"type": "stdin_stdout", "input": "54760", "output": "27365\n"}, {"type": "stdin_stdout", "input": "10347", "output": "5158\n"}, {"type": "stdin_stdout", "input": "10699", "output": "5334\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 fundamental idea in the JPEG... | [{"type": "stdin_stdout", "input": "3\n9\n0", "output": "Case 1:\n 1 2 6\n 3 5 7\n 4 8 9\nCase 2:\n 1 2 6 7 15 16 28 29 45\n 3 5 8 14 17 27 30 44 46\n 4 9 13 18 26 31 43 47 60\n 10 12 19 25 32 42 48 59 61\n 11 20 24 33 41 49 58 62 71\n 21 23 34 40 50 57 63 70 72\n 22 35 39 51 56 64 69 73 78\n 36 38 52... | 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 have a computer literacy cou... | [{"type": "stdin_stdout", "input": "6 2\n10\n775 1 1 1\n780 4 2 1\n790 2 1 1\n800 2 1 0\n810 3 1 1\n820 1 1 0\n825 3 1 0\n860 1 1 1\n870 4 2 -1\n880 1 1 0\n1\n780 870 1\n13 15\n12\n540 12 13 1\n600 12 13 0\n650 13 15 1\n660 12 15 1\n665 11 13 1\n670 13 15 0\n675 11 13 0\n680 12 15 0\n1000 11 14 1\n1060 12 14 1\n1060 11... | 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 small planet named Bandai, ... | [{"type": "stdin_stdout", "input": "10 5\nkkkkkwwwww\nw#wwwrwwww\nwwwwbgwwww\nkwwnwcwwkk\nkkwywwwkkk\nrgbcmy\n10 5\nkkkkkkkkkk\nk#kkkkkkkk\nkwkkkkkwwk\nkwwbgrymck\nkwwwwwwwwk\ncmyrgb\n10 5\nkkkkkkkkkk\nk#kkkkkkkk\nkkwkkkkkwk\nkcmyrgbwwk\nkwwwwwwwwk\ncnyrgb\n0 0", "output": "unreachable\nunreachable\nunreachable\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\n\nI chose creature obse... | [{"type": "stdin_stdout", "input": "5\n00000\n01010\n00000\n00100\n00000\n\n00000\n01010\n00000\n01010\n00000\n\n00000\n00100\n00000\n01010\n00000\n\n00000\n01110\n00000\n00100\n00000\n\n00000\n00000\n00100\n00000\n00000\n\n1 2\n2 3 4\n4\n01110\n00100\n00100\n00100\n01110\n\n01110\n10001\n10000\n10001\n01110\n\n11111\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\nMr. Bill is shopping at the stor... | [{"type": "stdin_stdout", "input": "160\n1 1 2 0\n160\n1 1 2 10\n0", "output": "10 1\n50 1\n100 1\n\n10 1\n50 1\n100 1\n"}, {"type": "stdin_stdout", "input": "160\n1 1 2 0\n160\n1 -1 1 10\n0", "output": "10 1\n50 1\n100 1\n\n10 1\n500 1\n"}, {"type": "stdin_stdout", "input": "160\n1 1 4 0\n125\n-1 1 2 10\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\nTwin adventurers Rin and Len are... | [{"type": "stdin_stdout", "input": "5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .%.\n4 1\nL.%. %..R\n0 0", "output": "Yes\nYes\nNo"}, {"type": "stdin_stdout", "input": "5 5\n%#... ...#%\n.#.#. .#.#.\n.#.#. .#.#.\n.#.#. .#.#.\n...#L R#...\n3 2\n.L. .R#\n%.. .&.\n4 1\nL.%. %..R... | 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\nSunake is in the form of a polyg... | [{"type": "stdin_stdout", "input": "11\n63 106\n87 143\n102 132\n115 169\n74 145\n41 177\n56 130\n28 102\n19 124\n0 156\n22 183", "output": "Impossible\n"}, {"type": "stdin_stdout", "input": "11\n63 106\n87 143\n102 132\n115 169\n74 145\n41 177\n56 130\n28 102\n19 124\n0 294\n22 183", "output": "Impossible\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\nJ: City\n\nSanta decides to deli... | [{"type": "stdin_stdout", "input": "2 -2 11 0", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -1 12 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "-1 2 0 14", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 -1 1 11", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 -2 11 0", "out... | 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\nGiven a permutation o... | [{"type": "stdin_stdout", "input": "0 3\n3 -1 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 2\n6 11 1", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1 2\n10 2 2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 2\n10 2 2", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "0 2\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\nWrite a program which prints the... | [{"type": "stdin_stdout", "input": "1 -2\n3 2\n-2 0", "output": "0.62500000000000000000 0.68750000000000000000 2.71353666826155124291"}, {"type": "stdin_stdout", "input": "0 3\n4 0\n0 0", "output": "2.00000000000000000000 1.50000000000000000000 2.50000000000000000000"}, {"type": "stdin_stdout", "input": "7 -3\n1 0\n-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\nFor a set $S$ of integers, perfo... | [{"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 -1\n1 20", "output": "1\n2\n3\n1\n3\n3\n0\n"}, {"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 5\n1 2\n0 -1\n1 0\n1 20", "output": "1\n2\n3\n1\n3\n0\n0\n"}, {"type": "stdin_stdout", "input": "7\n0 -1\n0 2\n0 6\n1 2\n0 -1\n0 0\n1 20", "output": "1\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\nA bracket sequence is a string c... | [{"type": "stdin_stdout", "input": "40 36\n((((((((()()()))))))))((())((()())))(())\n", "output": "((((((((()()()))))))))((())((()())))\n"}, {"type": "stdin_stdout", "input": "40 34\n((((((((()()()))))))))((())((()())))(())\n", "output": "((((((((()()()))))))))((())((())))\n"}, {"type": "stdin_stdout", "input": "40 32\... | 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 places knights on infinite ... | [{"type": "stdin_stdout", "input": "1000\n", "output": "0 0\n1 0\n0 1\n-1 0\n0 -1\n2 0\n0 2\n-2 0\n0 -2\n3 0\n0 3\n-3 0\n0 -3\n4 0\n0 4\n-4 0\n0 -4\n5 0\n0 5\n-5 0\n0 -5\n6 0\n0 6\n-6 0\n0 -6\n7 0\n0 7\n-7 0\n0 -7\n8 0\n0 8\n-8 0\n0 -8\n9 0\n0 9\n-9 0\n0 -9\n10 0\n0 10\n-10 0\n0 -10\n11 0\n0 11\n-11 0\n0 -11\n12 0\n0 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 an undirected weig... | [{"type": "stdin_stdout", "input": "8 10\n1 2 1\n2 3 2\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 1\n6 2 4\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 1\n2 3 4\n2 4 5\n1 4 2\n6 3 3\n6 1 3\n3 5 2\n3 7 1\n4 8 1\n6 2 4\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "8 10\n1 2 1\n2 3 2\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\nDora loves adventures quite a lo... | [{"type": "stdin_stdout", "input": "1 100\n197 693 757 329 311 798 783 1130 504 1051 978 358 367 467 623 767 481 154 855 608 157 104 273 261 110 713 948 897 96 476 855 337 93 321 648 441 215 979 505 69 858 99 1215 337 237 116 824 98 955 192 773 99 485 385 861 347 772 993 470 215 792 1192 986 515 84 7 476 831 903 74 79 ... | 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 permutation p of... | [{"type": "stdin_stdout", "input": "5\n4 5 1 3 2\n", "output": "2\n"}, {"type": "stdin_stdout", "input": "5\n5 4 1 3 2\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 4 2 5 1\n", "output": "1\n"}, {"type": "stdin_stdout", "input": "5\n3 4 1 5 2\n", "output": "2"}, {"type": "stdin_stdout", "input": "3\n2 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\nLet's denote a k-step ladder as ... | [{"type": "stdin_stdout", "input": "4\n4\n1 12 1 3\n3\n1 3 1\n5\n2 1 3 1 2\n3\n1 1 2\n", "output": "2\n0\n1\n0\n"}, {"type": "stdin_stdout", "input": "4\n4\n1 12 1 3\n3\n1 3 1\n5\n2 1 3 4 2\n3\n1 1 2\n", "output": "2\n0\n2\n0\n"}, {"type": "stdin_stdout", "input": "4\n4\n1 3 1 3\n3\n3 3 2\n5\n2 3 3 4 2\n3\n1 1 2\n", "o... | 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 b boys and g girls par... | [{"type": "stdin_stdout", "input": "300\n299\n300\n", "output": "300\n"}, {"type": "stdin_stdout", "input": "100\n200\n150\n", "output": "101\n"}, {"type": "stdin_stdout", "input": "299\n259\n300\n", "output": "259\n"}, {"type": "stdin_stdout", "input": "199\n199\n199\n", "output": "200\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\nYour favorite music streaming pl... | [{"type": "stdin_stdout", "input": "100\n7585 5510 1017 4329 2840 8171 5089 1873 7308 9656 6833 7578 4914 6658 4408 7122 5265 1204 9800 3150 2151 6906 6041 3973 931 7239 4421 4211 156 8655 4266 3543 9752 3117 2731 6052 8950 9391 6367 996 9973 629 9489 4912 9226 9301 5166 4889 3710 6794 618 9155 2462 1120 5499 5861 3177... | 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\nLong is a huge fan of CFC (Codef... | [{"type": "stdin_stdout", "input": "4\n3 5 3\n..R..\n...R.\n....R\n6 4 12\nR..R\nR..R\nRRRR\nRRRR\nR..R\nR..R\n5 5 4\nRRR..\nR.R..\nRRR..\nR..R.\nR.R..\n2 31 62\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\nRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\n", "output": "aaabb\ncccbb\nccccc\naaaa\nbbbb\nccdd\nhgfe\nijjj\nlllk\naaabb\nbbbbb\nbcccc\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\nSanta has to send presents to th... | [{"type": "stdin_stdout", "input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n2 1 7 3 4 5 6\n6 1\n", "output": "5\n14\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n2 1 7 3 4 5 6\n4 1\n", "output": "5\n10\n"}, {"type": "stdin_stdout", "input": "2\n3 3\n3 1 2\n3 2 1\n7 2\n4 1 7 3 2 5 4\n5 1\n", "output": "5\n12\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\nA popular reality show is recrui... | [{"type": "stdin_stdout", "input": "34 5\n2 2 5 4 3 1 3 5 3 1 3 1 3 5 5 2 1 3 3 3 1 1 1 4 5 1 3 2 5 5 2 1 2 2\n1357 797 4642 4072 3953 4020 207 344 1412 4061 400 214 708 389 567 3294 1336 3746 1513 3539 4220 4720 329 4516 1741 1744 2537 3963 4941 664 1169 4512 3358 4144\n-4668 -1085 109 -899 769 -1132 -2587 1503 760 -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\nAyush and Ashish play a game on ... | [{"type": "stdin_stdout", "input": "10\n8 2\n1 5\n7 4\n8 5\n5 6\n8 7\n2 8\n1 3\n10 5\n10 1\n4 7\n6 4\n4 3\n8 1\n1 2\n1 4\n5 1\n1 9\n2 2\n2 1\n9 3\n9 6\n1 7\n2 6\n7 3\n6 8\n1 6\n5 1\n6 4\n8 6\n3 1\n8 6\n2 4\n5 7\n8 4\n1 8\n5 6\n10 3\n5 9\n10 1\n5 10\n6 1\n4 10\n1 2\n3 7\n2 3\n10 8\n4 1\n1 4\n1 3\n2 1\n5 5\n4 5\n1 3\n1 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\nMasha has n types of tiles of si... | [{"type": "stdin_stdout", "input": "6\n3 4\n1 2\n5 6\n5 7\n7 4\n8 9\n9 8\n2 5\n1 1\n1 1\n2 2\n2 2\n1 100\n10 10\n10 10\n1 2\n4 5\n8 4\n2 2\n1 1\n1 1\n1 2\n3 4\n1 2\n1 1\n1 1\n", "output": "YES\nNO\nYES\nNO\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "6\n3 4\n0 2\n5 6\n5 7\n7 4\n8 9\n9 8\n2 5\n1 1\n1 1\n2 2\n2 2\n1... | 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 Ministry for Defense sent a ge... | [{"type": "stdin_stdout", "input": "100\n66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 55 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 66 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 ... | 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 have an array a_1, a_2, ...,... | [{"type": "stdin_stdout", "input": "15\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n3 3\n3 3 3\n", "output": "YES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\nYES\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 say you are standing on th... | [{"type": "stdin_stdout", "input": "3\n2\n13 100\n3\n4 3 1\n5\n13 4 1 1 5\n", "output": "226\n15\n25\n"}, {"type": "stdin_stdout", "input": "3\n2\n13 88\n3\n2 3 1\n5\n4 3 2 1 4\n", "output": "\n202\n13\n19\n"}, {"type": "stdin_stdout", "input": "3\n2\n13 100\n3\n2 3 0\n5\n4 3 2 1 5\n", "output": "226\n11\n19\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\nLet's call an array a consisting... | [{"type": "stdin_stdout", "input": "4\n1\n12\n13\n35\n", "output": "1\n4\n4\n6\n"}, {"type": "stdin_stdout", "input": "4\n1\n12\n11\n14\n", "output": "1\n4\n4\n4\n"}, {"type": "stdin_stdout", "input": "4\n1\n12\n22\n35\n", "output": "1\n4\n5\n6\n"}, {"type": "stdin_stdout", "input": "4\n2\n12\n11\n14\n", "output": "2\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\nYou've got a rectangular table w... | [{"type": "stdin_stdout", "input": "100 100 51\n", "output": "Second"}, {"type": "stdin_stdout", "input": "100 100 27\n", "output": "First\n"}, {"type": "stdin_stdout", "input": "100 100 46\n", "output": "First\n"}, {"type": "stdin_stdout", "input": "100 100 49\n", "output": "First"}, {"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 Little Elephant loves playin... | [{"type": "stdin_stdout", "input": "6 6\n2 1 2 3 3 10\n1 2\n2 2\n1 3\n2 4\n3 6\n2 2\n", "output": "1\n1\n2\n1\n0\n1\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 2 3 3 3\n1 2\n2 2\n1 3\n2 4\n4 6\n1 6\n", "output": "1\n0\n2\n1\n1\n3\n"}, {"type": "stdin_stdout", "input": "6 6\n1 2 2 3 3 3\n1 2\n2 2\n1 3\n4 4\n4 6\n1 ... | 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 number is called almost prime ... | [{"type": "stdin_stdout", "input": "2998\n", "output": "1375\n"}, {"type": "stdin_stdout", "input": "2999\n", "output": "1375\n"}, {"type": "stdin_stdout", "input": "2997\n", "output": "1374\n"}, {"type": "stdin_stdout", "input": "3000\n", "output": "1375\n"}, {"type": "stdin_stdout", "input": "2990\n", "output": "1370... | 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\nIahub and his friend Floyd have ... | [{"type": "stdin_stdout", "input": "1 1 1000000000 2000000000\n", "output": "1000000001\n"}, {"type": "stdin_stdout", "input": "2 1 1000000000 2000000000\n", "output": "500000001\n"}, {"type": "stdin_stdout", "input": "2 1 1000001000 2000000000\n", "output": "499999501\n"}, {"type": "stdin_stdout", "input": "555 777 66... | 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\nGeorge decided to prepare a Code... | [{"type": "stdin_stdout", "input": "29 100\n20 32 41 67 72 155 331 382 399 412 465 644 484 511 515 529 690 637 679 715 733 763 826 843 862 903 276 979 989\n15 15 15 17 18 22 19 20 21 21 22 8 25 26 26 27 28 31 32 32 37 42 38 39 39 40 41 42 43 43 35 45 46 47 49 49 50 50 50 51 52 53 53 55 56 57 24 59 59 60 60 62 62 63 63 ... | 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\nIt's that time of the year when ... | [{"type": "stdin_stdout", "input": "100 60\n34 21 39 17 48 46 23 56 46 52 50 39 55 48 54 38 32 38 24 26 44 12 28 9 25 26 10 52 42 60 41 3 16 60 44 29 27 55 19 19 19 57 45 59 29 35 5 14 50 47 57 48 16 7 12 36 58 31 37 58 30 50 19 11 10 41 59 57 49 41 33 9 12 11 53 50 60 51 21 9 44 23 1 16 4 15 17 57 15 17 46 50 18 52 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\nA triangular number is the numbe... | [{"type": "stdin_stdout", "input": "300\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "406\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "253\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "276\n", "output": "YES\n"}, {"type": "stdin_stdout", "input": "496\n", "output": "YES\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\nLet's define a forest as a non-d... | [{"type": "stdin_stdout", "input": "19\n1 13\n0 0\n1 9\n1 11\n1 11\n2 3\n2 30\n0 0\n1 5\n1 2\n0 0\n5 29\n1 6\n2 11\n0 0\n0 0\n0 0\n0 0\n2 13\n", "output": "10\n0 13\n2 9\n3 11\n4 11\n8 5\n12 6\n13 11\n5 11\n6 18\n11 18\n"}, {"type": "stdin_stdout", "input": "18\n0 0\n0 0\n2 19\n1 2\n2 29\n0 0\n1 7\n1 6\n1 12\n1 13\n0 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\nThe clique problem is one of the... | [{"type": "stdin_stdout", "input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n30 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6"}, {"type": "stdin_stdout", "input": "12\n66 4\n12 4\n60 4\n24 4\n48 4\n0 4\n36 4\n4 4\n6 4\n54 4\n42 4\n18 4\n", "output": "6"}, {"type": "stdin_stdout", "input": "12\n66 4\n12 4\n60 2\n24 4\n4... | 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 define the permutation of ... | [{"type": "stdin_stdout", "input": "50 20365011074\n", "output": "2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 38 37 40 39 42 41 44 43 46 45 48 47 50 49 "}, {"type": "stdin_stdout", "input": "50 5608642004\n", "output": "1 2 4 3 5 6 8 7 9 10 11 13 12 15 14 17 16 18 ... | 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\nIt is a balmy spring afternoon, ... | [{"type": "stdin_stdout", "input": "100000 100000\n", "output": "4999950000\n"}, {"type": "stdin_stdout", "input": "100000 40000\n", "output": "4799960000\n"}, {"type": "stdin_stdout", "input": "100000 49998\n", "output": "4999949994\n"}, {"type": "stdin_stdout", "input": "100000 49999\n", "output": "4999949999\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\nBarney is standing in a bar and ... | [{"type": "stdin_stdout", "input": "8.1089882894234341219420177467603732503076124872188628349726911362800974096687340341040683238197289136e31\n", "output": "81089882894234341219420177467603.732503076124872188628349726911362800974096687340341040683238197289136\n"}, {"type": "stdin_stdout", "input": "2.062909480759549113... | 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\nCowboy Beblop is a funny little ... | [{"type": "stdin_stdout", "input": "16\n0 1000 0\n436 1013 0\n509 517 0\n1000 500 0\n1000 1000 0\n1401 1028 0\n1434 461 0\n2086 442 0\n2079 1044 0\n2506 1032 0\n2549 450 0\n3077 446 0\n3063 1067 0\n3715 1062 0\n3756 -125 0\n0 0 0\n16\n-243 700 394\n109 700 365\n129 700 -366\n763 700 -366\n725 700 397\n1131 700 409\n117... | 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 rectangular tabl... | [{"type": "stdin_stdout", "input": "10\n1086100980 -928074266 -409520915 770775361 240764400 108297300 -280070452 588179696 -920283246 736937716\n422602209 -940948979 -483879926 -525886137 -79749893 -958247281 844561102 553768085 269384580 -975129348\n-485518332 -130037110 493465239 494308146 958976404 706037260 154106... | 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\nSmith wakes up at the side of a ... | [{"type": "stdin_stdout", "input": "15 6\naaa\naaabbb\naaabb\naaaaa\naaaaaa\naaaa\naaabbbb\naaaaa\naaaaaa\naaaa\naaabbbb\naabbbb\naa\naa\naab\na\n?a?\n??\n?aa?bb?\n?aa?aa?\n??aaa?\n", "output": "0\n4\n2\n5\n6\n7\n"}, {"type": "stdin_stdout", "input": "15 6\naaa\naaabbb\naaabb\naaaaa\naaaaaa\naaaa\naaabbbb\naaaaa\naaaaa... | 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\nOne day Nikita found the string ... | [{"type": "stdin_stdout", "input": "bbabbbbbaaba\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "bbbbbbabaaaa\n", "output": "11\n"}, {"type": "stdin_stdout", "input": "bbabbbbabbbb\n", "output": "10\n"}, {"type": "stdin_stdout", "input": "baabbbbbaaba\n", "output": "10\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\nYou are given a permutation p of... | [{"type": "stdin_stdout", "input": "92\n42 64 33 89 57 9 24 44 87 67 92 84 39 88 26 27 85 62 22 83 23 71 14 13 73 79 15 49 2 12 76 53 81 40 31 3 72 58 1 61 7 82 20 54 46 77 11 16 28 48 6 45 36 43 60 38 18 4 32 74 10 91 19 86 75 51 50 52 78 25 65 8 55 30 90 69 59 63 56 80 29 68 70 17 35 41 37 47 66 34 5 21\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\nOleg writes down the history of ... | [{"type": "stdin_stdout", "input": "01010101010101010101010101010101010101000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010\n", "output": "5\n39 1 2 3 4 5 6 7 8 9... | 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 BerSoft n programmers work, t... | [{"type": "stdin_stdout", "input": "10 35\n322022227 751269818 629795150 369443545 344607287 250044294 476897672 184054549 986884572 917181121\n6 3\n7 3\n1 9\n7 9\n10 7\n3 4\n8 6\n7 4\n6 10\n7 2\n3 5\n6 9\n3 10\n8 7\n6 5\n8 1\n8 5\n1 7\n8 10\n8 2\n1 5\n10 4\n6 7\n4 6\n2 6\n5 4\n9 10\n9 2\n4 8\n5 9\n4 1\n3 2\n2 1\n4 2\n... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.