messages listlengths 1 1 | ground_truth stringlengths 156 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\nMath hasn't always been your best subject, and these programming symbols always trip you up!\n\nI mean, does ... | [{"input": "\"8 != 5\"", "output": "[\"Eight Does Not Equal Five\"]", "fn_name": "expression_out"}, {"input": "\"6 ** 9\"", "output": "[\"Six To The Power Of Nine\"]", "fn_name": "expression_out"}, {"input": "\"2 / 2\"", "output": "[\"Two Divided By Two\"]", "fn_name": "expression_out"}, {"input": "\"5 = 5\"", "output"... | code_functional |
[
{
"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\nWe have a string of letters 'a' and 'b'. We want to perform some operations on it. On each step we choose one... | [{"input": "abaaaaaabaaaabbabbaaabbbbabababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabaababbabababbabbbbaabbaabbabbbabaabbaabbaaaaaab\n", "output": "235606597\n"}, {"input": "abaaaaaabaaaabbabbaaabbbbabababaaaaabbaabbaaaaabbbaababaaaaaaabbbbbaaaaabaababbabababbabbbbaabbaabbabbbabaabbaabbaaaaaab\n", "output": "235606597\... | 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\nThere is a $n \\times m$ grid. You are standing at cell $(1, 1)$ and your goal is to finish at cell $(n, m)$.... | [{"input": "9\n1 1 0\n2 2 4\n2 2 3\n2 2 -2\n1 1 1\n100 100 11000\n2 3 7\n3 1 9\n2 6 11\n", "output": "YES\nNO\nYES\nNO\nNO\nNO\nNO\nNO\nYES\n"}, {"input": "9\n1 1 0\n2 2 4\n2 2 3\n2 2 -1\n2 1 1\n100 100 10000\n2 4 7\n3 1 9\n2 6 8\n", "output": "YES\nNO\nYES\nNO\nYES\nNO\nYES\nNO\nNO\n"}, {"input": "9\n1 1 0\n2 1 4\n2 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\nA frog lives on the axis Ox and needs to reach home which is in the point n. She starts from the point 1. The... | [{"input": "100 11\n1000010100011100011011100000010011001111011110100100001011010100011011111001101101110110010110001101\n", "output": "10\n"}, {"input": "100 10\n1110110000000110000000101110100000111000001011100000100110010001110111001010101000011000000001011011\n", "output": "12\n"}, {"input": "100 11\n10000000001000... | 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\nSum all the numbers of the array (in F# and Haskell you get a list) except the highest and the lowest element... | [{"input": "[-6, -20, -1, -10, -12]", "output": "[-28]", "fn_name": "sum_array"}, {"input": "[-6, 20, -1, 10, -12]", "output": "[3]", "fn_name": "sum_array"}, {"input": "[6, 0, 1, 10, 10]", "output": "[17]", "fn_name": "sum_array"}, {"input": "[6, 2, 1, 8, 10]", "output": "[16]", "fn_name": "sum_array"}, {"input": "[-3... | code_functional |
[
{
"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\nBees Alice and Alesya gave beekeeper Polina famous card game \"Set\" as a Christmas present. The deck consist... | [{"input": "24 4\nSETS\nETES\nSSST\nESTE\nTSES\nSSES\nTESS\nSEEE\nETEE\nETSS\nSSEE\nESTT\nSTSS\nTTTT\nTEEE\nTSEE\nESET\nTTTE\nETTT\nSTEE\nSTTE\nESSS\nTEET\nTETE\n", "output": "31\n"}, {"input": "24 4\nSETS\nETES\nSSST\nESTE\nTSES\nSSES\nTESS\nEESE\nETEE\nETSS\nSSEE\nESTT\nSTSS\nTTTT\nTEEE\nTSEE\nESET\nTTTE\nETTT\nSTEE\... | 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\nThere are N people standing on the x-axis. Let the coordinate of Person i be x_i. For every i, x_i is an inte... | [{"input": "10 0\n12 2 100\n7 18 010\n10 12 100", "output": "Yes\n"}, {"input": "10 0\n12 2 100\n7 18 011\n10 12 100", "output": "Yes\n"}, {"input": "10 0\n12 2 100\n7 18 011\n10 22 100", "output": "Yes\n"}, {"input": "10 0\n12 2 110\n7 18 011\n10 22 100", "output": "Yes\n"}, {"input": "10 0\n12 2 000\n11 13 100\n12 8 ... | 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\n*** No Loops Allowed ***\n\nYou will be given an array (a) and a value (x). All you need to do is check wheth... | [{"input": "[66, \"codewars\", 11, \"alex loves pushups\"]\n\"alex loves pushups\"", "output": "[true]", "fn_name": "check"}, {"input": "[\"when's\", \"the\", \"next\", \"Katathon?\", 9, 7]\n\"Katathon?\"", "output": "[true]", "fn_name": "check"}, {"input": "[8, 7, 5, \"bored\", \"of\", \"writing\", \"tests\", 115]\n45... | code_functional |
[
{
"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\nYou've got a list of program warning logs. Each record of a log stream is a string in this format: \"2012-MM... | [{"input": "60 3\n2012-03-16 16:15:25: Disk size is\n2012-03-16 16:15:25: Network failute\n2012-03-16 16:16:29: Cant write varlog\n2012-03-16 16:16:42: Unable to start process\n2012-03-16 16:16:43: Disk size is too small\n2012-03-16 16:16:53: Timeout detected\n", "output": "2012-03-16 16:16:43\n"}, {"input": "60 3\n201... | 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\nCalculate the trace of a square matrix. A square matrix has `n` rows and `n` columns, where `n` is any intege... | [{"input": "[[1, 2, 3], [4, 5, 6], [7, 8, 9]]", "output": "[15]", "fn_name": "trace"}, {"input": "[[1, 0, 0], [0, 1, 0], [0, 0, -2]]", "output": "[0]", "fn_name": "trace"}, {"input": "[[0, 0, 0], [0, 0, 0], [0, 0, 0]]", "output": "[0]", "fn_name": "trace"}, {"input": "[[1, 2], [1, 2], [1, 2]]", "output": "[null]", "fn_... | code_functional |
[
{
"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\nThere are N towns in JOI, which are connected by M bidirectional roads. There are shopping malls in K towns, ... | [{"input": "10 3 1\n1 2 5\n3 3 2\n3 1 1\n2", "output": "7\n"}, {"input": "11 3 1\n1 1 1\n2 3 0\n3 1 1\n1", "output": "1\n"}, {"input": "10 3 1\n1 2 2\n2 3 2\n3 1 1\n1", "output": "3\n"}, {"input": "10 3 1\n1 2 2\n2 3 2\n2 1 1\n1", "output": "3\n"}, {"input": "10 3 1\n1 2 3\n2 3 2\n3 1 1\n1", "output": "3\n"}, {"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\nIf the strings are consecutive, you can replace the characters with a rule to shorten the string. For example... | [{"input": "ab@5C1@8050\n@99,1=1@90", "output": "abCCCCC10000000050\n999999999,1=1000000000"}, {"input": "ab@5C2@8050\n@99,1=1@90", "output": "abCCCCC20000000050\n999999999,1=1000000000"}, {"input": "ab@5C1@8050\n@99+1<1@90", "output": "abCCCCC10000000050\n999999999+1<1000000000"}, {"input": "ab@5C1@8050\n@99,1=1@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\nFacetook is a well known social network website, and it will launch a new feature called Facetook Priority Wa... | [{"input": "kmircqsffq\n14\nfrnf likes xgmmp's post\nfnfdpupayp commented on syz's post\nxefshpn commented on xgmmp's post\nm posted on gdwydzktok's wall\neskm likes pqmbnuc's post\npnqiapduhz likes zzqvjdz's post\nx likes nouuurc's post\nvnyxhoukuo posted on uhblapjab's wall\nblpjpxn likes zvwbger's post\nj posted on ... | 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\nMike has a frog and a flower. His frog is named Xaniar and his flower is named Abol. Initially(at time 0), he... | [{"input": "999983\n651224 992349\n803017 393514\n258455 402487\n888310 244420\n", "output": "126531\n"}, {"input": "999983\n651224 992349\n803017 393514\n258455 402487\n888310 244420\n", "output": "126531\n"}, {"input": "1000000\n220036 846131\n698020 485511\n656298 242999\n766802 905433\n", "output": "5297\n"}, {"inp... | 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\nYou are given two non-negative integers L and R.\nWe will choose two integers i and j such that L \\leq i < j... | [{"input": "1999999216 1999999234\n", "output": "650\n"}, {"input": "1999999264 1999999270\n", "output": "26\n"}, {"input": "1999999266 1999999276\n", "output": "18\n"}, {"input": "1999997173 1999999190\n", "output": "0\n"}, {"input": "1999999262 1999999281\n", "output": "2\n"}, {"input": "1999999218 1999999237\n", "ou... | 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\nAdvanced Creative Mobile (ACM) has decided to develop a GUI application to be installed in a new portable com... | [{"input": "5\n<main>10,10,190,150<menu>20,20,70,140</menu><primary>80,20,180,140</primary></main>\n9 10\n0 17\n40 190\n2 3\n130 80\n0", "output": "OUT OF MAIN PANEL 1\nOUT OF MAIN PANEL 1\nOUT OF MAIN PANEL 1\nOUT OF MAIN PANEL 1\nprimary 0\n"}, {"input": "5\n<main>10,10,190,150<menu>20,20,70,140</menu><primary>80,20,... | 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\nA total of n depots are located on a number line. Depot i lies at the point x_i for 1 ≤ i ≤ n.\n\nYou are a s... | [{"input": "4\n5 1\n1 2 3 4 5\n9 1\n-5 -10 -15 6 7 8 3 14 7\n5 1\n2 3 3 5 3\n4 5\n1000000000 1000000000 1000000010 1010010000\n", "output": "25\n135\n27\n1010010000\n"}, {"input": "4\n5 1\n0 2 3 4 5\n9 1\n-5 -10 -15 6 7 8 3 14 7\n5 1\n2 3 3 5 3\n4 5\n1000000000 1000000001 1000000010 1010010000\n", "output": "23\n135\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\nSnuke has an empty sequence a.\n\nHe will perform N operations on this sequence.\n\nIn the i-th operation, he... | [{"input": "9\n1 1 1 1 2 1 2 3 2", "output": "1\n2\n2\n3\n1\n2\n1\n1\n1\n"}, {"input": "9\n1 1 1 2 1 1 2 3 2", "output": "1\n2\n2\n3\n1\n1\n2\n1\n1\n"}, {"input": "9\n1 1 1 1 2 1 4 3 2", "output": "1\n2\n1\n3\n2\n4\n1\n1\n1\n"}, {"input": "9\n1 1 1 2 2 1 4 3 2", "output": "1\n2\n1\n3\n2\n4\n2\n1\n1\n"}, {"input": "9\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\nHeidi found out that the Daleks have created a network of bidirectional Time Corridors connecting different d... | [{"input": "10 26\n9 5 277429172\n10 8 789225932\n5 2 992601916\n9 8 277294258\n8 6 245446241\n9 2 378979732\n7 1 895407000\n10 6 699661758\n1 9 865851152\n2 8 397672809\n7 10 756200111\n8 3 431547893\n5 6 465205287\n7 4 957301499\n3 4 308491540\n3 7 258504473\n10 5 282875145\n1 8 262659451\n5 4 981921705\n2 4 16048245... | 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\nOnce upon a time in the thicket of the mushroom forest lived mushroom gnomes. They were famous among their ne... | [{"input": "62 47 14 888621154\n202 268 300 401 422 660 782 822 1164 1300 1571 1670 1713 1807 2677 2700 2747 2873 2956 3068 3798 4159 4221 4232 4485 4507 4803 5071 5161 5161 5595 5600 5623 5846 5867 5949 6140 6560 6727 6781 6873 7159 7218 7232 7241 7333 7369 7415 7486 7506 7538 7681 7781 8074 8783 8861 9208 9313 9339 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\nIn this Kata, you will be given two numbers, `a` and `b`, and your task is to determine if the first number `... | [{"input": "1000013\n7187762", "output": "[false]", "fn_name": "solve"}, {"input": "1000013\n7187761", "output": "[true]", "fn_name": "solve"}, {"input": "21\n2893406", "output": "[false]", "fn_name": "solve"}, {"input": "54\n2834359", "output": "[false]", "fn_name": "solve"}, {"input": "21\n2893401", "output": "[true]... | code_functional |
[
{
"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\nA team of three programmers is going to play a contest. The contest consists of $n$ problems, numbered from $... | [{"input": "11 7 9\n4 8 9 12 14 16 19 21 22 23 27\n1 2 3 11 17 18 26\n5 6 7 10 13 15 20 24 25\n", "output": "15\n"}, {"input": "11 7 9\n4 8 9 12 14 16 19 21 22 23 27\n1 2 3 11 17 18 26\n5 6 7 10 13 15 20 24 25\n", "output": "15"}, {"input": "5 10 6\n14 3 6 12 21\n7 1 5 8 10 11 13 17 18 20\n9 2 4 15 16 19\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\nMahmoud has n line segments, the i-th of them has length a_{i}. Ehab challenged him to use exactly 3 line seg... | [{"input": "40\n740553458 532562042 138583675 75471987 487348843 476240280 972115023 103690894 546736371 1412788259 35356828 819948191 138721993 24257926 761587264 767176616 608310208 78275645 386063134 227581756 672567198 177797611 87579917 941781518 274774331 843623616 981221615 630282032 118843963 749160513 35413486... | 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\nYou are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords),... | [{"input": "2 1000000000\n1 1\n1 00000000\n0 30000000\n2 164820504", "output": "1000000000\n"}, {"input": "4 1000000000\n1 1\n1 10000000\n1 30000000\n1 99999999\n", "output": "860000004\n"}, {"input": "4 1000000000\n1 1\n1 00000000\n1 30000000\n1 164820504", "output": "805179498\n"}, {"input": "4 1000000000\n1 1\n1 000... | 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\nThe king Copa often has been reported about the Codeforces site, which is rapidly getting more and more popul... | [{"input": "02.05.90\n08.03.50\n", "output": "YES\n"}, {"input": "29.02.80\n29.02.60\n", "output": "YES\n"}, {"input": "15.12.62\n17.12.21\n", "output": "YES\n"}, {"input": "08.07.20\n27.01.01\n", "output": "YES\n"}, {"input": "28.02.20\n11.01.29\n", "output": "YES\n"}, {"input": "06.08.91\n05.12.73\n", "output": "YES\... | 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\nAlice got tired of playing the tag game by the usual rules so she offered Bob a little modification to it. No... | [{"input": "34 33\n2 1\n3 2\n4 3\n5 2\n6 3\n7 2\n8 1\n9 7\n10 12\n11 7\n12 7\n13 8\n14 2\n15 10\n16 1\n17 2\n18 14\n19 1\n20 2\n21 16\n22 21\n23 1\n24 6\n25 2\n26 20\n27 5\n28 20\n29 2\n30 10\n31 14\n32 12\n33 15\n34 8\n", "output": "12\n"}, {"input": "34 33\n2 1\n3 2\n4 3\n5 2\n6 3\n7 2\n8 1\n9 7\n10 8\n11 7\n12 10\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\nproblem\n\nYou are looking for a constellation in a picture of the starry sky. The photo always contains exac... | [{"input": "5\n8 5\n6 4\n4 3\n7 10\n0 10\n10\n10 5\n2 7\n9 7\n8 10\n10 2\n1 2\n8 1\n6 7\n6 0\n0 0\n5\n904207 809784\n845370 244806\n499091 59863\n638406 182509\n435076 362268\n10\n757559 866424\n114810 239537\n519926 989458\n461089 424480\n674361 448440\n81851 150384\n459107 795405\n299682 6700\n254125 362183\n50795 54... | 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\nPolycarp has created his own training plan to prepare for the programming contests. He will train for $n$ day... | [{"input": "69\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\n", "output": "35\n"}, {"input": "69\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 ... | 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\nA flow network is a directed graph which has a $source$ and a $sink$. In a flow network, each edge $(u, v)$ h... | [{"input": "6 2\n0 1 0\n0 2 1\n1 2 1\n1 3 1\n3 3 10", "output": "0\n"}, {"input": "6 2\n0 1 0\n0 2 1\n1 2 1\n1 0 1\n3 3 10", "output": "0\n"}, {"input": "6 2\n0 1 0\n0 2 1\n1 2 1\n1 0 1\n3 3 20", "output": "0\n"}, {"input": "6 2\n0 1 0\n0 2 1\n1 2 1\n1 0 1\n3 5 20", "output": "0\n"}, {"input": "6 2\n1 1 0\n0 2 1\n1 2 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\nEmuskald is a well-known illusionist. One of his trademark tricks involves a set of magical boxes. The essenc... | [{"input": "15\n999999986 268435456\n999999987 67108864\n999999988 16777216\n999999989 4194304\n999999990 1048576\n999999991 262144\n999999992 65536\n999999993 16384\n999999994 4096\n999999995 1024\n999999996 256\n999999997 64\n999999998 16\n999999999 4\n1000000000 1\n", "output": "1000000001\n"}, {"input": "15\n999999... | 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\nVasya decided to write an anonymous letter cutting the letters out of a newspaper heading. He knows heading s... | [{"input": "kKhuIwRPLCwPFfcnsyCfBdnsraGeOCcLTfXuGjqFSGPSAeDZJSS bXKFanNqWjpFnvRpWxHJspvisDlADJBioxXNbVoXeUedoPcNEpUyEeYxdJXhGzFAmpAiHotSVwbZQsuWjIVhVaEGgqbZHIoDpiEmjTtFylCwCkWWzUOoUfOHxEZvDwNpXhBWamHn\nK VpJjGhNbwCRhcfmNGVjewBFpEmPlIKeTuWiukDtEWpjgqciqglkyNfWrBLbGAKvlNWxaUelJmSlSoakSpRzePvJsshOsTYrMPXdxKpaShjyVIXGhRIAd... | 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\nA programming contest will be held at White Tiger University this year as well. There are several questions i... | [{"input": "7\n-1 -1 19 1 0 4 -2", "output": "2\n"}, {"input": "7\n-1 -1 19 2 0 4 -2", "output": "2\n"}, {"input": "7\n-1 1 19 2 2 4 -1", "output": "2\n"}, {"input": "7\n-1 1 19 2 3 4 -1", "output": "3\n"}, {"input": "7\n-2 1 19 2 3 4 -1", "output": "3\n"}, {"input": "7\n-2 1 19 3 3 4 -1", "output": "3\n"}, {"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\nFind the sum of the weights of edges of the Minimum-Cost Arborescence with the root r for a given weighted di... | [{"input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 3 2\n4 1 3\n4 2 2\n1 3 10\n0 5 3", "output": "32\n"}, {"input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 3 2\n4 1 3\n4 2 2\n1 3 0\n0 5 3", "output": "30\n"}, {"input": "6 10 0\n0 2 14\n0 0 1\n0 3 5\n1 4 7\n2 1 6\n1 2 2\n4 1 3\n4 2 2\n1 3 1\n0 5 3", "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\nCreate a function that takes in the sum and age difference of two people, calculates their individual ages, a... | [{"input": "63\n14", "output": "[[38.5, 24.5]]", "fn_name": "get_ages"}, {"input": "70\n10", "output": "[[40, 30]]", "fn_name": "get_ages"}, {"input": "24\n4", "output": "[[14, 10]]", "fn_name": "get_ages"}, {"input": "30\n6", "output": "[[18, 12]]", "fn_name": "get_ages"}, {"input": "80\n80", "output": "[[80, 0]]", "f... | code_functional |
[
{
"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\nYou've got an array a, consisting of n integers. The array elements are indexed from 1 to n. Let's determine ... | [{"input": "42 42\n42 42 42 42 42 42 42 42 42 42 24 42 42 42 42 42 42 42 42 42 42 42 42 42 42 42 14 17 42 10 42 42 42 42 42 42 42 42 42 42 42 42\n", "output": "42 1806 39732 595980 6853770 64425438 515403504 607824507 548903146 777117811 441012574 397605357 289211244 684954865 738091104 190263863 460871887 121426337 37... | 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\nYou need to play around with the provided string (s).\n\nMove consonants forward 9 places through the alphabe... | [{"input": "\"returnofthespacecamel\"", "output": "[\"aatpawnftqabyvbabvvau\"]", "fn_name": "vowel_back"}, {"input": "\"bringonthebootcamp\"", "output": "[\"kaiwpnwtqaknntbvvy\"]", "fn_name": "vowel_back"}, {"input": "\"weneedanofficedog\"", "output": "[\"fawaaavwnffibaanp\"]", "fn_name": "vowel_back"}, {"input": "\"ex... | code_functional |
[
{
"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\nFind the difference of two sets $A = \\\\{a_0, a_1, ..., a_{n-1}\\\\}$ and $B = \\\\{b_0, b_1, ..., b_{m-1}\\... | [{"input": "5\n-1 2 4 13 17\n1\n-2 2", "output": "-1\n2\n4\n13\n17\n"}, {"input": "5\n-1 2 4 13 25\n1\n-2 1", "output": "-1\n2\n4\n13\n25\n"}, {"input": "5\n-2 2 3 9 14\n0\n-1 28", "output": "-2\n2\n3\n9\n14\n"}, {"input": "5\n-2 2 4 9 14\n0\n-1 28", "output": "-2\n2\n4\n9\n14\n"}, {"input": "5\n-1 2 3 5 27\n0\n0 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\nWelcome! Everything is fine.\n\nYou have arrived in The Medium Place, the place between The Good Place and Th... | [{"input": "2\n3\n1 2 3\n3 2 4\n2 4 3\n4 5 6\n5 6 5\n2\n1 2 1\n1 3 2\n1 4 3\n", "output": "15 33\n6 6\n"}, {"input": "2\n3\n1 2 0\n3 2 4\n2 4 3\n4 5 6\n5 6 5\n2\n1 2 1\n1 3 2\n1 4 3\n", "output": "12 30\n6 6\n"}, {"input": "2\n3\n1 2 0\n3 1 4\n2 4 3\n4 5 6\n5 6 5\n2\n1 2 1\n1 3 2\n1 4 2\n", "output": "12 30\n5 5\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\nAlice and Bob are decorating a Christmas Tree. \n\nAlice wants only $3$ types of ornaments to be used on the ... | [{"input": "100 100 100\n", "output": "297\n"}, {"input": "156 101 100\n", "output": "297\n"}, {"input": "156 111 100\n", "output": "297\n"}, {"input": "100 100 100\n", "output": "297"}, {"input": "99 100 100\n", "output": "297\n"}, {"input": "99 101 100\n", "output": "297\n"}, {"input": "65 122 115\n", "output": "198\... | 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\nNew Year is coming and you are excited to know how many minutes remain before the New Year. You know that cur... | [{"input": "5\n3 55\n22 30\n21 10\n20 21\n19 59\n", "output": "1205\n90\n170\n219\n241\n"}, {"input": "5\n4 55\n22 30\n21 10\n20 21\n19 59\n", "output": "1145\n90\n170\n219\n241\n"}, {"input": "5\n15 14\n22 45\n21 2\n0 21\n19 59\n", "output": "526\n75\n178\n1419\n241\n"}, {"input": "5\n14 14\n22 45\n21 2\n0 21\n19 59\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\nYou are given a rooted tree. Each vertex contains a_i tons of gold, which costs c_i per one ton. Initially, t... | [{"input": "5 5 2\n2 0 2\n1 0 3 4\n2 2 4\n1 0 1 3\n2 4 2\n", "output": "\n2 4\n4 10\n1 3\n"}, {"input": "5 5 2\n2 0 2\n1 0 1 4\n2 2 4\n1 0 1 3\n2 4 2\n", "output": "2 4\n4 10\n1 3\n"}, {"input": "5 10 2\n2 0 2\n1 0 3 4\n2 2 4\n1 0 1 3\n2 4 2\n", "output": "2 4\n4 8\n2 4\n"}, {"input": "5 3 2\n2 0 2\n1 0 3 4\n2 2 4\n1 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\nBajtek, known for his unusual gifts, recently got an integer array $x_0, x_1, \\ldots, x_{k-1}$.\n\nUnfortuna... | [{"input": "100\n57 81 176 211 251 311 346 404 469 506 563 587 682 717 757 817 852 910 975 1012 1069 1093 1188 1223 1263 1323 1358 1416 1481 1518 1575 1599 1694 1729 1769 1829 1864 1922 1987 2024 2081 2105 2200 2235 2275 2335 2370 2428 2493 2530 2587 2611 2706 2741 2781 2841 2876 2934 2999 3036 3093 3117 3212 3247 3287... | 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\nYou are given an integer array $a$ of length $n$.\n\nDoes there exist an array $b$ consisting of $n+1$ positi... | [{"input": "3\n7\n48 27 99 27 93 72 2\n5\n86 73 29 1 37\n9\n45 59 22 6 75 4 14 57 23\n", "output": "NO\nYES\nNO\n"}, {"input": "4\n1\n343\n2\n4 2\n3\n4 2 4\n4\n1 1 1 1\n", "output": "YES\nYES\nNO\nYES\n"}, {"input": "1\n8\n157 5487 4421 1774 4662 5343 1366 5393\n", "output": "NO\n"}, {"input": "1\n3\n101 1 101\n", "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\nYou are given two integers $n$ and $k$.\n\nYour task is to construct such a string $s$ of length $n$ that for... | [{"input": "66\n1 1\n1 1\n2 1\n1 1\n1 1\n1 1\n1 1\n2 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n2 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n2 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\n1 1\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\nConsider the sequence `a(1) = 7, a(n) = a(n-1) + gcd(n, a(n-1)) for n >= 2`: \n\n`7, 8, 9, 10, 15, 18, 19, 20... | [{"input": "100000", "output": "[99955]", "fn_name": "count_ones"}, {"input": "10000", "output": "[9968]", "fn_name": "count_ones"}, {"input": "1000", "output": "[975]", "fn_name": "count_ones"}, {"input": "200", "output": "[184]", "fn_name": "count_ones"}, {"input": "100", "output": "[90]", "fn_name": "count_ones"}, {... | code_functional |
[
{
"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\nThis is a simplified version of the task Toy Train. These two versions differ only in the constraints. Hacks ... | [{"input": "100 50\n29 35\n10 75\n29 34\n10 87\n29 13\n29 38\n41 21\n10 6\n29 94\n10 47\n31 27\n41 24\n41 8\n10 93\n41 52\n41 36\n31 32\n85 81\n31 32\n41 79\n41 99\n85 88\n41 25\n31 68\n41 93\n10 87\n85 97\n41 85\n10 64\n10 68\n85 22\n10 45\n85 15\n10 16\n10 21\n41 66\n29 68\n41 96\n29 34\n10 22\n41 72\n85 54\n29 48\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\n### Longest Palindrome\n\nFind the length of the longest substring in the given string `s` that is the same i... | [{"input": "\"FourscoreandsevenyearsagoourfaathersbroughtforthonthiscontainentanewnationconceivedinzLibertyanddedicatedtothepropositionthatallmenarecreatedequalNowweareengagedinagreahtcivilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometode... | code_functional |
[
{
"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\nYou have a string of decimal digits s. Let's define bij = si·sj. Find in matrix b the number of such rectangl... | [{"input": "700\n100101011011001100111101100101000100000000011001111000111110001011011100010110000000000100100000001100000011110011101110011101101110111011011100001001101011000100000000000110001000101001100011111110011010101011010100010100001011011111001011000101001101000111010100110000100100110011111100010111100010000... | 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\nLet us denote by f(x, m) the remainder of the Euclidean division of x by m.\nLet A be the sequence that is de... | [{"input": "10000000000 99201 99975\n", "output": "992010000000000\n"}, {"input": "9999999995 82382 99996\n", "output": "309280000028478\n"}, {"input": "9999999997 38566 99996\n", "output": "309280000067758\n"}, {"input": "9999999999 91639 99996\n", "output": "463120000035189\n"}, {"input": "8376384666 27793 31932\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\nA string $s$ of length $n$ can be encrypted by the following algorithm: iterate over all divisors of $n$ in ... | [{"input": "100\nedykhvzcntljuuoqghptioetqnfllwekzohiuaxelgecabvsbibgqodqxvyfkbyjwtgbyhvssntinkwsinwsmalusiwnjmtcoovf\n", "output": "fvooctmjnwisulamswniswknitnssvhybgtwjybkfyvxqdoqgbqteoitnczvkyedhljuuoqghptnfllwekzohiuaxelgecabvsbi\n"}, {"input": "100\nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo... | 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\nChef Palin, as his name suggests, is always very interested in palindromic strings. Recently, he made a prett... | [{"input": "3\nlatbcdkfy\nfeicedocljbux\naaaaaaba", "output": "luckykcul 8\nfluckyoykculf 10\nunlucky\n"}, {"input": "3\nytkdadfbl\ntobjlcedechwf\naabaaaba", "output": "luckykcul 8\nfluckyeykculf 10\nunlucky\n"}, {"input": "3\nytkdadfbl\ntobjlcfdechwf\naabaaaba", "output": "luckykcul 8\nfluckyfykculf 10\nunlucky\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\nWilliam has an array of $n$ integers $a_1, a_2, \\dots, a_n$. In one move he can swap two neighboring items. ... | [{"input": "5\n3\n2 4 6\n5\n4 4 4 4 4\n5\n1 3 5 10 12\n5\n1 1 1 1 1\n5\n4 8 10 6 2\n", "output": "-1\n-1\n3\n-1\n-1\n"}, {"input": "5\n3\n2 4 12\n5\n4 4 4 4 4\n5\n1 2 5 14 9\n5\n2 2 0 1 2\n5\n4 0 10 6 2\n", "output": "-1\n-1\n0\n-1\n-1\n"}, {"input": "5\n3\n2 4 6\n5\n4 4 4 4 4\n5\n1 3 5 7 12\n5\n1 1 1 1 1\n5\n4 8 10 6 ... | 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\nFamous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event.... | [{"input": "1000000000000000000\n", "output": "85\n"}, {"input": "1000000000000000000\n", "output": "85\n"}, {"input": "123456789123456789\n", "output": "81\n"}, {"input": "679891637638612257\n", "output": "84\n"}, {"input": "679891637638612258\n", "output": "85\n"}, {"input": "679891637638612259\n", "output": "85\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\nThere are N students in a school.\nWe will divide these students into some groups, and in each group they wil... | [{"input": "1000\n", "output": "333\n"}, {"input": "303\n", "output": "101\n"}, {"input": "807\n", "output": "269\n"}, {"input": "596\n", "output": "198\n"}, {"input": "604\n", "output": "201\n"}, {"input": "296\n", "output": "98\n"}, {"input": "100\n", "output": "33\n"}, {"input": "8\n", "output": "2\n"}, {"input": "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\nDoes the card fit in a snack? (Are Cards Snacks?)\n\nsquare1001 You have $ N $ cards.\n\nEach of these cards ... | [{"input": "0 9\n22 11 57 2 -1", "output": "0\n"}, {"input": "0 9\n10 11 57 2 -1", "output": "0\n"}, {"input": "10 9\n18 6 37 2 0", "output": "0\n"}, {"input": "0 10\n22 6 57 2 0", "output": "0\n"}, {"input": "0 10\n26 6 57 2 0", "output": "0\n"}, {"input": "0 10\n26 6 57 2 1", "output": "0\n"}, {"input": "7 9\n18 6 23... | 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\nHave you ever used the chat application QQ? Well, in a chat group of QQ, administrators can muzzle a user for... | [{"input": "100 61 71\n11 18 0 47 33 75 91 13 8 21 73 64 50 97 62 50 2 36 68 32 64 74 32 77 81 41 23 44 40 36 45 33 21 68 57 79 75 23 67 37 99 27 30 56 75 62 75 63 46 19 79 42 11 66 21 25 2 12 89 48 75 7 57 85 80 14 82 29 66 47 29 10 1 84 79 39 33 81 73 51 80 67 52 25 38 68 57 53 38 83 83 3 86 29 50 46 3 68 88 10\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\nThe only difference between problems C1 and C2 is that all values in input of problem C1 are distinct (this c... | [{"input": "93\n6 6 10 10 8 4 7 10 2 3 4 10 7 2 8 8 4 2 4 4 7 7 3 2 3 1 5 3 7 2 4 9 10 8 10 5 1 6 2 1 10 3 5 6 6 9 3 10 1 10 1 6 2 3 8 7 1 5 4 10 4 3 5 8 8 1 3 8 2 3 10 7 2 4 5 2 6 4 10 4 4 8 5 1 6 3 1 9 5 4 9 4 3\n", "output": "4\nRRLR\n"}, {"input": "93\n6 6 10 10 9 4 7 10 2 3 4 10 7 2 8 8 4 2 4 4 7 7 3 2 3 1 5 3 7 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\nRead problems statements in Russian here \nPolo, the Penguin, has a lot of tests tomorrow at the university.\... | [{"input": "1\n3 20\n1 -2 0\n6 4 8\n4 -1 3", "output": "24\n"}, {"input": "1\n3 12\n1 0 1\n1 3 14\n13 4 3", "output": "52\n"}, {"input": "1\n3 7\n0 -1 1\n4 0 5\n12 5 3", "output": "60\n"}, {"input": "1\n3 7\n1 1 0\n2 3 20\n3 11 3", "output": "34\n"}, {"input": "1\n3 7\n1 2 3\n1 3 5\n9 12 3", "output": "110\n"}, {"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\nThere are famous Russian nesting dolls named matryoshkas sold in one of the souvenir stores nearby, and you'd... | [{"input": "20\n51 47\n46 42\n25 22\n41 31\n11 2\n27 24\n18 13\n49 45\n16 11\n19 14\n10 1\n30 27\n10 1\n41 31\n16 11\n10 1\n41 31\n41 31\n31 28\n49 45\n", "output": "256\n"}, {"input": "20\n51 47\n46 42\n25 22\n41 31\n11 2\n27 24\n18 13\n49 45\n16 11\n19 14\n10 1\n30 27\n10 1\n41 31\n16 11\n10 1\n41 31\n41 31\n31 28\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\nThere are N computers and N sockets in a one-dimensional world. The coordinate of the i-th computer is a_i, a... | [{"input": "3\n3\n4\n18\n11\n0\n10", "output": "1\n"}, {"input": "3\n3\n4\n18\n20\n0\n10", "output": "1\n"}, {"input": "3\n3\n10\n8\n7\n0\n10", "output": "1\n"}, {"input": "3\n3\n10\n9\n7\n0\n10", "output": "1\n"}, {"input": "3\n3\n11\n8\n7\n0\n10", "output": "1\n"}, {"input": "3\n5\n10\n9\n7\n0\n10", "output": "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\nYou love coffee and want to know what beans you can afford to buy it.\n\nThe first argument to your search fu... | [{"input": "14\n[13, 15, 14, 14, 15, 13]", "output": "[\"13,13,14,14\"]", "fn_name": "search"}, {"input": "14\n[7, 3, 23, 9, 14, 20, 7]", "output": "[\"3,7,7,9,14\"]", "fn_name": "search"}, {"input": "24\n[2.7, 0, 100.9, 1, 5.5]", "output": "[\"0,1,2.7,5.5\"]", "fn_name": "search"}, {"input": "14\n[17, 33, 23, 19, 19, ... | code_functional |
[
{
"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\nFor a positive integer n\n\n* If n is even, divide by 2.\n* If n is odd, multiply by 3 and add 1.\n\n\n\nIf y... | [{"input": "3\n1043\n0", "output": "7\n124\n"}, {"input": "3\n3340\n0", "output": "7\n136\n"}, {"input": "3\n109\n0", "output": "7\n113\n"}, {"input": "3\n440\n0", "output": "7\n115\n"}, {"input": "3\n125\n0", "output": "7\n108\n"}, {"input": "3\n221\n0", "output": "7\n114\n"}, {"input": "3\n259\n0", "output": "7\n122\... | 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\nYour task is to find the first element of an array that is not consecutive.\n\nBy not consecutive we mean not... | [{"input": "[1, 2, 3, 4, 5, 6, 7, 8]", "output": "[null]", "fn_name": "first_non_consecutive"}, {"input": "[4, 5, 6, 7, 8, 9, 11]", "output": "[11]", "fn_name": "first_non_consecutive"}, {"input": "[1, 2, 3, 4, 6, 7, 8]", "output": "[6]", "fn_name": "first_non_consecutive"}, {"input": "[4, 6, 7, 8, 9, 11]", "output": "... | code_functional |
[
{
"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\nBaby is getting his frst tooth. This means more sleepless nights, but with the fun of feeling round his gums ... | [{"input": "[1, 2, 5, 7, 1, 0, 9]", "output": "[6]", "fn_name": "first_tooth"}, {"input": "[20, 9, 16, 19]", "output": "[0]", "fn_name": "first_tooth"}, {"input": "[1, 1, 1, 1]", "output": "[-1]", "fn_name": "first_tooth"}, {"input": "[1, 2, 3, 4]", "output": "[3]", "fn_name": "first_tooth"}, {"input": "[1, 2, 6, 4]", ... | code_functional |
[
{
"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\nLet's define $p_i(n)$ as the following permutation: $[i, 1, 2, \\dots, i - 1, i + 1, \\dots, n]$. This means ... | [{"input": "30 5\n4 2 8 3 4\n", "output": "14 16 16 14 12 12 12 8 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14\n"}, {"input": "30 5\n4 4 8 3 4\n", "output": "10 10 14 14 8 8 8 8 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10\n"}, {"input": "25 5\n4 2 8 3 4\n", "output": "14 16 16... | 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\nAizuwakamatsu City is known as the \"City of History\". About 400 years ago, the skeleton of the castle town ... | [{"input": "4\n4\n0,1,1500\n0,2,2000\n1,2,600\n2,3,500\n0", "output": "23\n"}, {"input": "4\n4\n0,1,1500\n0,2,2000\n1,2,600\n2,3,400\n0", "output": "22\n"}, {"input": "4\n4\n0,1,0500\n0,2,2000\n0,2,600\n2,3,400\n0", "output": "12\n"}, {"input": "4\n4\n0,1,0400\n0002,2,0\n0,2,600\n2,3,400\n0", "output": "11\n"}, {"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\nTakahashi is practicing shiritori alone again today.\nShiritori is a game as follows:\n - In the first turn, ... | [{"input": "100\nlkykrymhey\nyujwmjhnzx\nxgmkqgsajk\nkkvqjyapln\nnkcubvbxdx\nxheccrzfne\neqeizvicxx\nxesnssfeuz\nzsjdhxndds\nsuvxanfkpe\neodirlsywl\nlmiwshvenl\nluomflsyiq\nqcjuajhxme\nelfadfvxvm\nmknedshbyv\nvnboqueaai\niwexnqgqvj\njzfofokvkg\nggzhwrtktd\nderapdnumy\nyfobbqcozo\noivhkngvyy\nytjgsdfnos\nslrxpzfenf\nfhw... | 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\nThe Little Elephant very much loves sums on intervals.\n\nThis time he has a pair of integers l and r (l ≤ r)... | [{"input": "100000000000000000 1000000000000000000\n", "output": "90000000000000000\n"}, {"input": "645762257531682046 885295120956158518\n", "output": "23953286342447648\n"}, {"input": "819875140559301752 946247219812473271\n", "output": "12637207925317152\n"}, {"input": "522842183413115088 853628713003942530\n", "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\nChef has N subordinates. In order to complete a very important order he will choose exactly K of them. He can... | [{"input": "3\n5 2\n10 4\n10 5", "output": "10\n210\n252\n"}, {"input": "3\n5 2\n19 6\n9 3", "output": "10\n27132\n84\n"}, {"input": "3\n5 2\n19 9\n9 3", "output": "10\n92378\n84\n"}, {"input": "3\n9 1\n2 5\n20 12", "output": "9\n0\n125970\n"}, {"input": "3\n8 1\n2 9\n20 12", "output": "8\n0\n125970\n"}, {"input": "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\nComplete the function which takes two arguments and returns all numbers which are divisible by the given divi... | [{"input": "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n1", "output": "[[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]]", "fn_name": "divisible_by"}, {"input": "[1, 2, 3, 4, 5, 6]\n2", "output": "[[2, 4, 6]]", "fn_name": "divisible_by"}, {"input": "[0, 1, 2, 3, 4, 5, 6]\n4", "output": "[[0, 4]]", "fn_name": "divisible_by"}, {"input": "[1,... | code_functional |
[
{
"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\nFor a set $S$ of integers, perform a sequence of the following operations. Note that each value in $S$ must b... | [{"input": "8\n0 1\n0 10\n0 4\n0 2\n1 0\n0 7\n0 3\n0 2", "output": "1\n2\n3\n4\n0\n5\n6\n6\n"}, {"input": "8\n0 1\n0 7\n0 4\n0 2\n1 0\n0 7\n0 3\n0 2", "output": "1\n2\n3\n4\n0\n4\n5\n5\n"}, {"input": "8\n0 0\n0 0\n0 4\n1 2\n1 1\n1 2\n1 0\n1 2", "output": "1\n1\n2\n0\n0\n0\n1\n0\n"}, {"input": "8\n0 2\n0 3\n0 2\n2 4\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\nGeorge woke up and saw the current time s on the digital clock. Besides, George knows that he has slept for t... | [{"input": "05:50\n05:44\n", "output": "00:06\n"}, {"input": "00:00\n01:00\n", "output": "23:00\n"}, {"input": "00:01\n00:00\n", "output": "00:01\n"}, {"input": "23:59\n23:59\n", "output": "00:00\n"}, {"input": "23:44\n23:55\n", "output": "23:49\n"}, {"input": "00:00\n13:12\n", "output": "10:48\n"}, {"input": "12:00\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\nWe need a function (for commercial purposes) that may perform integer partitions with some constraints.\nThe ... | [{"input": "15\n5\n3", "output": "[15]", "fn_name": "part_const"}, {"input": "15\n5\n4", "output": "[19]", "fn_name": "part_const"}, {"input": "15\n3\n3", "output": "[13]", "fn_name": "part_const"}, {"input": "10\n3\n2", "output": "[4]", "fn_name": "part_const"}, {"input": "10\n3\n0", "output": "[8]", "fn_name": "part_... | code_functional |
[
{
"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\nYou are given a permutation P_1 ... P_N of the set {1, 2, ..., N}.\n\nYou can apply the following operation t... | [{"input": "8 2\n4 5 7 8 3 1 2 6", "output": "1\n2\n3\n6\n5\n4\n7\n8\n"}, {"input": "8 6\n4 5 7 8 3 1 2 6", "output": "4\n5\n7\n8\n3\n1\n2\n6\n"}, {"input": "8 5\n4 5 7 8 3 1 2 6", "output": "4\n5\n6\n8\n3\n1\n2\n7\n"}, {"input": "8 1\n4 5 7 8 3 1 2 6", "output": "1\n2\n3\n4\n5\n6\n7\n8\n"}, {"input": "8 4\n4 5 7 8 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\nBob is a competitive programmer. He wants to become red, and for that he needs a strict training regime. He w... | [{"input": "15\n5318008\n379009\n06\n79153975193751375917591379919397337913333535330\n791539751937513759175913799193973379133301353533\n123456789023487138475693874561834576138495713485673485364857638475673465873457346581495713641\n7915397519375137511917591379919397337913333535330\n3155355553535353532535535833353535\n13... | 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\nGalya is playing one-dimensional Sea Battle on a 1 × n grid. In this game a ships are placed on the grid. Eac... | [{"input": "100 2 1 11\n0100000100000000000000001000000000010001100000000000101000000000000000000000001000001000010000000000\n", "output": "88\n1 3 4 5 6 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 26 27 28 29 30 31 32 33 34 35 37 38 39 42 43 44 45 46 47 48 49 50 51 52 54 56 57 58 59 60 61 62 63 64 65 66 67 68 69 ... | 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\nTakahashi has a deposit of 100 yen (the currency of Japan) in AtCoder Bank.\nThe bank pays an annual interest... | [{"input": "1000000000000000000\n", "output": "3760\n"}, {"input": "822981260158260822\n", "output": "3740\n"}, {"input": "779547116602436626\n", "output": "3735\n"}, {"input": "578223540024980345\n", "output": "3705\n"}, {"input": "335408917861649372\n", "output": "3650\n"}, {"input": "974755271730884810\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\nCreate a program that will return whether an input value is a str, int, float, or bool. Return the name of th... | [{"input": "{\"name\": \"John\", \"age\": 32}", "output": "[\"dict\"]", "fn_name": "types"}, {"input": "\"Hello World!\"", "output": "[\"str\"]", "fn_name": "types"}, {"input": "[1, 2, 3, 4]", "output": "[\"list\"]", "fn_name": "types"}, {"input": "null", "output": "[\"NoneType\"]", "fn_name": "types"}, {"input": "3.14... | code_functional |
[
{
"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\nIt is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-de... | [{"input": "100 50 10\n7 8 7 1 6 7 9 2 4 6 7 7 3 9 4 5 1 7 8 10 4 1 3 6 8 10 4 6 6 1 6 12 7 4 10 3 10 1 3 2 10 6 9 9 5 2 9 2 9 8 10 2 10 3 3 2 3 8 6 2 7 10 7 2 7 2 8 9 6 2 5 4 4 5 3 3 9 10 9 4 9 3 9 5 3 6 6 1 3 6 10 3 10 2 6 10 10 10 4 8\n3 3 2 9 4 4 10 2 7 3 3 2 6 3 3 4 7 4 1 2 3 8 1 6 7 7 2 10 1 1 1 5 7 7 5 1 6 8 7 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\n~~~if-not:java\nYou have to code a function **getAllPrimeFactors** wich take an integer as parameter and retu... | [{"input": "1000", "output": "[[2, 2, 2, 5, 5, 5]]", "fn_name": "getAllPrimeFactors"}, {"input": "1000001", "output": "[[101, 9901]]", "fn_name": "getAllPrimeFactors"}, {"input": "100", "output": "[[2, 2, 5, 5]]", "fn_name": "getAllPrimeFactors"}, {"input": "10", "output": "[[2, 5]]", "fn_name": "getAllPrimeFactors"}, ... | code_functional |
[
{
"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\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\nConsider a sequ... | [{"input": "10 10 50\n9 10 0 100000\n4 8 5 100000\n1 3 1 100000\n2 6 3 100000\n9 10 1 84\n2 9 4 72167\n5 9 6 100000\n6 8 2 100000\n1 5 2 100000\n3 6 3 100000\n1 9 8 100000\n2 4 0 100000\n3 5 1 100000\n4 8 7 7354\n3 4 0 100000\n5 10 6 100000\n1 6 4 100000\n7 10 3 100000\n8 10 2 100000\n4 6 3 100000\n1 4 1 100000\n6 9 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\nThere is a sequence of colorful stones. The color of each stone is one of red, green, or blue. You are given ... | [{"input": "BRRBGBRGRBGRGRRGGBGBGBRGBRGRGGGRBRRRBRBBBGRRRGGBBB\nBBRBGGRGRGBBBRBGRBRBBBBRBRRRBGBBGBBRRBBGGRBRRBRGRB\n", "output": "15\n"}, {"input": "BRGRRGRGRRGBBGBBBRRBBRRBGBBGRGBBGGRGBRBGGGRRRBGGBB\nRGBBGRRBBBRRGRRBRBBRGBBGGGRGBGRRRRBRBGGBRBGGGRGBRR\n", "output": "16\n"}, {"input": "GGRGGBRRGRGBRRGGRBBGGRRGBBBGBBBGGR... | 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\nPolycarpus is a system administrator. There are two servers under his strict guidance — a and b. To stay info... | [{"input": "14\n1 7 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\n", "output": "DEAD\nDEAD\n"}, {"input": "14\n1 7 3\n1 0 10\n1 7 3\n1 1 9\n2 2 8\n2 0 10\n1 1 9\n2 8 2\n2 6 4\n1 3 7\n1 3 7\n2 6 4\n2 1 9\n2 7 3\n", "output": "DEAD\nDEAD\n"}, {"input": "14\n1 5 3\n1 0 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\n*This kata is inspired by [Project Euler Problem #387](https://projecteuler.net/problem=387)*\n\n---\n\nA [Ha... | [{"input": "1000\n2000", "output": "[[1000, 1002, 1008, 1020, 1026, 1080, 1088, 1200, 1204, 1206, 1260, 1800, 2000]]", "fn_name": "rthn_between"}, {"input": "30\n100", "output": "[[30, 36, 40, 42, 45, 48, 50, 54, 60, 63, 70, 72, 80, 81, 84, 90, 100]]", "fn_name": "rthn_between"}, {"input": "9000002182976\n9000195371842... | code_functional |
[
{
"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\nDZY has a hash table with p buckets, numbered from 0 to p - 1. He wants to insert n numbers, in the order the... | [{"input": "101 15\n139988797\n524419455\n1205904463\n153341038\n146759898\n171753194\n163710849\n42060733\n1382862835\n979451110\n1200809750\n37821717\n446728232\n850870259\n221398500\n", "output": "12\n"}, {"input": "101 15\n139988797\n524419455\n1205904463\n153341038\n146759898\n198834293\n163710849\n42060733\n13828... | 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\nProblem\n\nA graph is given in which N vertices, each numbered from 1 to N, are connected by N-1 undirected e... | [{"input": "6\n1 2\n2 3\n3 4\n3 5\n5 6", "output": "6\n7\n8\n7\n7\n6\n"}, {"input": "6\n1 2\n2 3\n6 4\n3 5\n5 6", "output": "5\n6\n7\n5\n7\n6\n"}, {"input": "6\n1 2\n2 3\n6 4\n3 4\n5 6", "output": "5\n6\n7\n7\n5\n6\n"}, {"input": "6\n1 2\n2 3\n3 4\n3 5\n1 6", "output": "7\n8\n7\n6\n6\n6\n"}, {"input": "6\n1 2\n1 3\n3 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\nA number is called 2050-number if it is $2050$, $20500$, ..., ($2050 \\cdot 10^k$ for integer $k \\ge 0$).\n\... | [{"input": "9\n204926935685243951\n999999999999999000\n1000000000000000000\n204999999999997950\n983999999999997950\n205\n1266\n50\n20\n", "output": "-1\n81\n-1\n126\n128\n-1\n-1\n-1\n-1\n"}, {"input": "9\n375241037050488412\n999999999999999000\n1000000000000000000\n204999999999997950\n1691361554995086523\n205\n2255\n50... | 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\nYou've got table a, consisting of n rows, numbered from 1 to n. The i-th line of table a contains ci cells, a... | [{"input": "4\n40 40 24 5\n56 14 59 76 92 34 43 96 33 44 72 37 81 27 42 5 7 95 22 4 60 18 61 103 74 84 93 55 3 62 70 82 77 51 86 102 29 67 91 9\n71 53 21 64 17 45 46 101 97 30 109 100 57 16 80 87 28 12 94 23 39 98 32 52 54 10 19 41 90 11 66 65 99 89 40 36 58 20 78 108\n35 88 73 75 104 63 79 31 1 26 2 50 24 83 15 49 106... | 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\nPermutation p is an ordered set of integers p_1, p_2, ..., p_{n}, consisting of n distinct positive intege... | [{"input": "1000 500\n", "output": "979041279\n"}, {"input": "1000 700\n", "output": "642759746\n"}, {"input": "1000 900\n", "output": "301804159\n"}, {"input": "1000 998\n", "output": "583666213\n"}, {"input": "1000 900\n", "output": "301804159\n"}, {"input": "1000 998\n", "output": "583666213\n"}, {"input": "1000 700... | 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\nIkta loves fast programs. Recently, I'm trying to speed up the division program. However, it doesn't get much... | [{"input": "001", "output": "2\n"}, {"input": "000", "output": "1\n"}, {"input": "178", "output": "0\n"}, {"input": "209", "output": "0\n"}, {"input": "375", "output": "0\n"}, {"input": "112", "output": "0\n"}, {"input": "143", "output": "0\n"}, {"input": "277", "output": "0\n"}, {"input": "164", "output": "0\n"}, {"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\nTokitsukaze and CSL are playing a little game of stones.\n\nIn the beginning, there are n piles of stones, th... | [{"input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125468\n", "output": "sjfnb\n"}, {"input": "14\n9 9 1000 2000 39999 48888 16 32 123456 959658 111 987584 125632 125477\n", "output": "cslnb\n"}, {"input": "14\n9 9 1000 2000 67494 48888 16 32 123456 959658 111 987584 125632 125468\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\nThe marmots need to prepare k problems for HC^2 over n days. Each problem, once prepared, also has to be prin... | [{"input": "13 13\n93 19 58 34 96 7 35 46 60 5 36 40 41\n57 3 42 68 26 85 25 45 50 21 60 23 79\n", "output": "1154\n"}, {"input": "13 13\n93 19 58 34 96 7 35 46 60 5 66 40 41\n57 3 42 68 26 85 25 45 50 21 60 23 79\n", "output": "1184\n"}, {"input": "13 13\n93 19 58 34 96 7 35 46 60 5 66 40 41\n57 1 42 68 26 85 25 45 50... | 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\nPetr has just bought a new car. He's just arrived at the most known Petersburg's petrol station to refuel it ... | [{"input": "15\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n", "output": "YES\n"}, {"input": "15\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n168\n", "output": "YES\n"}, {"input": "15\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\n180\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\nXenia the beginner programmer has a sequence a, consisting of 2^{n} non-negative integers: a_1, a_2, ..., a_2... | [{"input": "2 10\n47 17 22 0\n2 15\n2 42\n1 9\n3 13\n3 28\n1 20\n1 13\n1 50\n2 20\n2 12\n", "output": "57\n57\n61\n38\n55\n34\n51\n38\n42\n34\n"}, {"input": "2 10\n47 17 22 0\n4 15\n2 42\n1 9\n3 13\n3 28\n1 20\n1 13\n1 50\n2 20\n2 12\n", "output": "32\n48\n52\n36\n52\n33\n48\n37\n41\n33\n"}, {"input": "2 10\n47 17 22 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\nYou are given an array of integers $b_1, b_2, \\ldots, b_n$.\n\nAn array $a_1, a_2, \\ldots, a_n$ of integers... | [{"input": "4\n3\n2 -1 1\n4\n-1 2 2 6\n10\n2 -1 1 -2 1 0 -11 0 2 -1\n4\n-1 -2 -1 1\n", "output": "4\n8\n210\n8\n"}, {"input": "4\n3\n2 -1 2\n4\n-1 2 2 5\n10\n2 -1 1 -2 0 0 -11 0 2 -1\n4\n-1 -2 -1 1\n", "output": "4\n8\n150\n8\n"}, {"input": "4\n3\n2 0 2\n4\n-1 2 2 4\n10\n2 -1 1 -2 -1 0 -38 0 2 -1\n4\n-1 -2 -1 1\n", "ou... | 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\nThere is a box containing N balls. The i-th ball has the integer A_i written on it. Snuke can perform the fol... | [{"input": "5 19\n10 2 11 6 1", "output": "IMPOSSIBLE\n"}, {"input": "5 11\n12 2 10 8 2", "output": "IMPOSSIBLE\n"}, {"input": "5 15\n10 2 11 6 1", "output": "IMPOSSIBLE\n"}, {"input": "5 19\n10 2 8 6 4", "output": "IMPOSSIBLE\n"}, {"input": "5 19\n10 2 8 6 1", "output": "IMPOSSIBLE\n"}, {"input": "5 19\n10 2 7 6 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\nIt's March and you just can't seem to get your mind off brackets. However, it is not due to basketball. You n... | [{"input": "\"logger?]?system...12.12.133333 at [12-32-1432-16]\"", "output": "[[\"12-32-1432-16\"]]", "fn_name": "bracket_buster"}, {"input": "\"Big [L][e][B][r][o][n]!][[\"", "output": "[[\"L\", \"e\", \"B\", \"r\", \"o\", \"n\"]]", "fn_name": "bracket_buster"}, {"input": "\"[][]]]][[[[[[][]\"", "output": "[[\"\", \"... | code_functional |
[
{
"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\nLet's define a function $f(x)$ ($x$ is a positive integer) as follows: write all digits of the decimal repres... | [{"input": "100\n1\n2\n3\n4\n5\n4\n7\n8\n9\n10\n11\n12\n13\n17\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n17\n28\n29\n30\n31\n32\n31\n34\n35\n36\n27\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n29\n54\n100\n56\n57\n58\n59\n109\n61\n62\n63\n120\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n7... | 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\nYou are playing another computer game, and now you have to slay $n$ monsters. These monsters are standing in ... | [{"input": "10\n8\n7 4\n9 10\n4 8\n3 1\n1 7\n9 5\n1 4\n2 5\n8\n9 8\n4 7\n7 7\n3 6\n14 9\n2 5\n4 9\n2 8\n7\n2 2\n2 7\n2 10\n8 6\n1 4\n2 6\n3 10\n4\n4 10\n7 5\n6 10\n9 5\n7\n8 9\n8 1\n3 4\n5 1\n3 10\n9 3\n5 5\n5\n6 1\n7 3\n6 5\n6 1\n1 8\n2\n7 8\n7 10\n4\n6 8\n9 3\n8 1\n9 7\n4\n13 7\n5 7\n10 10\n8 8\n6\n6 5\n7 10\n7 1\n10... | 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\nThere is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with conse... | [{"input": "1000000000 1000000000\n", "output": "999999996000000004\n"}, {"input": "198278012 119900227\n", "output": "23773578011552250\n"}, {"input": "17890722 23878637\n", "output": "427205972767200\n"}, {"input": "1 1000000000\n", "output": "999999998\n"}, {"input": "237891668 1\n", "output": "237891666\n"}, {"inpu... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.