diff --git "a/languages/javascript/validation.jsonl" "b/languages/javascript/validation.jsonl" new file mode 100644--- /dev/null +++ "b/languages/javascript/validation.jsonl" @@ -0,0 +1,1000 @@ +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s051339663", "group_id": "codeNet:p00001", "input_text": "// Please run with node.js\n// $ node p1.js < input.txt\n// tested on node version 0.10.36\nvar fs = require(\"fs\");\nvar input = fs.readFileSync('/dev/stdin').toString();\nvar numbers = input.split(\"\\n\").map(Number);\nnumbers = numbers.sort(function(a, b) { return b - a });\nfor(var i = 0; i < 3; i++) {\n if(i < numbers.length) {\n console.log(numbers[i]);\n }\n}", "language": "JavaScript", "metadata": {"date": 1478057117, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00001.html", "problem_id": "p00001", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00001/input.txt", "sample_output_relpath": "derived/input_output/data/p00001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00001/JavaScript/s051339663.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s051339663", "user_id": "u193012322"}, "prompt_components": {"gold_output": "3776\n2848\n2840\n", "input_to_evaluate": "// Please run with node.js\n// $ node p1.js < input.txt\n// tested on node version 0.10.36\nvar fs = require(\"fs\");\nvar input = fs.readFileSync('/dev/stdin').toString();\nvar numbers = input.split(\"\\n\").map(Number);\nnumbers = numbers.sort(function(a, b) { return b - a });\nfor(var i = 0; i < 3; i++) {\n if(i < numbers.length) {\n console.log(numbers[i]);\n }\n}", "problem_context": "List of Top 3 Hills\n\nThere is a data which provides heights (in meter) of mountains. The data is only for ten mountains.\n\nWrite a program which prints heights of the top three mountains in descending order.\n\nInput\n\nHeight of mountain 1\nHeight of mountain 2\nHeight of mountain 3\n.\n.\nHeight of mountain 10\n\nConstraints\n\n0 ≤ height of mountain (integer) ≤ 10,000\n\nOutput\n\nHeight of the 1st mountain\nHeight of the 2nd mountain\nHeight of the 3rd mountain\n\nSample Input 1\n\n1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n\nOutput for the Sample Input 1\n\n3776\n2848\n2840\n\nSample Input 2\n\n100\n200\n300\n400\n500\n600\n700\n800\n900\n900\n\nOutput for the Sample Input 2\n\n900\n900\n800", "sample_input": "1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n"}, "reference_outputs": ["3776\n2848\n2840\n"], "source_document_id": "p00001", "source_text": "List of Top 3 Hills\n\nThere is a data which provides heights (in meter) of mountains. The data is only for ten mountains.\n\nWrite a program which prints heights of the top three mountains in descending order.\n\nInput\n\nHeight of mountain 1\nHeight of mountain 2\nHeight of mountain 3\n.\n.\nHeight of mountain 10\n\nConstraints\n\n0 ≤ height of mountain (integer) ≤ 10,000\n\nOutput\n\nHeight of the 1st mountain\nHeight of the 2nd mountain\nHeight of the 3rd mountain\n\nSample Input 1\n\n1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n\nOutput for the Sample Input 1\n\n3776\n2848\n2840\n\nSample Input 2\n\n100\n200\n300\n400\n500\n600\n700\n800\n900\n900\n\nOutput for the Sample Input 2\n\n900\n900\n800", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 367, "cpu_time_ms": 60, "memory_kb": 15524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s688665241", "group_id": "codeNet:p00001", "input_text": "(function(stdin) {\n var mountains = stdin.trim().split('\\n').map(Number);\n mountains.sort(function(a, b) {\n return b - a;\n });\n console.log(mountains.slice(0, 3).join('\\n'));\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1508678503, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00001.html", "problem_id": "p00001", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00001/input.txt", "sample_output_relpath": "derived/input_output/data/p00001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00001/JavaScript/s688665241.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688665241", "user_id": "u386225917"}, "prompt_components": {"gold_output": "3776\n2848\n2840\n", "input_to_evaluate": "(function(stdin) {\n var mountains = stdin.trim().split('\\n').map(Number);\n mountains.sort(function(a, b) {\n return b - a;\n });\n console.log(mountains.slice(0, 3).join('\\n'));\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "List of Top 3 Hills\n\nThere is a data which provides heights (in meter) of mountains. The data is only for ten mountains.\n\nWrite a program which prints heights of the top three mountains in descending order.\n\nInput\n\nHeight of mountain 1\nHeight of mountain 2\nHeight of mountain 3\n.\n.\nHeight of mountain 10\n\nConstraints\n\n0 ≤ height of mountain (integer) ≤ 10,000\n\nOutput\n\nHeight of the 1st mountain\nHeight of the 2nd mountain\nHeight of the 3rd mountain\n\nSample Input 1\n\n1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n\nOutput for the Sample Input 1\n\n3776\n2848\n2840\n\nSample Input 2\n\n100\n200\n300\n400\n500\n600\n700\n800\n900\n900\n\nOutput for the Sample Input 2\n\n900\n900\n800", "sample_input": "1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n"}, "reference_outputs": ["3776\n2848\n2840\n"], "source_document_id": "p00001", "source_text": "List of Top 3 Hills\n\nThere is a data which provides heights (in meter) of mountains. The data is only for ten mountains.\n\nWrite a program which prints heights of the top three mountains in descending order.\n\nInput\n\nHeight of mountain 1\nHeight of mountain 2\nHeight of mountain 3\n.\n.\nHeight of mountain 10\n\nConstraints\n\n0 ≤ height of mountain (integer) ≤ 10,000\n\nOutput\n\nHeight of the 1st mountain\nHeight of the 2nd mountain\nHeight of the 3rd mountain\n\nSample Input 1\n\n1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n\nOutput for the Sample Input 1\n\n3776\n2848\n2840\n\nSample Input 2\n\n100\n200\n300\n400\n500\n600\n700\n800\n900\n900\n\nOutput for the Sample Input 2\n\n900\n900\n800", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 235, "cpu_time_ms": 60, "memory_kb": 15536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s685436759", "group_id": "codeNet:p00001", "input_text": "let sample_input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nvar hills = (sample_input.trim()).split(\"\\n\").map(Number);\nhills.sort(function(a,b){return b-a;});\nconsole.log(hills.slice(0,3).join(\"\\n\"));\n", "language": "JavaScript", "metadata": {"date": 1587256505, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00001.html", "problem_id": "p00001", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00001/input.txt", "sample_output_relpath": "derived/input_output/data/p00001/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00001/JavaScript/s685436759.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s685436759", "user_id": "u134838479"}, "prompt_components": {"gold_output": "3776\n2848\n2840\n", "input_to_evaluate": "let sample_input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nvar hills = (sample_input.trim()).split(\"\\n\").map(Number);\nhills.sort(function(a,b){return b-a;});\nconsole.log(hills.slice(0,3).join(\"\\n\"));\n", "problem_context": "List of Top 3 Hills\n\nThere is a data which provides heights (in meter) of mountains. The data is only for ten mountains.\n\nWrite a program which prints heights of the top three mountains in descending order.\n\nInput\n\nHeight of mountain 1\nHeight of mountain 2\nHeight of mountain 3\n.\n.\nHeight of mountain 10\n\nConstraints\n\n0 ≤ height of mountain (integer) ≤ 10,000\n\nOutput\n\nHeight of the 1st mountain\nHeight of the 2nd mountain\nHeight of the 3rd mountain\n\nSample Input 1\n\n1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n\nOutput for the Sample Input 1\n\n3776\n2848\n2840\n\nSample Input 2\n\n100\n200\n300\n400\n500\n600\n700\n800\n900\n900\n\nOutput for the Sample Input 2\n\n900\n900\n800", "sample_input": "1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n"}, "reference_outputs": ["3776\n2848\n2840\n"], "source_document_id": "p00001", "source_text": "List of Top 3 Hills\n\nThere is a data which provides heights (in meter) of mountains. The data is only for ten mountains.\n\nWrite a program which prints heights of the top three mountains in descending order.\n\nInput\n\nHeight of mountain 1\nHeight of mountain 2\nHeight of mountain 3\n.\n.\nHeight of mountain 10\n\nConstraints\n\n0 ≤ height of mountain (integer) ≤ 10,000\n\nOutput\n\nHeight of the 1st mountain\nHeight of the 2nd mountain\nHeight of the 3rd mountain\n\nSample Input 1\n\n1819\n2003\n876\n2840\n1723\n1673\n3776\n2848\n1592\n922\n\nOutput for the Sample Input 1\n\n3776\n2848\n2840\n\nSample Input 2\n\n100\n200\n300\n400\n500\n600\n700\n800\n900\n900\n\nOutput for the Sample Input 2\n\n900\n900\n800", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 211, "cpu_time_ms": 90, "memory_kb": 15116}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s672821061", "group_id": "codeNet:p00002", "input_text": "var input = ''\n\nprocess.stdin.resume()\nprocess.stdin.setEncoding('utf8')\nprocess.stdin.on('data', function(chunk) {\n input += chunk\n})\nprocess.stdin.on('end', function() {\n input = input.split('\\n')\n main()\n})\n\nfunction main() {\n for(i=0; i B.length){\n m = A.length;\n n = B.length;\n a1 = A.split(\"\");\n a2 = B.split(\"\");\n }\n else{\n m = B.length;\n n = A.length;\n a1 = B.split(\"\");\n a2 = A.split(\"\");\n }\n \n mn = m + 1;\n buf = new Array(mn);\n for(j=m-1,i=n-1,carry=0;i>=0;--i,--j){\n tmp = parseInt(a1[j]) + parseInt(a2[i]) + carry;\n buf[j+1] = tmp % 10;\n carry = parseInt(tmp / 10);\n }\n // Rest\n for(;j>=0;--j){\n tmp = parseInt(a1[j]) + carry;\n buf[j+1] = tmp % 10;\n carry = parseInt(tmp / 10);\n }\n buf[0] = carry;\n \n if( carry > 0 ){\n var merge = buf.join(\"\");\n console.log(merge);\n }\n else{\n var merge = buf.slice(1,mn).join(\"\");\n console.log(merge);\n }\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(input){\n var line = input.trim().split(\"\\n\");\n var i = 0;\n var N = parseInt(line[i++].trim());\n {\n for(;N>0;--N){\n bigAdd(line[i], line[i+1]);\n i=i+2;\n }\n }\n});", "language": "JavaScript", "metadata": {"date": 1477852426, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00015.html", "problem_id": "p00015", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00015/input.txt", "sample_output_relpath": "derived/input_output/data/p00015/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00015/JavaScript/s591061355.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s591061355", "user_id": "u181366637"}, "prompt_components": {"gold_output": "1800\n10000000000000000000000000000000000000000\noverflow\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\noverflow\noverflow\n", "input_to_evaluate": "function bigAdd(A, B)\n{\n var m, n, mn, i, j, carry, tmp;\n var buf, a1, a2;\n \n if(A.length > B.length){\n m = A.length;\n n = B.length;\n a1 = A.split(\"\");\n a2 = B.split(\"\");\n }\n else{\n m = B.length;\n n = A.length;\n a1 = B.split(\"\");\n a2 = A.split(\"\");\n }\n \n mn = m + 1;\n buf = new Array(mn);\n for(j=m-1,i=n-1,carry=0;i>=0;--i,--j){\n tmp = parseInt(a1[j]) + parseInt(a2[i]) + carry;\n buf[j+1] = tmp % 10;\n carry = parseInt(tmp / 10);\n }\n // Rest\n for(;j>=0;--j){\n tmp = parseInt(a1[j]) + carry;\n buf[j+1] = tmp % 10;\n carry = parseInt(tmp / 10);\n }\n buf[0] = carry;\n \n if( carry > 0 ){\n var merge = buf.join(\"\");\n console.log(merge);\n }\n else{\n var merge = buf.slice(1,mn).join(\"\");\n console.log(merge);\n }\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(input){\n var line = input.trim().split(\"\\n\");\n var i = 0;\n var N = parseInt(line[i++].trim());\n {\n for(;N>0;--N){\n bigAdd(line[i], line[i+1]);\n i=i+2;\n }\n }\n});", "problem_context": "National Budget\n\nA country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647.\n\nYour task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.\n\nIf given integers or the sum have more than 80 digits, print \"overflow\".\n\nInput\n\nInput consists of several datasets. In the first line, the number of datasets N (1 ≤ N ≤ 50) is given. Each dataset consists of 2 lines:\n\nThe first integer\nThe second integer\n\nThe integer has at most 100 digits.\n\nOutput\n\nFor each dataset, print the sum of given integers in a line.\n\nSample Input\n\n6\n1000\n800\n9999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n0\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n1\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n\nOutput for the Sample Input\n\n1800\n10000000000000000000000000000000000000000\noverflow\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\noverflow\noverflow", "sample_input": "6\n1000\n800\n9999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n0\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n1\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n"}, "reference_outputs": ["1800\n10000000000000000000000000000000000000000\noverflow\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\noverflow\noverflow\n"], "source_document_id": "p00015", "source_text": "National Budget\n\nA country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647.\n\nYour task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.\n\nIf given integers or the sum have more than 80 digits, print \"overflow\".\n\nInput\n\nInput consists of several datasets. In the first line, the number of datasets N (1 ≤ N ≤ 50) is given. Each dataset consists of 2 lines:\n\nThe first integer\nThe second integer\n\nThe integer has at most 100 digits.\n\nOutput\n\nFor each dataset, print the sum of given integers in a line.\n\nSample Input\n\n6\n1000\n800\n9999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n1\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\n0\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n1\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n100000000000000000000000000000000000000000000000000000000000000000000000000000000\n\nOutput for the Sample Input\n\n1800\n10000000000000000000000000000000000000000\noverflow\n99999999999999999999999999999999999999999999999999999999999999999999999999999999\noverflow\noverflow", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1199, "cpu_time_ms": 70, "memory_kb": 15712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s996741733", "group_id": "codeNet:p00018", "input_text": "console.log(require('fs').readFileSync('/dev/stdin','utf8').trim().split(\" \").sort(function(a,b){return b-a}).join(\" \"));", "language": "JavaScript", "metadata": {"date": 1466588016, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00018.html", "problem_id": "p00018", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00018/input.txt", "sample_output_relpath": "derived/input_output/data/p00018/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00018/JavaScript/s996741733.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s996741733", "user_id": "u149181280"}, "prompt_components": {"gold_output": "9 7 6 5 3\n", "input_to_evaluate": "console.log(require('fs').readFileSync('/dev/stdin','utf8').trim().split(\" \").sort(function(a,b){return b-a}).join(\" \"));", "problem_context": "Sorting Five Numbers\n\nWrite a program which reads five numbers and sorts them in descending order.\n\nInput\n\nInput consists of five numbers a, b, c, d and e (-100000 ≤ a, b, c, d,e ≤ 100000). The five numbers are separeted by a space.\n\nOutput\n\nPrint the ordered numbers in a line. Adjacent numbers should be separated by a space.\n\nSample Input\n\n3 6 9 7 5\n\nOutput for the Sample Input\n\n9 7 6 5 3", "sample_input": "3 6 9 7 5\n"}, "reference_outputs": ["9 7 6 5 3\n"], "source_document_id": "p00018", "source_text": "Sorting Five Numbers\n\nWrite a program which reads five numbers and sorts them in descending order.\n\nInput\n\nInput consists of five numbers a, b, c, d and e (-100000 ≤ a, b, c, d,e ≤ 100000). The five numbers are separeted by a space.\n\nOutput\n\nPrint the ordered numbers in a line. Adjacent numbers should be separated by a space.\n\nSample Input\n\n3 6 9 7 5\n\nOutput for the Sample Input\n\n9 7 6 5 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 121, "cpu_time_ms": 50, "memory_kb": 15596}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s136087433", "group_id": "codeNet:p00018", "input_text": "let fs = require('fs');\n\nconst yourAnswerFunctionComesHere = data => {\n var splitedData = (data.trim()).split(\" \").map(Number);\n var sortedData = splitedData.sort((x, y) => y - x); \n console.log(sortedData.join(\" \"));\n}\n\nconst readFile = path => {\n fs.readFile(path, 'utf8', (err, data) => {\n yourAnswerFunctionComesHere(data);\n });\n}\n\nconst readFileWithoutArg = () => {\n const data = require('fs').readFileSync('/dev/stdin', 'utf8');\n yourAnswerFunctionComesHere(data);\n}\n\nlet sampleInputPath = \"\";\n\nif(process.argv.length > 2) {\n sampleInputPath = process.argv[2];\n readFile(sampleInputPath);\n} else {\n readFileWithoutArg();\n}\n\n", "language": "JavaScript", "metadata": {"date": 1528934377, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00018.html", "problem_id": "p00018", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00018/input.txt", "sample_output_relpath": "derived/input_output/data/p00018/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00018/JavaScript/s136087433.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s136087433", "user_id": "u732814202"}, "prompt_components": {"gold_output": "9 7 6 5 3\n", "input_to_evaluate": "let fs = require('fs');\n\nconst yourAnswerFunctionComesHere = data => {\n var splitedData = (data.trim()).split(\" \").map(Number);\n var sortedData = splitedData.sort((x, y) => y - x); \n console.log(sortedData.join(\" \"));\n}\n\nconst readFile = path => {\n fs.readFile(path, 'utf8', (err, data) => {\n yourAnswerFunctionComesHere(data);\n });\n}\n\nconst readFileWithoutArg = () => {\n const data = require('fs').readFileSync('/dev/stdin', 'utf8');\n yourAnswerFunctionComesHere(data);\n}\n\nlet sampleInputPath = \"\";\n\nif(process.argv.length > 2) {\n sampleInputPath = process.argv[2];\n readFile(sampleInputPath);\n} else {\n readFileWithoutArg();\n}\n\n", "problem_context": "Sorting Five Numbers\n\nWrite a program which reads five numbers and sorts them in descending order.\n\nInput\n\nInput consists of five numbers a, b, c, d and e (-100000 ≤ a, b, c, d,e ≤ 100000). The five numbers are separeted by a space.\n\nOutput\n\nPrint the ordered numbers in a line. Adjacent numbers should be separated by a space.\n\nSample Input\n\n3 6 9 7 5\n\nOutput for the Sample Input\n\n9 7 6 5 3", "sample_input": "3 6 9 7 5\n"}, "reference_outputs": ["9 7 6 5 3\n"], "source_document_id": "p00018", "source_text": "Sorting Five Numbers\n\nWrite a program which reads five numbers and sorts them in descending order.\n\nInput\n\nInput consists of five numbers a, b, c, d and e (-100000 ≤ a, b, c, d,e ≤ 100000). The five numbers are separeted by a space.\n\nOutput\n\nPrint the ordered numbers in a line. Adjacent numbers should be separated by a space.\n\nSample Input\n\n3 6 9 7 5\n\nOutput for the Sample Input\n\n9 7 6 5 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 644, "cpu_time_ms": 70, "memory_kb": 15140}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s551113136", "group_id": "codeNet:p00019", "input_text": "function main(input){\n var ans=1;\n var inputNum=toInt(input);\n for(var i=1;i<=input;i++){\n ans=ans*i;\n }\n console.log(ans);\n}\nfunction toInt(str){\n return parseInt(str, 10);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1457450659, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00019.html", "problem_id": "p00019", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00019/input.txt", "sample_output_relpath": "derived/input_output/data/p00019/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00019/JavaScript/s551113136.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s551113136", "user_id": "u324596395"}, "prompt_components": {"gold_output": "120\n", "input_to_evaluate": "function main(input){\n var ans=1;\n var inputNum=toInt(input);\n for(var i=1;i<=input;i++){\n ans=ans*i;\n }\n console.log(ans);\n}\nfunction toInt(str){\n return parseInt(str, 10);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Factorial\n\nWrite a program which reads an integer n and prints the factorial of n. You can assume that n ≤ 20.\n\nInput\n\nAn integer n (1 ≤ n ≤ 20) in a line.\n\nOutput\n\nPrint the factorial of n in a line.\n\nSample Input\n\n5\n\nOutput for the Sample Input\n\n120", "sample_input": "5\n"}, "reference_outputs": ["120\n"], "source_document_id": "p00019", "source_text": "Factorial\n\nWrite a program which reads an integer n and prints the factorial of n. You can assume that n ≤ 20.\n\nInput\n\nAn integer n (1 ≤ n ≤ 20) in a line.\n\nOutput\n\nPrint the factorial of n in a line.\n\nSample Input\n\n5\n\nOutput for the Sample Input\n\n120", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 256, "cpu_time_ms": 50, "memory_kb": 15516}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s937477046", "group_id": "codeNet:p00021", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nArr.shift();\nArr.forEach(function(v){\nvar arr=v.split(\" \").map(Number);\narr=arr.map(function(v){return v+100;});\nvar ab=(arr[3]-arr[1])/(arr[2]-arr[0]);\nvar cd=(arr[3+4]-arr[1+4])/(arr[2+4]-arr[0+4]);\nconsole.log(ab==cd?\"YES\":\"NO\");\n});", "language": "JavaScript", "metadata": {"date": 1424352568, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00021.html", "problem_id": "p00021", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00021/input.txt", "sample_output_relpath": "derived/input_output/data/p00021/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00021/JavaScript/s937477046.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s937477046", "user_id": "u540218629"}, "prompt_components": {"gold_output": "YES\nNO\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nArr.shift();\nArr.forEach(function(v){\nvar arr=v.split(\" \").map(Number);\narr=arr.map(function(v){return v+100;});\nvar ab=(arr[3]-arr[1])/(arr[2]-arr[0]);\nvar cd=(arr[3+4]-arr[1+4])/(arr[2+4]-arr[0+4]);\nconsole.log(ab==cd?\"YES\":\"NO\");\n});", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nParallelism\n\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints \"YES\" and if not prints \"NO\".\n\nInput\n\nInput consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \\leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:\n\n$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$\n\nYou can assume that $-100 \\leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \\leq 100$.\nEach value is a real number with at most 5 digits after the decimal point.\n\nOutput\n\nFor each dataset, print \"YES\" or \"NO\" in a line.\n\nSample Input\n\n2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n\nOutput for the Sample Input\n\nYES\nNO", "sample_input": "2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n"}, "reference_outputs": ["YES\nNO\n"], "source_document_id": "p00021", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nParallelism\n\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints \"YES\" and if not prints \"NO\".\n\nInput\n\nInput consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \\leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:\n\n$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$\n\nYou can assume that $-100 \\leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \\leq 100$.\nEach value is a real number with at most 5 digits after the decimal point.\n\nOutput\n\nFor each dataset, print \"YES\" or \"NO\" in a line.\n\nSample Input\n\n2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n\nOutput for the Sample Input\n\nYES\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 20, "memory_kb": 8532}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s143247335", "group_id": "codeNet:p00021", "input_text": "function Main(input){\n var results = [];\n var inputs=input.split('\\n');\n var length = parseInt(inputs[0]);\n if (isNaN(length) || inputs[0].split(' ').length > 1) return;\n for (var i = 0; i < length; i++) {\n var coords = inputs[i+1].split(' ');\n var gradient1 = (parseFloat(coords[0]) - parseFloat(coords[2]))/(parseFloat(coords[1]) - parseFloat(coords[3]));\n var gradient2 = (parseFloat(coords[4]) - parseFloat(coords[6]))/(parseFloat(coords[5]) - parseFloat(coords[7]));\n console.log(gradient1 === gradient2 ? 'YES' : 'NO');\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1478126864, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00021.html", "problem_id": "p00021", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00021/input.txt", "sample_output_relpath": "derived/input_output/data/p00021/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00021/JavaScript/s143247335.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s143247335", "user_id": "u700525718"}, "prompt_components": {"gold_output": "YES\nNO\n", "input_to_evaluate": "function Main(input){\n var results = [];\n var inputs=input.split('\\n');\n var length = parseInt(inputs[0]);\n if (isNaN(length) || inputs[0].split(' ').length > 1) return;\n for (var i = 0; i < length; i++) {\n var coords = inputs[i+1].split(' ');\n var gradient1 = (parseFloat(coords[0]) - parseFloat(coords[2]))/(parseFloat(coords[1]) - parseFloat(coords[3]));\n var gradient2 = (parseFloat(coords[4]) - parseFloat(coords[6]))/(parseFloat(coords[5]) - parseFloat(coords[7]));\n console.log(gradient1 === gradient2 ? 'YES' : 'NO');\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nParallelism\n\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints \"YES\" and if not prints \"NO\".\n\nInput\n\nInput consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \\leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:\n\n$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$\n\nYou can assume that $-100 \\leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \\leq 100$.\nEach value is a real number with at most 5 digits after the decimal point.\n\nOutput\n\nFor each dataset, print \"YES\" or \"NO\" in a line.\n\nSample Input\n\n2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n\nOutput for the Sample Input\n\nYES\nNO", "sample_input": "2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n"}, "reference_outputs": ["YES\nNO\n"], "source_document_id": "p00021", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nParallelism\n\nThere are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints \"YES\" and if not prints \"NO\".\n\nInput\n\nInput consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \\leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:\n\n$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$\n\nYou can assume that $-100 \\leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \\leq 100$.\nEach value is a real number with at most 5 digits after the decimal point.\n\nOutput\n\nFor each dataset, print \"YES\" or \"NO\" in a line.\n\nSample Input\n\n2\n0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0\n3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0\n\nOutput for the Sample Input\n\nYES\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 604, "cpu_time_ms": 50, "memory_kb": 15500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s569132856", "group_id": "codeNet:p00023", "input_text": "(function(input) {\n var p = input.replace(/\\n$/, '').split('\\n');\n var n = Number(p.shift());\n for (var i = 0; i < n; i++) {\n var args = p.shift().split(' ').map(Number);\n var xa = args.shift();\n var ya = args.shift();\n var ra = args.shift();\n var xb = args.shift();\n var yb = args.shift();\n var rb = args.shift();\n var a = Math.pow(ra, 2);\n var b = Math.pow(rb, 2);\n var d = Math.pow(xb - xa, 2) + Math.pow(yb - ya, 2);\n\n if (a >= d + b) {\n console.log(2);\n } else if (b >= d + a) {\n console.log(-2);\n } else if (d <= a + b) {\n console.log(1);\n } else {\n console.log(0);\n }\n }\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1430619478, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00023.html", "problem_id": "p00023", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00023/input.txt", "sample_output_relpath": "derived/input_output/data/p00023/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00023/JavaScript/s569132856.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s569132856", "user_id": "u759826653"}, "prompt_components": {"gold_output": "2\n0\n", "input_to_evaluate": "(function(input) {\n var p = input.replace(/\\n$/, '').split('\\n');\n var n = Number(p.shift());\n for (var i = 0; i < n; i++) {\n var args = p.shift().split(' ').map(Number);\n var xa = args.shift();\n var ya = args.shift();\n var ra = args.shift();\n var xb = args.shift();\n var yb = args.shift();\n var rb = args.shift();\n var a = Math.pow(ra, 2);\n var b = Math.pow(rb, 2);\n var d = Math.pow(xb - xa, 2) + Math.pow(yb - ya, 2);\n\n if (a >= d + b) {\n console.log(2);\n } else if (b >= d + a) {\n console.log(-2);\n } else if (d <= a + b) {\n console.log(1);\n } else {\n console.log(0);\n }\n }\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircles Intersection\n\nYou are given circle $A$ with radius $r_a$ and with central coordinate $(x_a, y_a)$ and circle $B$ with radius $r_b$ and with central coordinate $(x_b, y_b)$.\n\nWrite a program which prints:\n\n\"2\" if $B$ is in $A$,\n\n\"-2\" if $A$ is in $B$,\n\n\"1\" if circumference of $A$ and $B$ intersect, and\n\n\"0\" if $A$ and $B$ do not overlap.\n\nYou may assume that $A$ and $B$ are not identical.\n\nInput\n\nThe input consists of multiple datasets. The first line consists of an integer $N$ ($N \\leq 50$), the number of datasets. There will be $N$ lines where each line represents each dataset. Each data set consists of real numbers:\n\n$x_a$ $y_a$ $r_a$ $x_b$ $y_b$ $r_b$\n\nOutput\n\nFor each dataset, print 2, -2, 1, or 0 in a line.\n\nSample Input\n\n2\n0.0 0.0 5.0 0.0 0.0 4.0\n0.0 0.0 2.0 4.1 0.0 2.0\n\nOutput for the Sample Input\n\n2\n0", "sample_input": "2\n0.0 0.0 5.0 0.0 0.0 4.0\n0.0 0.0 2.0 4.1 0.0 2.0\n"}, "reference_outputs": ["2\n0\n"], "source_document_id": "p00023", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircles Intersection\n\nYou are given circle $A$ with radius $r_a$ and with central coordinate $(x_a, y_a)$ and circle $B$ with radius $r_b$ and with central coordinate $(x_b, y_b)$.\n\nWrite a program which prints:\n\n\"2\" if $B$ is in $A$,\n\n\"-2\" if $A$ is in $B$,\n\n\"1\" if circumference of $A$ and $B$ intersect, and\n\n\"0\" if $A$ and $B$ do not overlap.\n\nYou may assume that $A$ and $B$ are not identical.\n\nInput\n\nThe input consists of multiple datasets. The first line consists of an integer $N$ ($N \\leq 50$), the number of datasets. There will be $N$ lines where each line represents each dataset. Each data set consists of real numbers:\n\n$x_a$ $y_a$ $r_a$ $x_b$ $y_b$ $r_b$\n\nOutput\n\nFor each dataset, print 2, -2, 1, or 0 in a line.\n\nSample Input\n\n2\n0.0 0.0 5.0 0.0 0.0 4.0\n0.0 0.0 2.0 4.1 0.0 2.0\n\nOutput for the Sample Input\n\n2\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 700, "cpu_time_ms": 20, "memory_kb": 7640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s774864993", "group_id": "codeNet:p00024", "input_text": "'use strict';\n\nvar input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar minvs = input.trim().split('\\n');\nwhile (minvs.length !== 0) {\n\tconsole.log(Math.ceil(Math.pow(parseFloat(minvs.shift()), 2)/98 + 1));\n}", "language": "JavaScript", "metadata": {"date": 1471616697, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00024.html", "problem_id": "p00024", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00024/input.txt", "sample_output_relpath": "derived/input_output/data/p00024/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00024/JavaScript/s774864993.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s774864993", "user_id": "u582608581"}, "prompt_components": {"gold_output": "8\n8\n", "input_to_evaluate": "'use strict';\n\nvar input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar minvs = input.trim().split('\\n');\nwhile (minvs.length !== 0) {\n\tconsole.log(Math.ceil(Math.pow(parseFloat(minvs.shift()), 2)/98 + 1));\n}", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nPhysical Experiments\n\nIgnoring the air resistance, velocity of a freely falling object $v$ after $t$ seconds and its drop $y$ in $t$ seconds are represented by the following formulas:\n\n$ v = 9.8 t $\n\n$ y = 4.9 t^2 $\n\nA person is trying to drop down a glass ball and check whether it will crack. Your task is to write a program to help this experiment.\n\nYou are given the minimum velocity to crack the ball. Your program should print the lowest possible floor of a building to crack the ball. The height of the $N$ floor of the building is defined by $5 \\times N - 5$.\n\nInput\n\nThe input consists of multiple datasets. Each dataset, a line, consists of the minimum velocity v (0 < v < 200) to crack the ball. The value is given by a decimal fraction, with at most 4 digits after the decimal point. The input ends with EOF. The number of datasets is less than or equal to 50.\n\nOutput\n\nFor each dataset, print the lowest possible floor where the ball cracks.\n\nSample Input\n\n25.4\n25.4\n\nOutput for the Sample Input\n\n8\n8", "sample_input": "25.4\n25.4\n"}, "reference_outputs": ["8\n8\n"], "source_document_id": "p00024", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nPhysical Experiments\n\nIgnoring the air resistance, velocity of a freely falling object $v$ after $t$ seconds and its drop $y$ in $t$ seconds are represented by the following formulas:\n\n$ v = 9.8 t $\n\n$ y = 4.9 t^2 $\n\nA person is trying to drop down a glass ball and check whether it will crack. Your task is to write a program to help this experiment.\n\nYou are given the minimum velocity to crack the ball. Your program should print the lowest possible floor of a building to crack the ball. The height of the $N$ floor of the building is defined by $5 \\times N - 5$.\n\nInput\n\nThe input consists of multiple datasets. Each dataset, a line, consists of the minimum velocity v (0 < v < 200) to crack the ball. The value is given by a decimal fraction, with at most 4 digits after the decimal point. The input ends with EOF. The number of datasets is less than or equal to 50.\n\nOutput\n\nFor each dataset, print the lowest possible floor where the ball cracks.\n\nSample Input\n\n25.4\n25.4\n\nOutput for the Sample Input\n\n8\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 50, "memory_kb": 15480}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s974394698", "group_id": "codeNet:p00027", "input_text": "// 標準入力\nvar fs = require('fs'),\nlength = fs.fstatSync(process.stdin.fd).size,\nbuffer = new Buffer(length),\nbytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\ninput = buffer.toString('utf8', 0, bytesRead).trim().split('\\n');\nmain();\n\nfunction main(){\n for(var i = 0, len = input.length; i < len; i++){\n var c = input[i].split(' ');\n if(+c[1] && +c[0]){\n var date = new Date(2004, c[0]-1, +c[1]);\n console.log(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()]);\n }\n }\n \n\n\n}", "language": "JavaScript", "metadata": {"date": 1433138410, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00027.html", "problem_id": "p00027", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00027/input.txt", "sample_output_relpath": "derived/input_output/data/p00027/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00027/JavaScript/s974394698.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s974394698", "user_id": "u340523328"}, "prompt_components": {"gold_output": "Thursday\nSunday\n", "input_to_evaluate": "// 標準入力\nvar fs = require('fs'),\nlength = fs.fstatSync(process.stdin.fd).size,\nbuffer = new Buffer(length),\nbytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\ninput = buffer.toString('utf8', 0, bytesRead).trim().split('\\n');\nmain();\n\nfunction main(){\n for(var i = 0, len = input.length; i < len; i++){\n var c = input[i].split(' ');\n if(+c[1] && +c[0]){\n var date = new Date(2004, c[0]-1, +c[1]);\n console.log(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][date.getDay()]);\n }\n }\n \n\n\n}", "problem_context": "What day is today?\n\nYour task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29.\n\nInput\n\nThe input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers m and d separated by a single space in a line. These integers respectively represent the month and the day.\n\nThe number of datasets is less than or equal to 50.\n\nOutput\n\nFor each dataset, print the day (please see the following words) in a line.\n\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday\n\nSample Input\n\n1 1\n2 29\n0 0\n\nOutput for the Sample Input\n\nThursday\nSunday", "sample_input": "1 1\n2 29\n0 0\n"}, "reference_outputs": ["Thursday\nSunday\n"], "source_document_id": "p00027", "source_text": "What day is today?\n\nYour task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29.\n\nInput\n\nThe input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers m and d separated by a single space in a line. These integers respectively represent the month and the day.\n\nThe number of datasets is less than or equal to 50.\n\nOutput\n\nFor each dataset, print the day (please see the following words) in a line.\n\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday\nSunday\n\nSample Input\n\n1 1\n2 29\n0 0\n\nOutput for the Sample Input\n\nThursday\nSunday", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 559, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s339234978", "group_id": "codeNet:p00028", "input_text": "x=require('fs').readFileSync('/dev/stdin','utf8').trim().split(/\\s/).sort(function(a,b){return a-b;});\nconsole.log(x);\nfor(mode=[],cnt=0,i=0;i=cnt){\n cnt=temp_cnt;\n mode.push(x[i]); \n }\n}\nconsole.log(mode);", "language": "JavaScript", "metadata": {"date": 1466563278, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00028.html", "problem_id": "p00028", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00028/input.txt", "sample_output_relpath": "derived/input_output/data/p00028/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00028/JavaScript/s339234978.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s339234978", "user_id": "u149181280"}, "prompt_components": {"gold_output": "3\n5\n", "input_to_evaluate": "x=require('fs').readFileSync('/dev/stdin','utf8').trim().split(/\\s/).sort(function(a,b){return a-b;});\nconsole.log(x);\nfor(mode=[],cnt=0,i=0;i=cnt){\n cnt=temp_cnt;\n mode.push(x[i]); \n }\n}\nconsole.log(mode);", "problem_context": "Mode Value\n\nYour task is to write a program which reads a sequence of integers and prints mode values of the sequence.\nThe mode value is the element which occurs most frequently.\n\nInput\n\nA sequence of integers ai (1 ≤ ai ≤ 100). The number of integers is less than or equals to 100.\n\nOutput\n\nPrint the mode values. If there are several mode values, print them in ascending order.\n\nSample Input\n\n5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n\nOutput for the Sample Input\n\n3\n5\n\nFor example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.", "sample_input": "5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n"}, "reference_outputs": ["3\n5\n"], "source_document_id": "p00028", "source_text": "Mode Value\n\nYour task is to write a program which reads a sequence of integers and prints mode values of the sequence.\nThe mode value is the element which occurs most frequently.\n\nInput\n\nA sequence of integers ai (1 ≤ ai ≤ 100). The number of integers is less than or equals to 100.\n\nOutput\n\nPrint the mode values. If there are several mode values, print them in ascending order.\n\nSample Input\n\n5\n6\n3\n5\n8\n7\n5\n3\n9\n7\n3\n4\n\nOutput for the Sample Input\n\n3\n5\n\nFor example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 366, "cpu_time_ms": 80, "memory_kb": 15908}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s517777239", "group_id": "codeNet:p00030", "input_text": "function bomb(n,sum,str,before){\n if(n==N && sum==S)cnt++;\n if(n==N)return;\n var arr=str.split(\"\").map(Number);\n arr.forEach(function(v){\n if(before-s;n++);console.log(++n)})", "language": "JavaScript", "metadata": {"date": 1433463177, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00034.html", "problem_id": "p00034", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00034/input.txt", "sample_output_relpath": "derived/input_output/data/p00034/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00034/JavaScript/s208023601.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s208023601", "user_id": "u340523328"}, "prompt_components": {"gold_output": "4\n7\n6\n", "input_to_evaluate": "require(\"fs\").readFileSync(\"/dev/stdin\",'utf8').trim().split(/\\s/).map(function(i){j=i.split(',');for(n=m=s=0;m<10;m++)j[m]=s-=j[m];for(s*=j[10]/(-j[10]-j[11]);j[n]>-s;n++);console.log(++n)})", "problem_context": "鉄道路線\n\n複線(上りと下りが別の線路になっていてどこででもすれ違える)の鉄道路線があります。この路線には終端駅を含めて11 の駅があり、それぞれの駅と駅の間は図で示す区間番号で呼ばれています。\n\nこの路線の両方の終端駅から列車が同時に出発して、途中で停まらずに走ります。各区間の長さと2 本の列車の速度を読み込んで、それぞれの場合について列車がすれ違う区間の番号を出力するプログラムを作成してください。ただし、ちょうど駅のところですれ違う場合は、両側の区間番号のうち小さいほうの数字を出力します。また、列車の長さ、駅の長さは無視できるものとします。\n\nInput\n\n複数のデータセットが与えられる。各データセットは以下のような形式で与えられる。\n\nl1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2\n\nli (1 ≤ li ≤ 2,000) は区間 i の長さ(km)を表す整数である。v1 は区間 1 側の終端駅を出発した列車の速度(km/h)、v2 は区間 10 側の終端駅を出発した列車の速度(km/h)を表す整数である (1 ≤ v1, v2 ≤ 2,000)。\n\nデータセットの数は 50 を超えない。\n\nOutput\n\nデータセットごとに、列車がすれちがう区間の番号を1行に出力する。\n\nSample Input\n\n1,1,1,1,1,1,1,1,1,1,40,60\n1,1,1,1,1,3,3,3,3,3,50,50\n10,10,10,10,10,10,10,10,10,10,50,49\n\nOutput for the Sample Input\n\n4\n7\n6", "sample_input": "1,1,1,1,1,1,1,1,1,1,40,60\n1,1,1,1,1,3,3,3,3,3,50,50\n10,10,10,10,10,10,10,10,10,10,50,49\n"}, "reference_outputs": ["4\n7\n6\n"], "source_document_id": "p00034", "source_text": "鉄道路線\n\n複線(上りと下りが別の線路になっていてどこででもすれ違える)の鉄道路線があります。この路線には終端駅を含めて11 の駅があり、それぞれの駅と駅の間は図で示す区間番号で呼ばれています。\n\nこの路線の両方の終端駅から列車が同時に出発して、途中で停まらずに走ります。各区間の長さと2 本の列車の速度を読み込んで、それぞれの場合について列車がすれ違う区間の番号を出力するプログラムを作成してください。ただし、ちょうど駅のところですれ違う場合は、両側の区間番号のうち小さいほうの数字を出力します。また、列車の長さ、駅の長さは無視できるものとします。\n\nInput\n\n複数のデータセットが与えられる。各データセットは以下のような形式で与えられる。\n\nl1,l2,l3,l4,l5,l6,l7,l8,l9,l10,v1,v2\n\nli (1 ≤ li ≤ 2,000) は区間 i の長さ(km)を表す整数である。v1 は区間 1 側の終端駅を出発した列車の速度(km/h)、v2 は区間 10 側の終端駅を出発した列車の速度(km/h)を表す整数である (1 ≤ v1, v2 ≤ 2,000)。\n\nデータセットの数は 50 を超えない。\n\nOutput\n\nデータセットごとに、列車がすれちがう区間の番号を1行に出力する。\n\nSample Input\n\n1,1,1,1,1,1,1,1,1,1,40,60\n1,1,1,1,1,3,3,3,3,3,50,50\n10,10,10,10,10,10,10,10,10,10,50,49\n\nOutput for the Sample Input\n\n4\n7\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 191, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s414706713", "group_id": "codeNet:p00036", "input_text": "require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\").split('\\n\\n').map(function(i){l=/1(0|1|\\n)*1/m.exec(i)[0].length%11;console.log(l?l==6?'B':l==4?'C':l==7?'D':l==1?'E':l==9?'G':'F':'A')})", "language": "JavaScript", "metadata": {"date": 1433758349, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00036.html", "problem_id": "p00036", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00036/input.txt", "sample_output_relpath": "derived/input_output/data/p00036/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00036/JavaScript/s414706713.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s414706713", "user_id": "u340523328"}, "prompt_components": {"gold_output": "E\nC\nA\n", "input_to_evaluate": "require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\").split('\\n\\n').map(function(i){l=/1(0|1|\\n)*1/m.exec(i)[0].length%11;console.log(l?l==6?'B':l==4?'C':l==7?'D':l==1?'E':l==9?'G':'F':'A')})", "problem_context": "平面上の図形\n\n縦 8、横 8 のマスからなる図 1 のような平面があります。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図1\n\nこの平面上に、以下の A から G の図形のどれかが一つだけ置かれています。\n\nA\n\n■\n\n■\n\n■\n\n■\n\nB\n\n■\n\n■\n\n■\n\n■\n\nC\n\n■\n\n■\n\n■\n\n■\n\nD\n\n■\n\n■\n\n■\n\n■\n\nE\n\n■\n\n■\n\n■\n\n■\n\nF\n\n■\n\n■\n\n■\n\n■\n\nG\n\n■\n\n■\n\n■\n\n■\n\nたとえば、次の図 2 の例では E の図形が置かれています。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図2\n\n平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した数字の列を読み込んで、置かれている図形の種類(A〜G)を出力するプログラムを作成してください。\n\nただし、ひとつの平面に置かれている図形は必ず1つで、複数の図形が置かれていることはありません。また、A〜G で表される図形以外のものが置かれていることはありません。\n\nInput\n\n入力は複数のデータセットからなります。\n\n1つのデータセットとして、平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した 8 文字からなる 8 つの文字列が与えられます。例えば、図 2 に対応する文字列の並びは次のようになります。\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\nデータセットの間は1つの空行で区切られています。データセットの数は 50 を超えません。\n\nOutput\n\n各データセットごとに、平面に与えられた図形の種類(A〜G のいずれか)を1行に出力してください。\n\nSample Input\n\n00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n\nOutput for the Sample Input\n\nE\nC\nA", "sample_input": "00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n"}, "reference_outputs": ["E\nC\nA\n"], "source_document_id": "p00036", "source_text": "平面上の図形\n\n縦 8、横 8 のマスからなる図 1 のような平面があります。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図1\n\nこの平面上に、以下の A から G の図形のどれかが一つだけ置かれています。\n\nA\n\n■\n\n■\n\n■\n\n■\n\nB\n\n■\n\n■\n\n■\n\n■\n\nC\n\n■\n\n■\n\n■\n\n■\n\nD\n\n■\n\n■\n\n■\n\n■\n\nE\n\n■\n\n■\n\n■\n\n■\n\nF\n\n■\n\n■\n\n■\n\n■\n\nG\n\n■\n\n■\n\n■\n\n■\n\nたとえば、次の図 2 の例では E の図形が置かれています。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図2\n\n平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した数字の列を読み込んで、置かれている図形の種類(A〜G)を出力するプログラムを作成してください。\n\nただし、ひとつの平面に置かれている図形は必ず1つで、複数の図形が置かれていることはありません。また、A〜G で表される図形以外のものが置かれていることはありません。\n\nInput\n\n入力は複数のデータセットからなります。\n\n1つのデータセットとして、平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した 8 文字からなる 8 つの文字列が与えられます。例えば、図 2 に対応する文字列の並びは次のようになります。\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\nデータセットの間は1つの空行で区切られています。データセットの数は 50 を超えません。\n\nOutput\n\n各データセットごとに、平面に与えられた図形の種類(A〜G のいずれか)を1行に出力してください。\n\nSample Input\n\n00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n\nOutput for the Sample Input\n\nE\nC\nA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 20, "memory_kb": 7640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s361948882", "group_id": "codeNet:p00036", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar _HEIGHT = 8;\n//入力\nvar input_string = '';\nprocess.stdin.on('data', function(chunk) {\n input_string += chunk.toString();\n});\n\n//main処理\nprocess.stdin.on('end', function() {\n //入力 -> Array\n var lines = input_string.split('\\n');\n lines = lines.filter(function(val) {\n return val !== '';\n });\n // 8個ずつ\n while (lines.length >= _HEIGHT) {\n var matrix = lines.splice(0, 8);\n \n judge(matrix);\n }\n});\n\nfunction judge(ary) {\n tmpAry = ary.filter(function(val) {\n return val.indexOf('1') > 0; \n });\n \n compShape(tmpAry);\n}\n\nfunction compShape(ary) {\n switch (ary.length) {\n case 1:\n console.log('C')\n break;\n case 2:\n case2(ary);\n break;\n case 3:\n case3(ary);\n break;\n case 4:\n console.log('B')\n break;\n default:\n console.log('Error');\n }\n}\n\nfunction case2(ary) {\n ind0 = ary[0].indexOf('1');\n ind1 = ary[1].indexOf('1');\n \n if (ind0 < ind1) {\n console.log('E');\n }\n else if (ind0 > ind1) {\n console.log('G');\n }\n else {\n console.log('A');\n }\n}\n\nfunction case3(ary) {\n ind0 = ary[0].indexOf('1');\n ind1 = ary[1].indexOf('1');\n \n if (ind0 > ind1) {\n console.log('D');\n }\n else {\n console.log('F');\n }\n}\n", "language": "JavaScript", "metadata": {"date": 1524717944, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00036.html", "problem_id": "p00036", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00036/input.txt", "sample_output_relpath": "derived/input_output/data/p00036/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00036/JavaScript/s361948882.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s361948882", "user_id": "u854486190"}, "prompt_components": {"gold_output": "E\nC\nA\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar _HEIGHT = 8;\n//入力\nvar input_string = '';\nprocess.stdin.on('data', function(chunk) {\n input_string += chunk.toString();\n});\n\n//main処理\nprocess.stdin.on('end', function() {\n //入力 -> Array\n var lines = input_string.split('\\n');\n lines = lines.filter(function(val) {\n return val !== '';\n });\n // 8個ずつ\n while (lines.length >= _HEIGHT) {\n var matrix = lines.splice(0, 8);\n \n judge(matrix);\n }\n});\n\nfunction judge(ary) {\n tmpAry = ary.filter(function(val) {\n return val.indexOf('1') > 0; \n });\n \n compShape(tmpAry);\n}\n\nfunction compShape(ary) {\n switch (ary.length) {\n case 1:\n console.log('C')\n break;\n case 2:\n case2(ary);\n break;\n case 3:\n case3(ary);\n break;\n case 4:\n console.log('B')\n break;\n default:\n console.log('Error');\n }\n}\n\nfunction case2(ary) {\n ind0 = ary[0].indexOf('1');\n ind1 = ary[1].indexOf('1');\n \n if (ind0 < ind1) {\n console.log('E');\n }\n else if (ind0 > ind1) {\n console.log('G');\n }\n else {\n console.log('A');\n }\n}\n\nfunction case3(ary) {\n ind0 = ary[0].indexOf('1');\n ind1 = ary[1].indexOf('1');\n \n if (ind0 > ind1) {\n console.log('D');\n }\n else {\n console.log('F');\n }\n}\n", "problem_context": "平面上の図形\n\n縦 8、横 8 のマスからなる図 1 のような平面があります。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図1\n\nこの平面上に、以下の A から G の図形のどれかが一つだけ置かれています。\n\nA\n\n■\n\n■\n\n■\n\n■\n\nB\n\n■\n\n■\n\n■\n\n■\n\nC\n\n■\n\n■\n\n■\n\n■\n\nD\n\n■\n\n■\n\n■\n\n■\n\nE\n\n■\n\n■\n\n■\n\n■\n\nF\n\n■\n\n■\n\n■\n\n■\n\nG\n\n■\n\n■\n\n■\n\n■\n\nたとえば、次の図 2 の例では E の図形が置かれています。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図2\n\n平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した数字の列を読み込んで、置かれている図形の種類(A〜G)を出力するプログラムを作成してください。\n\nただし、ひとつの平面に置かれている図形は必ず1つで、複数の図形が置かれていることはありません。また、A〜G で表される図形以外のものが置かれていることはありません。\n\nInput\n\n入力は複数のデータセットからなります。\n\n1つのデータセットとして、平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した 8 文字からなる 8 つの文字列が与えられます。例えば、図 2 に対応する文字列の並びは次のようになります。\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\nデータセットの間は1つの空行で区切られています。データセットの数は 50 を超えません。\n\nOutput\n\n各データセットごとに、平面に与えられた図形の種類(A〜G のいずれか)を1行に出力してください。\n\nSample Input\n\n00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n\nOutput for the Sample Input\n\nE\nC\nA", "sample_input": "00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n"}, "reference_outputs": ["E\nC\nA\n"], "source_document_id": "p00036", "source_text": "平面上の図形\n\n縦 8、横 8 のマスからなる図 1 のような平面があります。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図1\n\nこの平面上に、以下の A から G の図形のどれかが一つだけ置かれています。\n\nA\n\n■\n\n■\n\n■\n\n■\n\nB\n\n■\n\n■\n\n■\n\n■\n\nC\n\n■\n\n■\n\n■\n\n■\n\nD\n\n■\n\n■\n\n■\n\n■\n\nE\n\n■\n\n■\n\n■\n\n■\n\nF\n\n■\n\n■\n\n■\n\n■\n\nG\n\n■\n\n■\n\n■\n\n■\n\nたとえば、次の図 2 の例では E の図形が置かれています。\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n■\n\n■\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n□\n\n図2\n\n平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した数字の列を読み込んで、置かれている図形の種類(A〜G)を出力するプログラムを作成してください。\n\nただし、ひとつの平面に置かれている図形は必ず1つで、複数の図形が置かれていることはありません。また、A〜G で表される図形以外のものが置かれていることはありません。\n\nInput\n\n入力は複数のデータセットからなります。\n\n1つのデータセットとして、平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した 8 文字からなる 8 つの文字列が与えられます。例えば、図 2 に対応する文字列の並びは次のようになります。\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n1\n\n1\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\n0\n\nデータセットの間は1つの空行で区切られています。データセットの数は 50 を超えません。\n\nOutput\n\n各データセットごとに、平面に与えられた図形の種類(A〜G のいずれか)を1行に出力してください。\n\nSample Input\n\n00000000\n00000000\n01100000\n00110000\n00000000\n00000000\n00000000\n00000000\n\n00011110\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n00000000\n\n00000000\n00000000\n00110000\n00110000\n00000000\n00000000\n00000000\n00000000\n\nOutput for the Sample Input\n\nE\nC\nA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1466, "cpu_time_ms": 90, "memory_kb": 16268}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s363500557", "group_id": "codeNet:p00039", "input_text": "for(r={I:1,V:5,X:10,L:50,C:100,D:500,M:1000},k=n=s=0,j=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");p=n,i=j[k];k++)n=r[i]?(s+=n,n>p?s-=p*2:0):(console.log(s),n=s=0)", "language": "JavaScript", "metadata": {"date": 1433897702, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00039.html", "problem_id": "p00039", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00039/input.txt", "sample_output_relpath": "derived/input_output/data/p00039/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00039/JavaScript/s363500557.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s363500557", "user_id": "u340523328"}, "prompt_components": {"gold_output": "4\n499\n499\n", "input_to_evaluate": "for(r={I:1,V:5,X:10,L:50,C:100,D:500,M:1000},k=n=s=0,j=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");p=n,i=j[k];k++)n=r[i]?(s+=n,n>p?s-=p*2:0):(console.log(s),n=s=0)", "problem_context": "ローマ数字\n\n古代ローマでは数を数えることは難しい仕事でした。アラビア数字の 0,1,2,3,…, 9 はまだ流布していませんでした。その代わり次のような記号が使われていました。\n\nアラビア数字\n\nローマ数字\n\nアラビア数字\n\nローマ数字\n\nアラビア数字\n\nローマ数字\n\n1\n\nI\n\n11\nXI\n\n30\n\nXXX\n\n2\n\nII\n\n12\nXII\n\n40\n\nXL\n\n3\n\nIII\n\n13\nXIII\n\n50\n\nL\n\n4\n\nIV\n\n14\nXIV\n\n60\n\nLX\n\n5\n\nV\n\n15\nXV\n\n70\n\nLXX\n\n6\n\nVI\n\n16\nXVI\n\n80\n\nLXXX\n\n7\n\nVII\n\n17\nXVII\n\n90\n\nXC\n\n8\n\nVIII\n\n18\nXVIII\n\n100\n\nC\n\n9\n\nIX\n\n19\nXIX\n\n500\n\nD\n\n10\n\nX\n\n20\nXX\n\n1000\n\nM\n\nI は 1、 V は 5、 X は 10、 L は 50、 C は 100、 D は 500、 M は 1000、 他の例は上の表を見てください。小さい数が大きい数に続いている、つまり右側にあるときは足し算をします。小さい数が大きい数の前に、つまり左にあるときは、大きい数から小さい数を引きます。大きい数字の前にあって引き算を表す小さな数字は一回の引き算あたりひとつしかありません。\n\nローマ数字をアラビア数字(通常の数字)の表記(10 進表示)に変換して出力するプログラムを作成してください。ただし、与えられるローマ数字は上記のルールにのみ従っています(実際のローマ数字の表記にはもっと細かいルールがありますが、ここでは考慮する必要はありません。たとえば、実際のローマ数字ではI はV かX から、X はL かC から、C はD かM からしか引き算しませんし、同じローマ数字は4つ以上(または5つ以上)足し並べることはありません。)\n\nInput\n\n複数のデータセットが与えられます。それぞれのデータセットにローマ数字(半角大文字のI, V, X, L, C, D ,M で表される連続した文字列)が1行に与えられます。与えられるローマ数字の文字列の長さはおのおの 100 以下です。\n\nデータセットの数は 50 を超えません。\n\nOutput\n\n各データセットに対し、アラビア数字(整数)を1行に出力して下さい。\n\nSample Input\n\nIV\nCCCCLXXXXVIIII\nCDXCIX\n\nOutput for the Sample Input\n\n4\n499\n499", "sample_input": "IV\nCCCCLXXXXVIIII\nCDXCIX\n"}, "reference_outputs": ["4\n499\n499\n"], "source_document_id": "p00039", "source_text": "ローマ数字\n\n古代ローマでは数を数えることは難しい仕事でした。アラビア数字の 0,1,2,3,…, 9 はまだ流布していませんでした。その代わり次のような記号が使われていました。\n\nアラビア数字\n\nローマ数字\n\nアラビア数字\n\nローマ数字\n\nアラビア数字\n\nローマ数字\n\n1\n\nI\n\n11\nXI\n\n30\n\nXXX\n\n2\n\nII\n\n12\nXII\n\n40\n\nXL\n\n3\n\nIII\n\n13\nXIII\n\n50\n\nL\n\n4\n\nIV\n\n14\nXIV\n\n60\n\nLX\n\n5\n\nV\n\n15\nXV\n\n70\n\nLXX\n\n6\n\nVI\n\n16\nXVI\n\n80\n\nLXXX\n\n7\n\nVII\n\n17\nXVII\n\n90\n\nXC\n\n8\n\nVIII\n\n18\nXVIII\n\n100\n\nC\n\n9\n\nIX\n\n19\nXIX\n\n500\n\nD\n\n10\n\nX\n\n20\nXX\n\n1000\n\nM\n\nI は 1、 V は 5、 X は 10、 L は 50、 C は 100、 D は 500、 M は 1000、 他の例は上の表を見てください。小さい数が大きい数に続いている、つまり右側にあるときは足し算をします。小さい数が大きい数の前に、つまり左にあるときは、大きい数から小さい数を引きます。大きい数字の前にあって引き算を表す小さな数字は一回の引き算あたりひとつしかありません。\n\nローマ数字をアラビア数字(通常の数字)の表記(10 進表示)に変換して出力するプログラムを作成してください。ただし、与えられるローマ数字は上記のルールにのみ従っています(実際のローマ数字の表記にはもっと細かいルールがありますが、ここでは考慮する必要はありません。たとえば、実際のローマ数字ではI はV かX ��ら、X はL かC から、C はD かM からしか引き算しませんし、同じローマ数字は4つ以上(または5つ以上)足し並べることはありません。)\n\nInput\n\n複数のデータセットが与えられます。それぞれのデータセットにローマ数字(半角大文字のI, V, X, L, C, D ,M で表される連続した文字列)が1行に与えられます。与えられるローマ数字の文字列の長さはおのおの 100 以下です。\n\nデータセットの数は 50 を超えません。\n\nOutput\n\n各データセットに対し、アラビア数字(整数)を1行に出力して下さい。\n\nSample Input\n\nIV\nCCCCLXXXXVIIII\nCDXCIX\n\nOutput for the Sample Input\n\n4\n499\n499", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 167, "cpu_time_ms": 20, "memory_kb": 7648}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s143744061", "group_id": "codeNet:p00042", "input_text": "// 標準入力\nvar fs = require('fs'),\nlength = fs.fstatSync(process.stdin.fd).size,\nbuffer = new Buffer(length),\nbytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\ninput = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n \nfunction main(){\n var read = 0;\n var resultCase = 1;\n while(true){\n var maxWeight = +input[read++];\n if(!maxWeight){\n break;\n }\n \n var treasures = +input[read++];\n var pdp = new Int32Array(maxWeight + 1);\n for(var i = treasures; i--;){\n var c = input[read++].split(\",\");\n var tv = +c[0];\n var tw = +c[1];\n \n var dp = new Int32Array(maxWeight + 1);\n for(var w = 1; w <= maxWeight; w++){\n if(w - tw < 0){\n dp[w] = pdp[w];\n }else{\n dp[w] = max(pdp[w-tw] + tv, pdp[w]);\n }\n }\n pdp = dp;\n }\n \n var resultWeight = 1001;\n var resultCost = 0;\n for(var i = 0; i <= maxWeight; i++){\n if(pdp[i] > resultCost){\n resultCost = pdp[i];\n resultWeight = i;\n }\n }\n \n console.log(\"Case \" + resultCase++ + \":\\n\" + resultCost + \"\\n\" + resultWeight);\n }\n}\n \nfunction max(a, b) {\n var t = a - b;\n return a - (t & (t >> 31));\n}", "language": "JavaScript", "metadata": {"date": 1434166700, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00042.html", "problem_id": "p00042", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00042/input.txt", "sample_output_relpath": "derived/input_output/data/p00042/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00042/JavaScript/s143744061.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s143744061", "user_id": "u340523328"}, "prompt_components": {"gold_output": "Case 1:\n220\n49\nCase 2:\n220\n49\n", "input_to_evaluate": "// 標準入力\nvar fs = require('fs'),\nlength = fs.fstatSync(process.stdin.fd).size,\nbuffer = new Buffer(length),\nbytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\ninput = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n \nfunction main(){\n var read = 0;\n var resultCase = 1;\n while(true){\n var maxWeight = +input[read++];\n if(!maxWeight){\n break;\n }\n \n var treasures = +input[read++];\n var pdp = new Int32Array(maxWeight + 1);\n for(var i = treasures; i--;){\n var c = input[read++].split(\",\");\n var tv = +c[0];\n var tw = +c[1];\n \n var dp = new Int32Array(maxWeight + 1);\n for(var w = 1; w <= maxWeight; w++){\n if(w - tw < 0){\n dp[w] = pdp[w];\n }else{\n dp[w] = max(pdp[w-tw] + tv, pdp[w]);\n }\n }\n pdp = dp;\n }\n \n var resultWeight = 1001;\n var resultCost = 0;\n for(var i = 0; i <= maxWeight; i++){\n if(pdp[i] > resultCost){\n resultCost = pdp[i];\n resultWeight = i;\n }\n }\n \n console.log(\"Case \" + resultCase++ + \":\\n\" + resultCost + \"\\n\" + resultWeight);\n }\n}\n \nfunction max(a, b) {\n var t = a - b;\n return a - (t & (t >> 31));\n}", "problem_context": "泥棒\n\n宝物がたくさん収蔵されている博物館に、泥棒が大きな風呂敷を一つだけ持って忍び込みました。盗み出したいものはたくさんありますが、風呂敷が耐えられる重さが限られており、これを超えると風呂敷が破れてしまいます。そこで泥棒は、用意した風呂敷を破らず且つ最も価値が高くなるようなお宝の組み合わせを考えなくてはな��ません。\n\n風呂敷が耐えられる重さ W、および博物館にある個々のお宝の価値と重さを読み込んで、重さの総和が W を超えない範囲で価値の総和が最大になるときの、お宝の価値総和と重さの総和を出力するプログラムを作成してください。ただし、価値の総和が最大になる組み合わせが複数あるときは、重さの総和が小さいものを出力することとします。\n\nInput\n\n複数のデータセットが与えられます。各データセットは以下のような形式で与えられます。\n\nW\nN\nv1,w1\nv2,w2\n:\nvN,wN\n\n1行目に風呂敷の耐えられる重さを表す整数 W (W ≤ 1,000)、2行目にお宝の数 N (1 ≤ N ≤ 1,000) が与えられます。続く N 行に i 番目のお宝の価値を表す整数 vi (0 ≤ vi ≤ 10,000) とその重さを表す整数 wi (0 ≤ wi ≤ W) の組がそれぞれ1行に与えられます。\n\nW が 0 のとき入力の最後とします。データセットの数は 50 を超えません。\n\nOutput\n\n各データセットに対して以下のように出力して下さい。\n\nCase データセットの番号:\n風呂敷に入れたお宝の価値総和\nそのときのお宝の重さの総和\n\nSample Input\n\n50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0\n\nOutput for the Sample Input\n\nCase 1:\n220\n49\nCase 2:\n220\n49", "sample_input": "50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0\n"}, "reference_outputs": ["Case 1:\n220\n49\nCase 2:\n220\n49\n"], "source_document_id": "p00042", "source_text": "泥棒\n\n宝物がたくさん収蔵されている博物館に、泥棒が大きな風呂敷を一つだけ持って忍び込みました。盗み出したいものはたくさんありますが、風呂敷が耐えられる重さが限られており、これを超えると風呂敷が破れてしまいます。そこで泥棒は、用意した風呂敷を破らず且つ最も価値が高くなるようなお宝の組み合わせを考えなくてはなりません。\n\n風呂敷が耐えられる重さ W、および博物館にある個々のお宝の価値と重さを読み込んで、重さの総和が W を超えない範囲で価値の総和が最大になるときの、お宝の価値総和と重さの総和を出力するプログラムを作成してください。ただし、価値の総和が最大になる組み合わせが複数あるときは、重さの総和が小さいものを出力することとします。\n\nInput\n\n複数のデータセットが与えられます。各データセットは以下のような形式で与えられます。\n\nW\nN\nv1,w1\nv2,w2\n:\nvN,wN\n\n1行目に風呂敷の耐えられる重さを表す整数 W (W ≤ 1,000)、2行目にお宝の数 N (1 ≤ N ≤ 1,000) が与えられます。続く N 行に i 番目のお宝の価値を表す整数 vi (0 ≤ vi ≤ 10,000) とその重さを表す整数 wi (0 ≤ wi ≤ W) の組がそれぞれ1行に与えられます。\n\nW が 0 のとき入力の最後とします。データセットの数は 50 を超えません。\n\nOutput\n\n各データセットに対して以下のように出力して下さい。\n\nCase データセットの番号:\n風呂敷に入れたお宝の価値総和\nそのときのお宝の重さの総和\n\nSample Input\n\n50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n50\n5\n60,10\n100,20\n120,30\n210,45\n10,4\n0\n\nOutput for the Sample Input\n\nCase 1:\n220\n49\nCase 2:\n220\n49", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1205, "cpu_time_ms": 50, "memory_kb": 14400}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s965417163", "group_id": "codeNet:p00046", "input_text": "x=require('fs').readFileSync('/dev/stdin','utf8').split(\"\\n\");x.sort(function(a,b){return b-a;});console.log(Math.ceil((x[0]*1-x[x.length-1]*1)*10)/10);", "language": "JavaScript", "metadata": {"date": 1466991679, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00046.html", "problem_id": "p00046", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00046/input.txt", "sample_output_relpath": "derived/input_output/data/p00046/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00046/JavaScript/s965417163.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s965417163", "user_id": "u149181280"}, "prompt_components": {"gold_output": "3130.8\n", "input_to_evaluate": "x=require('fs').readFileSync('/dev/stdin','utf8').split(\"\\n\");x.sort(function(a,b){return b-a;});console.log(Math.ceil((x[0]*1-x[x.length-1]*1)*10)/10);", "problem_context": "標高差\n\n今まで登ったことのある山の標高を記録したデータがあります。このデータを読み込んで、一番高い山と一番低い山の標高差を出力するプログラムを作成してください。\n\nInput\n\n入力は以下の形式で与えられます。\n\n山の高さ\n...\n...\n\n山の高さが複数行に渡って与えられます。入力される値はすべて 0 以上 1,000,000 以下の実数です。入力される山の高さの数は 50 以下です。\n\nOutput\n\n一番高い山と一番低い山の標高差を実数で出力する。出力は0.01以下の誤差を含んでもよい。\n\nSample Input\n\n3776.0\n1819.0\n645.2\n2004.1\n1208.6\n\nOutput for the Sample Input\n\n3130.8", "sample_input": "3776.0\n1819.0\n645.2\n2004.1\n1208.6\n"}, "reference_outputs": ["3130.8\n"], "source_document_id": "p00046", "source_text": "標高差\n\n今まで登ったことのある山の標高を記録したデータがあります。このデータを読み込んで、一番高い山と一番低い山の標高差を出力するプログラムを作成してください。\n\nInput\n\n入力は以下の形式で与えられます。\n\n山の高さ\n...\n...\n\n山の高さが複数行に渡って与えられます。入力される値はすべて 0 以上 1,000,000 以下の実数です。入力される山の高さの数は 50 以下です。\n\nOutput\n\n一番高い山と一番低い山の標高差を実数で出力する。出力は0.01以下の誤差を含んでもよい。\n\nSample Input\n\n3776.0\n1819.0\n645.2\n2004.1\n1208.6\n\nOutput for the Sample Input\n\n3130.8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 152, "cpu_time_ms": 60, "memory_kb": 15444}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s414081727", "group_id": "codeNet:p00051", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nvar AL=Arr.shift();\nfor(var i=0;i 1) {\n next = [];\n for (var i = 0; i < nums.length - 1; i++) {\n next[i] = (nums[i] + nums[i + 1]) % 10;\n }\n nums = next;\n }\n console.log(nums[0]);\n j++;\n}", "language": "JavaScript", "metadata": {"date": 1444387306, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00062.html", "problem_id": "p00062", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00062/input.txt", "sample_output_relpath": "derived/input_output/data/p00062/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00062/JavaScript/s561545475.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s561545475", "user_id": "u937787275"}, "prompt_components": {"gold_output": "5\n6\n4\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar lines = input.split('\\n');\nvar j = 0;\nwhile (j < lines.length - 1) {\n var str = lines[j];\n var nums = str.split('').map(Number);\n var next;\n while (nums.length > 1) {\n next = [];\n for (var i = 0; i < nums.length - 1; i++) {\n next[i] = (nums[i] + nums[i + 1]) % 10;\n }\n nums = next;\n }\n console.log(nums[0]);\n j++;\n}", "problem_context": "一番下の行の数字は?\n\n次のような数字のパターンを作ることを考えます。\n\n4 8 2 3 1 0 8 3 7 6\n2 0 5 4 1 8 1 0 3\n2 5 9 5 9 9 1 3\n7 4 4 4 8 0 4\n1 8 8 2 8 4\n9 6 0 0 2\n5 6 0 2\n1 6 2\n7 8\n5\n\nこのパターンは以下の規則に従っています。\n\nA B\nC\n\nという数字の並びにおいて、C は A + B の 1 の位の数字である。たとえば、\n\n9 5\n4\n\nでは、9 + 5 = 14 の 1 の位の数字、すなわち 4 が 9 と 5 の斜め下に並べられます。また、\n\n2 3\n5\n\nでは、2 + 3 = 5 の 1 の位の数字、すなわち 5 が 2 と 3 の斜め下に並べられます。\n\n一番上の行の 10 個の整数を読み込んで、一番下の行の 1 個の数を出力するプログラムを作成してください。\n\nInput\n\n入力は複数のデータセットからなります。各データセットとして、一番上の行の 10 個の数字が文字列として1行に与えられます。\n\nデータセットの数は 20 を超えません。\n\nOutput\n\nデータセットごとに、一番下の行の数字を1行に出力します。\n\nSample Input\n\n4823108376\n1234567890\n0123456789\n\nOutput for the Sample Input\n\n5\n6\n4", "sample_input": "4823108376\n1234567890\n0123456789\n"}, "reference_outputs": ["5\n6\n4\n"], "source_document_id": "p00062", "source_text": "一番下の行の数字は?\n\n次のような数字のパターンを作ることを考えます。\n\n4 8 2 3 1 0 8 3 7 6\n2 0 5 4 1 8 1 0 3\n2 5 9 5 9 9 1 3\n7 4 4 4 8 0 4\n1 8 8 2 8 4\n9 6 0 0 2\n5 6 0 2\n1 6 2\n7 8\n5\n\nこのパターンは以下の規則に従っています。\n\nA B\nC\n\nという数字の並びにおいて、C は A + B の 1 の位の数字である。たとえば、\n\n9 5\n4\n\nでは、9 + 5 = 14 の 1 の位の数字、すなわち 4 が 9 と 5 の斜め下に並べられます。また、\n\n2 3\n5\n\nでは、2 + 3 = 5 の 1 の位の数字、すなわち 5 が 2 と 3 の斜め下に並べられます。\n\n一番上の行の 10 個の整数を読み込んで、一番下の行の 1 個の数を出力するプログラムを作成してください。\n\nInput\n\n入力は複数のデータセットからなります。各データセットとして、一番上の行の 10 個の数字が文字列として1行に与えられます。\n\nデータセットの数は 20 を超えません。\n\nOutput\n\nデータセットごとに、一番下の行の数字を1行に出力します。\n\nSample Input\n\n4823108376\n1234567890\n0123456789\n\nOutput for the Sample Input\n\n5\n6\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 405, "cpu_time_ms": 60, "memory_kb": 15356}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s618800264", "group_id": "codeNet:p00064", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();\nvar lines = input.split('\\n');\n\nvar sum = 0;\nvar line;\nwhile (line = lines.shift()) {\n var arr = line.split(/\\D+/);\n sum += arr.reduce(function(p,n){return p + (+n);},0);\n}\nconsole.log(sum);", "language": "JavaScript", "metadata": {"date": 1399298046, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00064.html", "problem_id": "p00064", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00064/input.txt", "sample_output_relpath": "derived/input_output/data/p00064/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00064/JavaScript/s618800264.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s618800264", "user_id": "u845053458"}, "prompt_components": {"gold_output": "123\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();\nvar lines = input.split('\\n');\n\nvar sum = 0;\nvar line;\nwhile (line = lines.shift()) {\n var arr = line.split(/\\D+/);\n sum += arr.reduce(function(p,n){return p + (+n);},0);\n}\nconsole.log(sum);", "problem_context": "暗証番号\n\n新しい暗証番号は覚えにくいものです。メモするのはダメといわれましたが、覚えられそうにありません。そこで文章の中に数値を埋め込んで暗証番号をメモすることにしました。ここでは全ての数値の和が暗証番号になります。\n\nメモされた文章を読み込んで、暗証番号を出力するプログラムを作成してください。\n\nInput\n\n正の整数が埋め込まれた文章が複数行にわたり与えられます。各行は半角英数字、記号、空白を含む文字列または空行です。\nただし、入力は 1 行あたり 80 文字以内で、暗証番号は 10,000 以下であることが保障されています。\n\nOutput\n\n暗証番号(文章中の正の整数の合計)を1行に出力します。\n\nSample Input\n\nThereare100yenonthetable.Iam17yearsold.\nIshouldgohomeat6pm.\n\nOutput for the Sample Input\n\n123", "sample_input": "Thereare100yenonthetable.Iam17yearsold.\nIshouldgohomeat6pm.\n"}, "reference_outputs": ["123\n"], "source_document_id": "p00064", "source_text": "暗証番号\n\n新しい暗証番号は覚えにくいものです。メモするのはダメといわれましたが、覚えられそうにありません。そこで文章の中に数値を埋め込んで暗証番号をメモすることにしました。ここでは全ての数値の和が暗証番号になります。\n\nメモされた文章を読み込んで、暗証番号を出力するプログラムを作成してください。\n\nInput\n\n正の整数が埋め込まれた文章が複数行にわたり与えられます。各行は半角英数字、記号、空白を含む文字列または空行です。\nただし、入力は 1 行あたり 80 文字以内で、暗証番号は 10,000 以下であることが保障されています。\n\nOutput\n\n暗証番号(文章中の正の整数の合計)を1行に出力します。\n\nSample Input\n\nThereare100yenonthetable.Iam17yearsold.\nIshouldgohomeat6pm.\n\nOutput for the Sample Input\n\n123", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 265, "cpu_time_ms": 20, "memory_kb": 7376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s949944092", "group_id": "codeNet:p00086", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();\nvar lines = input.split('\\n');\n\nwhile (lines.length > 0) {\n var path = [];\n var line;\n while ((line = lines.shift()) != '0 0') {\n var nums = line.split(' ');\n var from = +nums[0];\n var to = +nums[1];\n\n path[from] = (path[from] || 0) +1;\n path[to] = (path[to] || 0) +1;\n }\n var odds = path.filter(function(n){return n % 2 == 1});\n if (odds.length > 2)\n console.log('NG');\n else\n console.log('OK');\n}", "language": "JavaScript", "metadata": {"date": 1399554261, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00086.html", "problem_id": "p00086", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00086/input.txt", "sample_output_relpath": "derived/input_output/data/p00086/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00086/JavaScript/s949944092.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s949944092", "user_id": "u845053458"}, "prompt_components": {"gold_output": "OK\nNG\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();\nvar lines = input.split('\\n');\n\nwhile (lines.length > 0) {\n var path = [];\n var line;\n while ((line = lines.shift()) != '0 0') {\n var nums = line.split(' ');\n var from = +nums[0];\n var to = +nums[1];\n\n path[from] = (path[from] || 0) +1;\n path[to] = (path[to] || 0) +1;\n }\n var odds = path.filter(function(n){return n % 2 == 1});\n if (odds.length > 2)\n console.log('NG');\n else\n console.log('OK');\n}", "problem_context": "パトロール\n\n文久2(1862)年、会津の殿様が京都守護職を命ぜられました。京都守護職とは治安の悪化した幕末の京都を守る大切な役目です。幕府や他の藩と分担して市中をパトロールしなければなりません。ところがいざ分担ルートを決める段になって、家臣の中でも有名な頑固者の古老から以下のような注文がつきました。\n\n大変なことになりました。殿様といえどもこの家臣の言い分を無視するわけにはいきません。分担ルートの選択によっては、「武士の面目が立たない」ということになってしまいます。\n\nということで、スタート地点、ゴール地点、交差点の情報を入力として、上の三つの条件を満たすかどうかを判定するプログラムを作って、殿様に献上してください。\n\nスタート地点を 1、ゴール地点を2、その他の交差点を 3 以上の整数で表します。1つの道路は、その道が結ぶ1組の交差点番号で表します。なお、交差点の数は 100 以下とし、全ての交差点からスタート地点およびゴール地点への経路がそれぞれ一つ以上あるものとします。\n\n入力\n\n複数のデータセットが与えられます。各データセットは以下の形式で与えられます。\n\na1 b1\na2 b2\n:\n:\n0 0\n\n各行の2つの整数は、交差点 ai と交差点 bi とをつなぐ道路が存在することを示します。\nai と bi がともに 0 のとき交差点情報の入力の終わりを示します。\n\nデータセットの数は50を超えません。\n\n出力\n\n各データセットに対して、武士の面目が立つ場合(三つの条件を満たす場合)OK、それ以外の場合(三つの条件を満たさない場合)NG と1行に出力してください。\n\nSample Input\n\n1 3\n3 4\n3 5\n3 6\n4 6\n4 7\n4 7\n5 6\n6 7\n5 8\n5 8\n6 8\n6 9\n7 9\n8 9\n9 2\n0 0\n1 3\n3 4\n3 4\n4 2\n0 0\n\nOutput for the Sample Input\n\nOK\nNG", "sample_input": "1 3\n3 4\n3 5\n3 6\n4 6\n4 7\n4 7\n5 6\n6 7\n5 8\n5 8\n6 8\n6 9\n7 9\n8 9\n9 2\n0 0\n1 3\n3 4\n3 4\n4 2\n0 0\n"}, "reference_outputs": ["OK\nNG\n"], "source_document_id": "p00086", "source_text": "パトロール\n\n文久2(1862)年、会津の殿様が京都守護職を命ぜられました。京都守護職とは治安の悪化した幕末の京都を守る大切な役目です。幕府や他の藩と分担して市中をパトロールしなければなりません。ところがいざ分担ルートを決める段になって、家臣の中でも有名な頑固者の古老から以下のような注文がつきました。\n\n大変なことになりました。殿様といえどもこの家臣の言い分を無視するわけにはいきません。分担ルートの選択によっては、「武士の面目が立たない」ということになってしまいます。\n\nということで、スタート地点、ゴール地点、交差点の情報を入力として、上の三つの条件を満たすかどうかを判定するプログラムを作って、殿様に献上してください。\n\nスタート地点を 1、ゴール地点を2、その他の交差点を 3 以上の整数で表します。1つの道路は、その道が結ぶ1組の交差点番号で表します。なお、交差点の数は 100 以下とし、全ての交差点からスタート地点およびゴール地点への経路がそれぞれ一つ以上あるものとします。\n\n入力\n\n複数のデータセットが与えられます。各データセットは以下の形式で与えられます。\n\na1 b1\na2 b2\n:\n:\n0 0\n\n各行の2つの整数は、交差点 ai と交差点 bi とをつなぐ道路が存在することを示します。\nai と bi がともに 0 のとき交差点情報の入力の終わりを示します。\n\nデータセットの数は50を超えません。\n\n出力\n\n各データセットに対して、武士の面目が立つ場合(三つの条件を満たす場合)OK、それ以外の場合(三つの条件を満たさない場合)NG と1行に出力してください。\n\nSample Input\n\n1 3\n3 4\n3 5\n3 6\n4 6\n4 7\n4 7\n5 6\n6 7\n5 8\n5 8\n6 8\n6 9\n7 9\n8 9\n9 2\n0 0\n1 3\n3 4\n3 4\n4 2\n0 0\n\nOutput for the Sample Input\n\nOK\nNG", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 537, "cpu_time_ms": 30, "memory_kb": 9348}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s075726535", "group_id": "codeNet:p00093", "input_text": "function check(x){\nif(x%4!=0)return false;\nif(x%400==0)return true;\nif(x%100==0)return false;\nreturn true;\n}\n\nvar input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nfor(var i=0;i=0;--N){\n var dataset = line[i++].trim().split(\" \");\n res = parseInt(dataset[1]) * parseInt(dataset[2]);\n \n found = 0;\n for(k=0;k= 1000000 ){\n console.log(qualified[k]);\n found = 1;\n }\n }\n if( !found ){\n console.log(\"NA\");\n }\n }\n }\n});", "language": "JavaScript", "metadata": {"date": 1477837129, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00100.html", "problem_id": "p00100", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00100/input.txt", "sample_output_relpath": "derived/input_output/data/p00100/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00100/JavaScript/s274171326.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s274171326", "user_id": "u181366637"}, "prompt_components": {"gold_output": "1001\n1003\nNA\n2013\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(input){\n var line = input.trim().split(\"\\n\");\n var i = 0;\n while(line[i] !== '0')\n {\n var N = parseInt(line[i++].trim());\n {\n var found, len, k, res;\n var qualified = [], amount = [];\n for(--N;N>=0;--N){\n var dataset = line[i++].trim().split(\" \");\n res = parseInt(dataset[1]) * parseInt(dataset[2]);\n \n found = 0;\n for(k=0;k= 1000000 ){\n console.log(qualified[k]);\n found = 1;\n }\n }\n if( !found ){\n console.log(\"NA\");\n }\n }\n }\n});", "problem_context": "Sale Result\n\nThere is data on sales of your company. Your task is to write a program which identifies good workers.\n\nThe program should read a list of data where each item includes the employee ID i, the amount of sales q and the corresponding unit price p. Then, the program should print IDs of employees whose total sales proceeds (i.e. sum of p × q) is greater than or equal to 1,000,000 in the order of inputting. If there is no such employees, the program should print \"NA\". You can suppose that n < 4000, and each employee has an unique ID. The unit price p is less than or equal to 1,000,000 and the amount of sales q is less than or equal to 100,000.\n\nInput\n\nThe input consists of several datasets. The input ends with a line including a single 0. Each dataset consists of:\n\nn (the number of data in the list)\ni p q\ni p q\n:\n:\ni p q\n\nOutput\n\nFor each dataset, print a list of employee IDs or a text \"NA\"\n\nSample Input\n\n4\n1001 2000 520\n1002 1800 450\n1003 1600 625\n1001 200 1220\n2\n1001 100 3\n1005 1000 100\n2\n2013 5000 100\n2013 5000 100\n0\n\nOutput for the Sample Input\n\n1001\n1003\nNA\n2013", "sample_input": "4\n1001 2000 520\n1002 1800 450\n1003 1600 625\n1001 200 1220\n2\n1001 100 3\n1005 1000 100\n2\n2013 5000 100\n2013 5000 100\n0\n"}, "reference_outputs": ["1001\n1003\nNA\n2013\n"], "source_document_id": "p00100", "source_text": "Sale Result\n\nThere is data on sales of your company. Your task is to write a program which identifies good workers.\n\nThe program should read a list of data where each item includes the employee ID i, the amount of sales q and the corresponding unit price p. Then, the program should print IDs of employees whose total sales proceeds (i.e. sum of p × q) is greater than or equal to 1,000,000 in the order of inputting. If there is no such employees, the program should print \"NA\". You can suppose that n < 4000, and each employee has an unique ID. The unit price p is less than or equal to 1,000,000 and the amount of sales q is less than or equal to 100,000.\n\nInput\n\nThe input consists of several datasets. The input ends with a line including a single 0. Each dataset consists of:\n\nn (the number of data in the list)\ni p q\ni p q\n:\n:\ni p q\n\nOutput\n\nFor each dataset, print a list of employee IDs or a text \"NA\"\n\nSample Input\n\n4\n1001 2000 520\n1002 1800 450\n1003 1600 625\n1001 200 1220\n2\n1001 100 3\n1005 1000 100\n2\n2013 5000 100\n2013 5000 100\n0\n\nOutput for the Sample Input\n\n1001\n1003\nNA\n2013", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1303, "cpu_time_ms": 100, "memory_kb": 17480}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s925240258", "group_id": "codeNet:p00103", "input_text": "var print = console.log;\n\nfunction read_input(_input) {\n var lines = _input.split(\"\\n\");\n var i = 0;\n return function () {\n return lines[i++];\n };\n}\n\nString.prototype.dot = function dot(x) {\n var res = \"\";\n for (var i = 0; i < x; i++) {\n res += this.toString();\n }\n return res;\n};\n\nfunction IL(line, min1Flg) {\n var s = line.split(' ');\n var offset = min1Flg ? -1 : 0;\n var res = [];\n for (var i = 0; i < s.length; i++) {\n res.push(parseInt(s[i]));\n }\n return res;\n}\n\nfunction range(i, n) {\n var res = [];\n for (; i < n; i++) {\n res.push(i);\n }\n return res;\n}\n\nfunction IMAX(x, y) {\n return x > y ? x : y;\n}\n\nfunction IMIN(x, y) {\n return x < y ? x : y;\n}\n\nfunction item_getter_key(x) {\n return function (a, b) {\n if (a[x] < b[x]) return -1;\n else if (a[x] > b[x]) return 1;\n return 0;\n };\n}\n\n/*\n\n(((???????????)??? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\n\n*/\n\n\n// input?????\\??????????????¨????????\\???\nfunction Main(_input) {\n var input = read_input(_input); // input = ?????????????????¢??°\n var N = parseInt(input());\n for (var i = 0; i < N ; i++) {\n var out = 0;\n var runner = 0;\n var pt = 0;\n while (out < 3) {\n var v = input();\n if (v === 'HIT') {\n if (runner === 3) {\n pt += 1;\n } else {\n runner++;\n }\n } else if (v === 'HOMERUN') {\n pt += runner + 1;\n runner = 0;\n } else {\n out++;\n }\n }\n print(pt);\n }\n\n}\n\n//*???????????\\????????¨??????????????§????????????????¨??????\\????????????????????????????????????Main????????????????????????\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n//Main(require(\"fs\").readFileSync(\"input.txt\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1501493713, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00103.html", "problem_id": "p00103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00103/input.txt", "sample_output_relpath": "derived/input_output/data/p00103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00103/JavaScript/s925240258.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s925240258", "user_id": "u766477342"}, "prompt_components": {"gold_output": "7\n0\n", "input_to_evaluate": "var print = console.log;\n\nfunction read_input(_input) {\n var lines = _input.split(\"\\n\");\n var i = 0;\n return function () {\n return lines[i++];\n };\n}\n\nString.prototype.dot = function dot(x) {\n var res = \"\";\n for (var i = 0; i < x; i++) {\n res += this.toString();\n }\n return res;\n};\n\nfunction IL(line, min1Flg) {\n var s = line.split(' ');\n var offset = min1Flg ? -1 : 0;\n var res = [];\n for (var i = 0; i < s.length; i++) {\n res.push(parseInt(s[i]));\n }\n return res;\n}\n\nfunction range(i, n) {\n var res = [];\n for (; i < n; i++) {\n res.push(i);\n }\n return res;\n}\n\nfunction IMAX(x, y) {\n return x > y ? x : y;\n}\n\nfunction IMIN(x, y) {\n return x < y ? x : y;\n}\n\nfunction item_getter_key(x) {\n return function (a, b) {\n if (a[x] < b[x]) return -1;\n else if (a[x] > b[x]) return 1;\n return 0;\n };\n}\n\n/*\n\n(((???????????)??? ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????\n\n*/\n\n\n// input?????\\??????????????¨????????\\???\nfunction Main(_input) {\n var input = read_input(_input); // input = ?????????????????¢??°\n var N = parseInt(input());\n for (var i = 0; i < N ; i++) {\n var out = 0;\n var runner = 0;\n var pt = 0;\n while (out < 3) {\n var v = input();\n if (v === 'HIT') {\n if (runner === 3) {\n pt += 1;\n } else {\n runner++;\n }\n } else if (v === 'HOMERUN') {\n pt += runner + 1;\n runner = 0;\n } else {\n out++;\n }\n }\n print(pt);\n }\n\n}\n\n//*???????????\\????????¨??????????????§????????????????¨??????\\????????????????????????????????????Main????????????????????????\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n//Main(require(\"fs\").readFileSync(\"input.txt\", \"utf8\"));", "problem_context": "Baseball Simulation\n\nIchiro likes baseball and has decided to write a program which simulates baseball.\n\nThe program reads events in an inning and prints score in that inning. There are only three events as follows:\n\nSingle hit\n\nput a runner on the first base.\n\nthe runner in the first base advances to the second base and the runner in the second base advances to the third base.\n\nthe runner in the third base advances to the home base (and go out of base) and a point is added to the score.\n\nHome run\n\nall the runners on base advance to the home base.\n\npoints are added to the score by an amount equal to the number of the runners plus one.\n\nOut\n\nThe number of outs is increased by 1.\n\nThe runners and the score remain stationary.\n\nThe inning ends with three-out.\n\nIchiro decided to represent these events using \"HIT\", \"HOMERUN\" and \"OUT\", respectively.\n\nWrite a program which reads events in an inning and prints score in that inning. You can assume that the number of events is less than or equal to 100.\n\nInput\n\nThe input consists of several datasets. In the first line, the number of datasets n is given. Each dataset consists of a list of events (strings) in an inning.\n\nOutput\n\nFor each dataset, prints the score in the corresponding inning.\n\nSample Input\n\n2\nHIT\nOUT\nHOMERUN\nHIT\nHIT\nHOMERUN\nHIT\nOUT\nHIT\nHIT\nHIT\nHIT\nOUT\nHIT\nHIT\nOUT\nHIT\nOUT\nOUT\n\nOutput for the Sample Input\n\n7\n0", "sample_input": "2\nHIT\nOUT\nHOMERUN\nHIT\nHIT\nHOMERUN\nHIT\nOUT\nHIT\nHIT\nHIT\nHIT\nOUT\nHIT\nHIT\nOUT\nHIT\nOUT\nOUT\n"}, "reference_outputs": ["7\n0\n"], "source_document_id": "p00103", "source_text": "Baseball Simulation\n\nIchiro likes baseball and has decided to write a program which simulates baseball.\n\nThe program reads events in an inning and prints score in that inning. There are only three events as follows:\n\nSingle hit\n\nput a runner on the first base.\n\nthe runner in the first base advances to the second base and the runner in the second base advances to the third base.\n\nthe runner in the third base advances to the home base (and go out of base) and a point is added to the score.\n\nHome run\n\nall the runners on base advance to the home base.\n\npoints are added to the score by an amount equal to the number of the runners plus one.\n\nOut\n\nThe number of outs is increased by 1.\n\nThe runners and the score remain stationary.\n\nThe inning ends with three-out.\n\nIchiro decided to represent these events using \"HIT\", \"HOMERUN\" and \"OUT\", respectively.\n\nWrite a program which reads events in an inning and prints score in that inning. You can assume that the number of events is less than or equal to 100.\n\nInput\n\nThe input consists of several datasets. In the first line, the number of datasets n is given. Each dataset consists of a list of events (strings) in an inning.\n\nOutput\n\nFor each dataset, prints the score in the corresponding inning.\n\nSample Input\n\n2\nHIT\nOUT\nHOMERUN\nHIT\nHIT\nHOMERUN\nHIT\nOUT\nHIT\nHIT\nHIT\nHIT\nOUT\nHIT\nHIT\nOUT\nHIT\nOUT\nOUT\n\nOutput for the Sample Input\n\n7\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1995, "cpu_time_ms": 60, "memory_kb": 15480}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s308322390", "group_id": "codeNet:p00105", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nvar obj={};\nfor(var i=0;i1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (var e = 0; e < 3; e++) {\n // ex->e(x+1)\n var now = (first + e) % 5;\n var next = (now + 1) % 5;\n\n for (var j = 0, nowLength = elem[now].length; j < nowLength; j++) {\n for (var k = 0, nextLength = elem[next].length; k < nextLength; k++) {\n dp[next][k] = min(\n dp[next][k],\n dp[now][j] + \n dist(elem[now][j], elem[next][k]));\n }\n }\n }\n \n var last = (first + 3) % 5;\n var lastLength = elem[last].length;\n for (var j = 0; j < lastLength; j++) {\n // e4->g\n var d = dp[last][j] + \n dist(elem[last][j], goal);\n \n if (d < distance) {\n distance = d;\n bestElement = startElem + 1;\n }\n \n }\n \n }\n \n if (distance == Infinity) {\n console.log(\"NA\");\n } else {\n console.log(bestElement + \" \" + distance);\n }\n\n i++;\n }\n \n\n}\n\nfunction dist(from, to){\n return Math.abs(from.x - to.x) + Math.abs(from.y - to.y)\n}\n\nfunction min(a1, a2){\n return a1 < a2 ? a1 : a2;\n}\n\nfunction Pos(a, b){\n this.x = a;\n this.y = b;\n}\n\nvar\ninput = '';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "language": "JavaScript", "metadata": {"date": 1428482579, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00215.html", "problem_id": "p00215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00215/input.txt", "sample_output_relpath": "derived/input_output/data/p00215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00215/JavaScript/s089189061.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s089189061", "user_id": "u340523328"}, "prompt_components": {"gold_output": "2 10\nNA\n", "input_to_evaluate": "function main(){\n var i = 0;\n while(true){\n var fieldInfo = input[i].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n\n // 0 0が入力された\n if(!width && !height){\n break;\n }\n\n var start;\n var goal;\n var elem = [[],[],[],[],[]];\n for(var ei = 0;ei < 5; ei++){\n elem[ei].length = 0;\n }\n \n for(var y = 0; y < height; y++){\n i++;//1行進める\n for(var x = 0; x < width; x++){\n var c = input[i][x];\n\n switch(c){\n case 'S':\n start = new Pos(x, y);\n break;\n case 'G':\n goal = new Pos(x, y);\n break;\n case '.':\n break;\n default : // 入力値が正しいので、絶対に属性\n elem[c-1][elem[c-1].length] = new Pos(x, y);\n break;\n }\n }\n }\n\n \n var bestElement = -1;\n var distance = Infinity;\n \n // 属性ごとにループ\n for (var startElem = 0; startElem < 5; startElem++) {\n // DPの初期化 DP[属性][同じ属性内の連番]\n var dp = [[],[],[],[],[]];\n for(var h = 0; h < 5; h++){\n var hLength = elem[h].length;\n dp[h].length = hLength;\n for(var hidx = 0; hidx < hLength; hidx++){\n dp[h][hidx] = Infinity;\n }\n }\n \n // 最初に選んだパチモンから次に捕まえられる属性番号\n var first = (startElem + 1) % 5;\n\n for (var j = 0, firstLength = elem[first].length; j < firstLength; j++) {\n // s→e1を計算\n dp[first][j] = dist(start, elem[first][j]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (var e = 0; e < 3; e++) {\n // ex->e(x+1)\n var now = (first + e) % 5;\n var next = (now + 1) % 5;\n\n for (var j = 0, nowLength = elem[now].length; j < nowLength; j++) {\n for (var k = 0, nextLength = elem[next].length; k < nextLength; k++) {\n dp[next][k] = min(\n dp[next][k],\n dp[now][j] + \n dist(elem[now][j], elem[next][k]));\n }\n }\n }\n \n var last = (first + 3) % 5;\n var lastLength = elem[last].length;\n for (var j = 0; j < lastLength; j++) {\n // e4->g\n var d = dp[last][j] + \n dist(elem[last][j], goal);\n \n if (d < distance) {\n distance = d;\n bestElement = startElem + 1;\n }\n \n }\n \n }\n \n if (distance == Infinity) {\n console.log(\"NA\");\n } else {\n console.log(bestElement + \" \" + distance);\n }\n\n i++;\n }\n \n\n}\n\nfunction dist(from, to){\n return Math.abs(from.x - to.x) + Math.abs(from.y - to.y)\n}\n\nfunction min(a1, a2){\n return a1 < a2 ? a1 : a2;\n}\n\nfunction Pos(a, b){\n this.x = a;\n this.y = b;\n}\n\nvar\ninput = '';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "problem_context": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "sample_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\n"}, "reference_outputs": ["2 10\nNA\n"], "source_document_id": "p00215", "source_text": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3087, "cpu_time_ms": 3380, "memory_kb": 63484}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s022577899", "group_id": "codeNet:p00215", "input_text": "function main(){\n var i = 0;\n while(true){\n var fieldInfo = input[i].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n var start;\n var goal;\n var elem = [[],[],[],[],[]];\n\n var y = height;\n for(; y--;){\n i++;//1行進める\n var x = width;\n for(;x--;){\n var c = input[i][x];\n \n switch(c){\n case '.':// ドットが一番多いから先にひっかけよう\n break;\n case 'S':\n start = pos(x, y);\n break;\n case 'G':\n goal = pos(x, y);\n break;\n default : // 入力値が正しいので、絶対に属性\n elem[c - 1][elem[c - 1].length] = pos(x, y);\n break;\n }\n }\n }\n \n var INF = 1 << 30;\n var bestElement = -1;\n var distance = INF;\n \n // 属性ごとにループ\n for (var startElem = 0; startElem < 5; startElem++) {\n // DPの初期化 DP[属性][同じ属性内の連番]\n var dp = [[],[],[],[],[]];\n for(var h = 0; h < 5; h++){\n var hLength = elem[h].length;\n dp[h].length = hLength;\n for(var hidx = 0; hidx < hLength; hidx++){\n dp[h][hidx] = INF;\n }\n }\n \n // 最初に選んだパチモンから次に捕まえられる属性番号\n var first = (startElem + 1) % 5;\n \n var firstLength = elem[first].length;\n for (var j = 0; j < firstLength; j++) {\n // s→e1を計算\n dp[first][j] = dist(start, elem[first][j]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (var e = 0; e < 3; e++) {\n // ex->e(x+1)\n var now = (first + e) % 5;\n var next = (now + 1) % 5;\n var nowLength = elem[now].length;\n var nextLength = elem[next].length;\n for (var j = 0; j < nowLength; j++) {\n for (var k = 0; k < nextLength; k++) {\n dp[next][k] = fmin(\n dp[next][k],\n dp[now][j] + \n dist(elem[now][j], elem[next][k]));\n }\n }\n }\n \n var last = (first + 3) % 5;\n var lastLength = elem[last].length;\n for (var j = 0; j < lastLength; j++) {\n // e4->g\n var d = dp[last][j] + \n dist(elem[last][j], goal);\n \n if (d < distance) {\n distance = d;\n bestElement = startElem + 1;\n }\n \n }\n \n }\n \n if (distance == INF) {\n console.log(\"NA\");\n } else {\n console.log(bestElement + \" \" + distance);\n }\n \n i++;\n }\n \n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return fabs((from >> 11) - (to >> 11)) + fabs((from & 2047) - (to & 2047));\n}\n \nfunction fmin(a, b){\n // ビット演算で高速化\n var t = a - b;\n return b + (t & (t >> 31));\n}\n \nfunction pos(a, b){\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n \nfunction fabs(a){\n // ビット演算で高速化\n var mask = a >> 31;\n return (a ^ mask) - mask;\n}\n \nvar\ninput = '';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "language": "JavaScript", "metadata": {"date": 1429098710, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00215.html", "problem_id": "p00215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00215/input.txt", "sample_output_relpath": "derived/input_output/data/p00215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00215/JavaScript/s022577899.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s022577899", "user_id": "u340523328"}, "prompt_components": {"gold_output": "2 10\nNA\n", "input_to_evaluate": "function main(){\n var i = 0;\n while(true){\n var fieldInfo = input[i].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n var start;\n var goal;\n var elem = [[],[],[],[],[]];\n\n var y = height;\n for(; y--;){\n i++;//1行進める\n var x = width;\n for(;x--;){\n var c = input[i][x];\n \n switch(c){\n case '.':// ドットが一番多いから先にひっかけよう\n break;\n case 'S':\n start = pos(x, y);\n break;\n case 'G':\n goal = pos(x, y);\n break;\n default : // 入力値が正しいので、絶対に属性\n elem[c - 1][elem[c - 1].length] = pos(x, y);\n break;\n }\n }\n }\n \n var INF = 1 << 30;\n var bestElement = -1;\n var distance = INF;\n \n // 属性ごとにループ\n for (var startElem = 0; startElem < 5; startElem++) {\n // DPの初期化 DP[属性][同じ属性内の連番]\n var dp = [[],[],[],[],[]];\n for(var h = 0; h < 5; h++){\n var hLength = elem[h].length;\n dp[h].length = hLength;\n for(var hidx = 0; hidx < hLength; hidx++){\n dp[h][hidx] = INF;\n }\n }\n \n // 最初に選んだパチモンから次に捕まえられる属性番号\n var first = (startElem + 1) % 5;\n \n var firstLength = elem[first].length;\n for (var j = 0; j < firstLength; j++) {\n // s→e1を計算\n dp[first][j] = dist(start, elem[first][j]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (var e = 0; e < 3; e++) {\n // ex->e(x+1)\n var now = (first + e) % 5;\n var next = (now + 1) % 5;\n var nowLength = elem[now].length;\n var nextLength = elem[next].length;\n for (var j = 0; j < nowLength; j++) {\n for (var k = 0; k < nextLength; k++) {\n dp[next][k] = fmin(\n dp[next][k],\n dp[now][j] + \n dist(elem[now][j], elem[next][k]));\n }\n }\n }\n \n var last = (first + 3) % 5;\n var lastLength = elem[last].length;\n for (var j = 0; j < lastLength; j++) {\n // e4->g\n var d = dp[last][j] + \n dist(elem[last][j], goal);\n \n if (d < distance) {\n distance = d;\n bestElement = startElem + 1;\n }\n \n }\n \n }\n \n if (distance == INF) {\n console.log(\"NA\");\n } else {\n console.log(bestElement + \" \" + distance);\n }\n \n i++;\n }\n \n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return fabs((from >> 11) - (to >> 11)) + fabs((from & 2047) - (to & 2047));\n}\n \nfunction fmin(a, b){\n // ビット演算で高速化\n var t = a - b;\n return b + (t & (t >> 31));\n}\n \nfunction pos(a, b){\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n \nfunction fabs(a){\n // ビット演算で高速化\n var mask = a >> 31;\n return (a ^ mask) - mask;\n}\n \nvar\ninput = '';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "problem_context": "パ���モンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "sample_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\n"}, "reference_outputs": ["2 10\nNA\n"], "source_document_id": "p00215", "source_text": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大���きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3627, "cpu_time_ms": 2380, "memory_kb": 51192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s854215905", "group_id": "codeNet:p00215", "input_text": "function main(){\n var i = 0;\n while(true){\n var fieldInfo = input[i].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n var start;\n var goal;\n var elem = [[],[],[],[],[]];\n \n var c;\n for(var y = height; y--;){\n i++;//1行進める\n var ni = input[i];\n for(var x = 0; x < width; x++){// なぜか順列アクセスの方が早い\n c = ni[x];\n \n if(c === '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c === '1' || c === '2' || c === '3' || c === '4' || c === '5'){\n // 次に多いはずの属性を潰す\n // FIXME:判定条件は最適化できそう\n var e = elem[c - 1];\n e[e.length] = pos(x, y);\n }else if(c === 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n var INF = 1 << 30;\n var bestElement = -1;\n var distance = INF;\n \n // 属性ごとにループ\n for (var startElem = 0; startElem < 5; startElem++) {\n // DPの初期化 DP[属性][同じ属性内の連番]\n var dp = [[],[],[],[],[]];\n for(var h = 0; h < 5; h++){\n var hLength = elem[h].length;\n dp[h].length = hLength;\n for(var hidx = 0; hidx < hLength; hidx++){\n dp[h][hidx] = INF;// ここでは配列キャッシュしないほうが早い\n }\n }\n \n // 最初に選んだパチモンから次に捕まえられる属性番号\n var first = (startElem + 1) % 5;\n \n var firstLength = elem[first].length;\n var dpf = dp[first];\n var elemf = elem[first];\n for (var j = 0; j < firstLength; j++) {\n // s→e1を計算\n dpf[j] = dist(start, elemf[j]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (var e = 0; e < 3; e++) {\n // ex->e(x+1)\n var now = (first + e) % 5;\n var next = (now + 1) % 5;\n var dpnw = dp[now];\n var dpnx = dp[next];\n var elnw = elem[now];\n var elnx = elem[next];\n var nowLength = elnw.length;\n var nextLength = elnx.length;\n for (var j = 0; j < nowLength; j++) {\n var dpnwj = dpnw[j];\n var elnwj = elnw[j];\n for (var k = 0; k < nextLength; k++) {\n var dpnxk = dpnx[k];\n dpnxk = fmin(\n dpnxk,\n dpnwj + \n dist(elnwj, elnx[k]));\n }\n }\n }\n \n var last = (first + 3) % 5;\n var lastLength = elem[last].length;\n var dpl = dp[last];\n var ell = elem[last];\n for (var j = 0; j < lastLength; j++) {\n // e4->g\n var d = dpl[j] + \n dist(ell[j], goal);\n \n if (d < distance) {\n distance = d;\n bestElement = startElem + 1;\n }\n \n }\n \n }\n \n if (distance == INF) {\n console.log(\"NA\");\n } else {\n console.log(bestElement + \" \" + distance);\n }\n \n i++;\n }\n \n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return fabs((from >> 11) - (to >> 11)) + fabs((from & 2047) - (to & 2047));\n}\n \nfunction fmin(a, b){\n // ビット演算で高速化\n var t = a - b;\n return b + (t & (t >> 31));\n}\n \nfunction pos(a, b){\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n \nfunction fabs(a){\n // ビット演算で高速化\n var mask = a >> 31;\n return (a ^ mask) - mask;\n}\n \nvar\ninput = '';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "language": "JavaScript", "metadata": {"date": 1429159205, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00215.html", "problem_id": "p00215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00215/input.txt", "sample_output_relpath": "derived/input_output/data/p00215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00215/JavaScript/s854215905.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s854215905", "user_id": "u340523328"}, "prompt_components": {"gold_output": "2 10\nNA\n", "input_to_evaluate": "function main(){\n var i = 0;\n while(true){\n var fieldInfo = input[i].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n var start;\n var goal;\n var elem = [[],[],[],[],[]];\n \n var c;\n for(var y = height; y--;){\n i++;//1行進める\n var ni = input[i];\n for(var x = 0; x < width; x++){// なぜか順列アクセスの方が早い\n c = ni[x];\n \n if(c === '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c === '1' || c === '2' || c === '3' || c === '4' || c === '5'){\n // 次に多いはずの属性を潰す\n // FIXME:判定条件は最適化できそう\n var e = elem[c - 1];\n e[e.length] = pos(x, y);\n }else if(c === 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n var INF = 1 << 30;\n var bestElement = -1;\n var distance = INF;\n \n // 属性ごとにループ\n for (var startElem = 0; startElem < 5; startElem++) {\n // DPの初期化 DP[属性][同じ属性内の連番]\n var dp = [[],[],[],[],[]];\n for(var h = 0; h < 5; h++){\n var hLength = elem[h].length;\n dp[h].length = hLength;\n for(var hidx = 0; hidx < hLength; hidx++){\n dp[h][hidx] = INF;// ここでは配列キャッシュしないほうが早い\n }\n }\n \n // 最初に選んだパチモンから次に捕まえられる属性番号\n var first = (startElem + 1) % 5;\n \n var firstLength = elem[first].length;\n var dpf = dp[first];\n var elemf = elem[first];\n for (var j = 0; j < firstLength; j++) {\n // s→e1を計算\n dpf[j] = dist(start, elemf[j]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (var e = 0; e < 3; e++) {\n // ex->e(x+1)\n var now = (first + e) % 5;\n var next = (now + 1) % 5;\n var dpnw = dp[now];\n var dpnx = dp[next];\n var elnw = elem[now];\n var elnx = elem[next];\n var nowLength = elnw.length;\n var nextLength = elnx.length;\n for (var j = 0; j < nowLength; j++) {\n var dpnwj = dpnw[j];\n var elnwj = elnw[j];\n for (var k = 0; k < nextLength; k++) {\n var dpnxk = dpnx[k];\n dpnxk = fmin(\n dpnxk,\n dpnwj + \n dist(elnwj, elnx[k]));\n }\n }\n }\n \n var last = (first + 3) % 5;\n var lastLength = elem[last].length;\n var dpl = dp[last];\n var ell = elem[last];\n for (var j = 0; j < lastLength; j++) {\n // e4->g\n var d = dpl[j] + \n dist(ell[j], goal);\n \n if (d < distance) {\n distance = d;\n bestElement = startElem + 1;\n }\n \n }\n \n }\n \n if (distance == INF) {\n console.log(\"NA\");\n } else {\n console.log(bestElement + \" \" + distance);\n }\n \n i++;\n }\n \n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return fabs((from >> 11) - (to >> 11)) + fabs((from & 2047) - (to & 2047));\n}\n \nfunction fmin(a, b){\n // ビット演算で高速化\n var t = a - b;\n return b + (t & (t >> 31));\n}\n \nfunction pos(a, b){\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n \nfunction fabs(a){\n // ビット演算で高速化\n var mask = a >> 31;\n return (a ^ mask) - mask;\n}\n \nvar\ninput = '';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "problem_context": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です���各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "sample_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\n"}, "reference_outputs": ["2 10\nNA\n"], "source_document_id": "p00215", "source_text": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4190, "cpu_time_ms": 1170, "memory_kb": 51460}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s178899973", "group_id": "codeNet:p00215", "input_text": "// 標準入力\nvar fs = require('fs'),\n length = fs.fstatSync(process.stdin.fd).size,\n buffer = new Buffer(length),\n bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\n input = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n \n// ここから\nfunction main(){\n var readLines = 0;\n while(true){\n var fieldInfo = input[readLines].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n // 変数宣言纏めたら早い?\n var start;\n var goal;\n var elem = [[],[],[],[],[]]; // 場にいるパチモン[属性][属性内連番]\n var c;\n var rowData;\n var elemCache;\n var y;\n var x;\n \n for(y = height; y--;){// reverse loop\n readLines++;//1行進める\n rowData = input[readLines];\n for(x = width; x--;){// reverse loop\n c = rowData[x];\n \n if(c == '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c == '1' || c == '2' || c == '3' || c == '4' || c == '5'){\n // 次に多いはずの属性を潰す\n elemCache = elem[c - 1];\n elemCache[elemCache.length] = pos(x, y);\n }else if(c == 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n // ブロックスコープが無いから変数宣言をまとめる\n var INF = 1 << 30;\n var bestElement = -1;\n var currentDisance;\n var nearestDistance = INF;\n var dp; // 距離[属性][同じ属性内の連番]\n var i; // loop index\n var j;\n var e;\n var len;\n var dpCacheNow; // cache of dp[i] for loop\n var dpCacheNowi; // cache of dp[now][i]\n var dpCacheNext; // cache of dp[i + 1] for loop\n var elemCacheNow;\n var elemCacheNowi; // cache of elem[now][i]\n var elemCacheNext;\n var now;\n var nowLength;\n var next;\n var nextLength;\n \n // 最初に選ぶ属性ごとにループ\n for (var selectElem = 0; selectElem < 5; selectElem++) {\n dp = [[],[],[],[],[]]; // 距離[属性][同じ属性内の連番]\n \n for(i = 5; i--;){// reverse loop\n len = elem[i].length;\n dpCache = dp[i];\n dpCache.length = len;\n for(;len--;){// reverse loop\n dpCache[len] = INF;\n }\n }\n \n now = (selectElem + 1) % 5;\n nowLength = elem[now].length;\n dpCacheNow = dp[now];\n elemCacheNow= elem[now];\n \n for (i = 0; i < nowLength; i++) {\n // s→e1を計算\n dpCacheNow[i] = dist(start, elemCacheNow[i]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (e = 0; e < 3; e++) {\n // e(x)->e(x+1)\n next = (now + 1) % 5;\n dpCacheNext = dp[next];\n elemCacheNext = elem[next];\n nextLength = elemCacheNext.length;\n for (i = 0; i < nowLength; i++) {\n dpCacheNowi = dpCacheNow[i];\n elemCacheNowi = elemCacheNow[i];\n \n if(dpCacheNowi < nearestDistance){// 既に決まっている最短距離を超えたら絶対に候補ではない\n for (j = 0; j < nextLength; j++) {\n dpCacheNext[j] = min(dpCacheNext[j], dpCacheNowi + dist(elemCacheNowi, elemCacheNext[j])); // メモと新しい経路の最短\n }\n }\n }\n \n now = next;\n dpCacheNow = dpCacheNext;\n elemCacheNow = elemCacheNext;\n nowLength = nextLength;\n }\n \n for (i = 0; i < nextLength; i++) {\n // e4->g\n currentDistance = dpCacheNext[i] + dist(elemCacheNext[i], goal);\n \n if (currentDistance < nearestDistance) {\n nearestDistance = currentDistance;\n bestElement = selectElem;\n }\n \n }\n \n }\n \n if (nearestDistance == INF) {\n console.log(\"NA\");\n } else {\n console.log((bestElement + 1) + \" \" + nearestDistance);\n }\n \n readLines++;\n }\n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(12ビット右シフトでxを、4095(下位11ビット1)とのAND演算でyを取り出す)\n return abs((from - to) >> 12) + abs((from - to) & 4095);\n}\n \nfunction min(a, b){\n // ビット演算で高速化\n return b + ((a - b) & ((a - b) >> 31));// 変数宣言よりもこっちの方が高速\n}\n \nfunction pos(a, b){\n // オブジェクトのインスタンス作るよりもプリミティブの方が早い\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n // 計算のため、余裕をもって12ビットシフト\n return (a << 12) + b;\n}\n \nfunction abs(a){\n // ビット演算で高速化\n return (a ^ (a >> 31)) - (a >> 31);// これも\n}", "language": "JavaScript", "metadata": {"date": 1429265759, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00215.html", "problem_id": "p00215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00215/input.txt", "sample_output_relpath": "derived/input_output/data/p00215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00215/JavaScript/s178899973.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s178899973", "user_id": "u340523328"}, "prompt_components": {"gold_output": "2 10\nNA\n", "input_to_evaluate": "// 標準入力\nvar fs = require('fs'),\n length = fs.fstatSync(process.stdin.fd).size,\n buffer = new Buffer(length),\n bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\n input = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n \n// ここから\nfunction main(){\n var readLines = 0;\n while(true){\n var fieldInfo = input[readLines].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n // 変数宣言纏めたら早い?\n var start;\n var goal;\n var elem = [[],[],[],[],[]]; // 場にいるパチモン[属性][属性内連番]\n var c;\n var rowData;\n var elemCache;\n var y;\n var x;\n \n for(y = height; y--;){// reverse loop\n readLines++;//1行進める\n rowData = input[readLines];\n for(x = width; x--;){// reverse loop\n c = rowData[x];\n \n if(c == '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c == '1' || c == '2' || c == '3' || c == '4' || c == '5'){\n // 次に多いはずの属性を潰す\n elemCache = elem[c - 1];\n elemCache[elemCache.length] = pos(x, y);\n }else if(c == 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n // ブロックスコープが無いから変数宣言をまとめる\n var INF = 1 << 30;\n var bestElement = -1;\n var currentDisance;\n var nearestDistance = INF;\n var dp; // 距離[属性][同じ属性内の連番]\n var i; // loop index\n var j;\n var e;\n var len;\n var dpCacheNow; // cache of dp[i] for loop\n var dpCacheNowi; // cache of dp[now][i]\n var dpCacheNext; // cache of dp[i + 1] for loop\n var elemCacheNow;\n var elemCacheNowi; // cache of elem[now][i]\n var elemCacheNext;\n var now;\n var nowLength;\n var next;\n var nextLength;\n \n // 最初に選ぶ属性ごとにループ\n for (var selectElem = 0; selectElem < 5; selectElem++) {\n dp = [[],[],[],[],[]]; // 距離[属性][同じ属性内の連番]\n \n for(i = 5; i--;){// reverse loop\n len = elem[i].length;\n dpCache = dp[i];\n dpCache.length = len;\n for(;len--;){// reverse loop\n dpCache[len] = INF;\n }\n }\n \n now = (selectElem + 1) % 5;\n nowLength = elem[now].length;\n dpCacheNow = dp[now];\n elemCacheNow= elem[now];\n \n for (i = 0; i < nowLength; i++) {\n // s→e1を計算\n dpCacheNow[i] = dist(start, elemCacheNow[i]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (e = 0; e < 3; e++) {\n // e(x)->e(x+1)\n next = (now + 1) % 5;\n dpCacheNext = dp[next];\n elemCacheNext = elem[next];\n nextLength = elemCacheNext.length;\n for (i = 0; i < nowLength; i++) {\n dpCacheNowi = dpCacheNow[i];\n elemCacheNowi = elemCacheNow[i];\n \n if(dpCacheNowi < nearestDistance){// 既に決まっている最短距離を超えたら絶対に候補ではない\n for (j = 0; j < nextLength; j++) {\n dpCacheNext[j] = min(dpCacheNext[j], dpCacheNowi + dist(elemCacheNowi, elemCacheNext[j])); // メモと新しい経路の最短\n }\n }\n }\n \n now = next;\n dpCacheNow = dpCacheNext;\n elemCacheNow = elemCacheNext;\n nowLength = nextLength;\n }\n \n for (i = 0; i < nextLength; i++) {\n // e4->g\n currentDistance = dpCacheNext[i] + dist(elemCacheNext[i], goal);\n \n if (currentDistance < nearestDistance) {\n nearestDistance = currentDistance;\n bestElement = selectElem;\n }\n \n }\n \n }\n \n if (nearestDistance == INF) {\n console.log(\"NA\");\n } else {\n console.log((bestElement + 1) + \" \" + nearestDistance);\n }\n \n readLines++;\n }\n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(12ビット右シフトでxを、4095(下位11ビット1)とのAND演算でyを取り出す)\n return abs((from - to) >> 12) + abs((from - to) & 4095);\n}\n \nfunction min(a, b){\n // ビット演算で高速化\n return b + ((a - b) & ((a - b) >> 31));// 変数宣言よりもこっちの方が高速\n}\n \nfunction pos(a, b){\n // オブジェクトのインスタンス作るよりもプリミティブの方が早い\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n // 計算のため、余裕をもって12ビットシフト\n return (a << 12) + b;\n}\n \nfunction abs(a){\n // ビット演算で高速化\n return (a ^ (a >> 31)) - (a >> 31);// これも\n}", "problem_context": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "sample_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\n"}, "reference_outputs": ["2 10\nNA\n"], "source_document_id": "p00215", "source_text": "パチモ��クリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4971, "cpu_time_ms": 630, "memory_kb": 41036}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s215407392", "group_id": "codeNet:p00215", "input_text": "// 標準入力\nvar fs = require('fs'),\n length = fs.fstatSync(process.stdin.fd).size,\n buffer = new Buffer(length),\n bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\n input = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n \n// ここから\nfunction main(){\n var readLines = 0;\n while(true){\n var fieldInfo = input[readLines].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n // 変数宣言纏めたら早い?\n var start;\n var goal;\n var elem = [[],[],[],[],[]]; // 場にいるパチモン[属性][属性内連番]\n var c;\n var rowData;\n var elemCache;\n var y;\n var x;\n \n for(y = height; y--;){// reverse loop\n readLines++;//1行進める\n rowData = input[readLines];\n for(x = width; x--;){// reverse loop\n c = rowData[x];\n \n if(c == '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c == '1' || c == '2' || c == '3' || c == '4' || c == '5'){\n // 次に多いはずの属性を潰す\n elemCache = elem[c - 1];\n elemCache[elemCache.length] = pos(x, y);\n }else if(c == 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n // ブロックスコープが無いから変数宣言をまとめる\n var INF = 1 << 30;\n var bestElement = -1;\n var currentDisance;\n var nearestDistance = INF;\n var dp; // 距離[属性][同じ属性内の連番]\n var i; // loop index\n var j;\n var e;\n var len;\n var dpCacheNow; // cache of dp[i] for loop\n var dpCacheNowi; // cache of dp[now][i]\n var dpCacheNext; // cache of dp[i + 1] for loop\n var elemCacheNow;\n var elemCacheNowi; // cache of elem[now][i]\n var elemCacheNext;\n var now;\n var nowLength;\n var next;\n var nextLength;\n \n // 最初に選ぶ属性ごとにループ\n for (var selectElem = 0; selectElem < 5; selectElem++) {\n dp = [[],[],[],[],[]]; // 距離[属性][同じ属性内の連番]\n \n for(i = 5; i--;){// reverse loop\n len = elem[i].length;\n dp[i].length = len;\n dpCache = dp[i];\n while(len--){// reverse loop\n dpCache[len] = INF;\n }\n }\n \n now = (selectElem + 1) % 5;\n nowLength = elem[now].length;\n dpCacheNow = dp[now];\n elemCacheNow= elem[now];\n \n for (i = 0; i < nowLength; i++) {\n // s→e1を計算\n dpCacheNow[i] = dist(start, elemCacheNow[i]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (e = 0; e < 3; e++) {\n // e(x)->e(x+1)\n next = (now + 1) % 5;\n dpCacheNext = dp[next];\n elemCacheNext = elem[next];\n nextLength = elemCacheNext.length;\n for (i = 0; i < nowLength; i++) {\n dpCacheNowi = dpCacheNow[i];\n elemCacheNowi = elemCacheNow[i];\n \n if(dpCacheNowi >= nearestDistance){\n // 既に決まっている最短距離を超えたら絶対に候補ではない\n continue;\n }\n \n for (j = 0; j < nextLength; j++) {\n dpCacheNext[j] = min(dpCacheNext[j], dpCacheNowi + dist(elemCacheNowi, elemCacheNext[j])); // メモと新しい経路の最短\n }\n }\n \n now = next;\n dpCacheNow = dpCacheNext;\n elemCacheNow = elemCacheNext;\n nowLength = nextLength;\n }\n \n for (i = 0; i < nextLength; i++) {\n // e4->g\n currentDistance = dpCacheNext[i] + dist(elemCacheNext[i], goal);\n \n if (currentDistance < nearestDistance) {\n nearestDistance = currentDistance;\n bestElement = selectElem;\n }\n \n }\n \n }\n \n if (nearestDistance == INF) {\n console.log(\"NA\");\n } else {\n console.log((bestElement + 1) + \" \" + nearestDistance);\n }\n \n readLines++;\n }\n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return abs((from >> 11) - (to >> 11)) + abs((from & 2047) - (to & 2047));\n}\n \nfunction min(a, b){\n // ビット演算で高速化\n return b + ((a - b) & ((a - b) >> 31));// 変数宣言よりもこっちの方が高速\n}\n \nfunction pos(a, b){\n // オブジェクトのインスタンス作るよりもプリミティブ��方が早い\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n \nfunction abs(a){\n // ビット演算で高速化\n var t = a >> 31;\n return (a ^ t) - t;\n}", "language": "JavaScript", "metadata": {"date": 1429584596, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00215.html", "problem_id": "p00215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00215/input.txt", "sample_output_relpath": "derived/input_output/data/p00215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00215/JavaScript/s215407392.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s215407392", "user_id": "u340523328"}, "prompt_components": {"gold_output": "2 10\nNA\n", "input_to_evaluate": "// 標準入力\nvar fs = require('fs'),\n length = fs.fstatSync(process.stdin.fd).size,\n buffer = new Buffer(length),\n bytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\n input = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n \n// ここから\nfunction main(){\n var readLines = 0;\n while(true){\n var fieldInfo = input[readLines].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n // 変数宣言纏めたら早い?\n var start;\n var goal;\n var elem = [[],[],[],[],[]]; // 場にいるパチモン[属性][属性内連番]\n var c;\n var rowData;\n var elemCache;\n var y;\n var x;\n \n for(y = height; y--;){// reverse loop\n readLines++;//1行進める\n rowData = input[readLines];\n for(x = width; x--;){// reverse loop\n c = rowData[x];\n \n if(c == '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c == '1' || c == '2' || c == '3' || c == '4' || c == '5'){\n // 次に多いはずの属性を潰す\n elemCache = elem[c - 1];\n elemCache[elemCache.length] = pos(x, y);\n }else if(c == 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n // ブロックスコープが無いから変数宣言をまとめる\n var INF = 1 << 30;\n var bestElement = -1;\n var currentDisance;\n var nearestDistance = INF;\n var dp; // 距離[属性][同じ属性内の連番]\n var i; // loop index\n var j;\n var e;\n var len;\n var dpCacheNow; // cache of dp[i] for loop\n var dpCacheNowi; // cache of dp[now][i]\n var dpCacheNext; // cache of dp[i + 1] for loop\n var elemCacheNow;\n var elemCacheNowi; // cache of elem[now][i]\n var elemCacheNext;\n var now;\n var nowLength;\n var next;\n var nextLength;\n \n // 最初に選ぶ属性ごとにループ\n for (var selectElem = 0; selectElem < 5; selectElem++) {\n dp = [[],[],[],[],[]]; // 距離[属性][同じ属性内の連番]\n \n for(i = 5; i--;){// reverse loop\n len = elem[i].length;\n dp[i].length = len;\n dpCache = dp[i];\n while(len--){// reverse loop\n dpCache[len] = INF;\n }\n }\n \n now = (selectElem + 1) % 5;\n nowLength = elem[now].length;\n dpCacheNow = dp[now];\n elemCacheNow= elem[now];\n \n for (i = 0; i < nowLength; i++) {\n // s→e1を計算\n dpCacheNow[i] = dist(start, elemCacheNow[i]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (e = 0; e < 3; e++) {\n // e(x)->e(x+1)\n next = (now + 1) % 5;\n dpCacheNext = dp[next];\n elemCacheNext = elem[next];\n nextLength = elemCacheNext.length;\n for (i = 0; i < nowLength; i++) {\n dpCacheNowi = dpCacheNow[i];\n elemCacheNowi = elemCacheNow[i];\n \n if(dpCacheNowi >= nearestDistance){\n // 既に決まっている最短距離を超えたら絶対に候補ではない\n continue;\n }\n \n for (j = 0; j < nextLength; j++) {\n dpCacheNext[j] = min(dpCacheNext[j], dpCacheNowi + dist(elemCacheNowi, elemCacheNext[j])); // メモと新しい経路の最短\n }\n }\n \n now = next;\n dpCacheNow = dpCacheNext;\n elemCacheNow = elemCacheNext;\n nowLength = nextLength;\n }\n \n for (i = 0; i < nextLength; i++) {\n // e4->g\n currentDistance = dpCacheNext[i] + dist(elemCacheNext[i], goal);\n \n if (currentDistance < nearestDistance) {\n nearestDistance = currentDistance;\n bestElement = selectElem;\n }\n \n }\n \n }\n \n if (nearestDistance == INF) {\n console.log(\"NA\");\n } else {\n console.log((bestElement + 1) + \" \" + nearestDistance);\n }\n \n readLines++;\n }\n \n}\n \nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return abs((from >> 11) - (to >> 11)) + abs((from & 2047) - (to & 2047));\n}\n \nfunction min(a, b){\n // ビット演算で高速化\n return b + ((a - b) & ((a - b) >> 31));// 変数宣言よりもこっちの方が高速\n}\n \nfunction pos(a, b){\n // オブジェクトのインスタンス作るよりもプリミティブの方が早い\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n \nfunction abs(a){\n // ビット演算で高速化\n var t = a >> 31;\n return (a ^ t) - t;\n}", "problem_context": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、デー���セットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "sample_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\n"}, "reference_outputs": ["2 10\nNA\n"], "source_document_id": "p00215", "source_text": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小���動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4998, "cpu_time_ms": 740, "memory_kb": 41536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s822519463", "group_id": "codeNet:p00215", "input_text": "// 標準入力\nvar fs = require('fs'),\nlength = fs.fstatSync(process.stdin.fd).size,\nbuffer = new Buffer(length),\nbytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\ninput = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n\n// ここから\nfunction main(){\n var readLines = 0;\n while(true){\n var fieldInfo = input[readLines].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n // 変数宣言纏めたら早い\n var start;\n var goal;\n // 数値計算なのでTypedArray採用で高速化\n var elem = [new Int32Array(), new Int32Array(), new Int32Array(), new Int32Array(), new Int32Array()]; // 場にいるパチモン[属性][属性内連番]\n var c;\n var rowData;\n var elemCache;\n var y;\n var x;\n \n for(y = height; y--;){// reverse loop\n readLines++;//1行進める\n rowData = input[readLines];\n for(x = width; x--;){// reverse loop\n c = rowData[x];\n \n if(c == '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c == '1' || c == '2' || c == '3' || c == '4' || c == '5'){\n // 次に多いはずの属性を潰す\n elemCache = elem[c - 1];\n elemCache[elemCache.length] = pos(x, y);\n }else if(c == 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n // ブロックスコープが無いから変数宣言をまとめる\n var INF = 1 << 30;\n var bestElement = -1;\n var currentDisance;\n var nearestDistance = INF;\n var dp; // 距離[属性][同じ属性内の連番]\n var i; // loop index\n var j;\n var e;\n var len;\n var dpCacheNow; // cache of dp[i] for loop\n var dpCacheNowi; // cache of dp[now][i]\n var dpCacheNext; // cache of dp[i + 1] for loop\n var elemCacheNow;\n var elemCacheNowi; // cache of elem[now][i]\n var elemCacheNext;\n var now;\n var nowLength;\n var next;\n var nextLength;\n \n // 最初に選ぶ属性ごとにループ\n for (var selectElem = 0; selectElem < 5; selectElem++) {\n dp = new Array(5); // 距離[属性][同じ属性内の連番]\n \n for(i = 5; i--;){// reverse loop\n len = elem[i].length;\n // ここもTypedArray採用\n dpCache = dp[i] = new Int32Array(len);\n \n while(len--){// reverse loop\n dpCache[len] = INF;\n }\n }\n \n now = (selectElem + 1) % 5;\n nowLength = elem[now].length;\n dpCacheNow = dp[now];\n elemCacheNow= elem[now];\n \n for (i = 0; i < nowLength; i++) {\n // s→e1を計算\n dpCacheNow[i] = dist(start, elemCacheNow[i]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (e = 0; e < 3; e++) {\n // e(x)->e(x+1)\n next = (now + 1) % 5;\n dpCacheNext = dp[next];\n elemCacheNext = elem[next];\n nextLength = elemCacheNext.length;\n for (i = 0; i < nowLength; i++) {\n dpCacheNowi = dpCacheNow[i];\n elemCacheNowi = elemCacheNow[i];\n \n if(dpCacheNowi >= nearestDistance){\n // 既に決まっている最短距離を超えたら絶対に候補ではない\n continue;\n }\n \n for (j = 0; j < nextLength; j++) {\n dpCacheNext[j] = min(dpCacheNext[j], dpCacheNowi + dist(elemCacheNowi, elemCacheNext[j])); // メモと新しい経路の最短\n }\n }\n \n now = next;\n dpCacheNow = dpCacheNext;\n elemCacheNow = elemCacheNext;\n nowLength = nextLength;\n }\n \n for (i = 0; i < nextLength; i++) {\n // e4->g\n currentDistance = dpCacheNext[i] + dist(elemCacheNext[i], goal);\n \n if (currentDistance < nearestDistance) {\n nearestDistance = currentDistance;\n bestElement = selectElem;\n }\n \n }\n \n }\n \n if (nearestDistance == INF) {\n console.log(\"NA\");\n } else {\n console.log((bestElement + 1) + \" \" + nearestDistance);\n }\n \n readLines++;\n }\n \n}\n\nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return abs((from >> 11) - (to >> 11)) + abs((from & 2047) - (to & 2047));\n}\n\nfunction min(a, b){\n // ビット演算で高速化\n return b + ((a - b) & ((a - b) >> 31));// 変数宣言よりもこっちの方が高速\n}\n\nfunction pos(a, b){\n // オブジェクトのインスタンス作るよりもプリミティブの方が早い\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n\nfunction abs(a){\n // ビット演算で高速化\n return (a ^ (a >> 31)) - (a >> 31);// これも\n}", "language": "JavaScript", "metadata": {"date": 1430181785, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00215.html", "problem_id": "p00215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00215/input.txt", "sample_output_relpath": "derived/input_output/data/p00215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00215/JavaScript/s822519463.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s822519463", "user_id": "u340523328"}, "prompt_components": {"gold_output": "2 10\nNA\n", "input_to_evaluate": "// 標準入力\nvar fs = require('fs'),\nlength = fs.fstatSync(process.stdin.fd).size,\nbuffer = new Buffer(length),\nbytesRead = fs.readSync(process.stdin.fd, buffer, 0, length, 0),\ninput = buffer.toString('utf8', 0, bytesRead).split('\\n');\nmain();\n\n// ここから\nfunction main(){\n var readLines = 0;\n while(true){\n var fieldInfo = input[readLines].split(' ');\n var width = fieldInfo[0] - 0;//toInt\n var height = fieldInfo[1] - 0;//toInt\n \n // 0 0が入力された\n if(!width && !height){\n break;\n }\n \n // 変数宣言纏めたら早い\n var start;\n var goal;\n // 数値計算なのでTypedArray採用で高速化\n var elem = [new Int32Array(), new Int32Array(), new Int32Array(), new Int32Array(), new Int32Array()]; // 場にいるパチモン[属性][属性内連番]\n var c;\n var rowData;\n var elemCache;\n var y;\n var x;\n \n for(y = height; y--;){// reverse loop\n readLines++;//1行進める\n rowData = input[readLines];\n for(x = width; x--;){// reverse loop\n c = rowData[x];\n \n if(c == '.'){\n // ドットが一番多いはずなので、先にひっかけてしまう\n }else if(c == '1' || c == '2' || c == '3' || c == '4' || c == '5'){\n // 次に多いはずの属性を潰す\n elemCache = elem[c - 1];\n elemCache[elemCache.length] = pos(x, y);\n }else if(c == 'S'){\n start = pos(x, y);\n }else{\n goal = pos(x, y);\n }\n \n }\n }\n \n // ブロックスコープが無いから変数宣言をまとめる\n var INF = 1 << 30;\n var bestElement = -1;\n var currentDisance;\n var nearestDistance = INF;\n var dp; // 距離[属性][同じ属性内の連番]\n var i; // loop index\n var j;\n var e;\n var len;\n var dpCacheNow; // cache of dp[i] for loop\n var dpCacheNowi; // cache of dp[now][i]\n var dpCacheNext; // cache of dp[i + 1] for loop\n var elemCacheNow;\n var elemCacheNowi; // cache of elem[now][i]\n var elemCacheNext;\n var now;\n var nowLength;\n var next;\n var nextLength;\n \n // 最初に選ぶ属性ごとにループ\n for (var selectElem = 0; selectElem < 5; selectElem++) {\n dp = new Array(5); // 距離[属性][同じ属性内の連番]\n \n for(i = 5; i--;){// reverse loop\n len = elem[i].length;\n // ここもTypedArray採用\n dpCache = dp[i] = new Int32Array(len);\n \n while(len--){// reverse loop\n dpCache[len] = INF;\n }\n }\n \n now = (selectElem + 1) % 5;\n nowLength = elem[now].length;\n dpCacheNow = dp[now];\n elemCacheNow= elem[now];\n \n for (i = 0; i < nowLength; i++) {\n // s→e1を計算\n dpCacheNow[i] = dist(start, elemCacheNow[i]);\n }\n \n // s->1->2->3->4->g\n // なので、ループは間の-> * 3分まわす\n for (e = 0; e < 3; e++) {\n // e(x)->e(x+1)\n next = (now + 1) % 5;\n dpCacheNext = dp[next];\n elemCacheNext = elem[next];\n nextLength = elemCacheNext.length;\n for (i = 0; i < nowLength; i++) {\n dpCacheNowi = dpCacheNow[i];\n elemCacheNowi = elemCacheNow[i];\n \n if(dpCacheNowi >= nearestDistance){\n // 既に決まっている最短距離を超えたら絶対に候補ではない\n continue;\n }\n \n for (j = 0; j < nextLength; j++) {\n dpCacheNext[j] = min(dpCacheNext[j], dpCacheNowi + dist(elemCacheNowi, elemCacheNext[j])); // メモと新しい経路の最短\n }\n }\n \n now = next;\n dpCacheNow = dpCacheNext;\n elemCacheNow = elemCacheNext;\n nowLength = nextLength;\n }\n \n for (i = 0; i < nextLength; i++) {\n // e4->g\n currentDistance = dpCacheNext[i] + dist(elemCacheNext[i], goal);\n \n if (currentDistance < nearestDistance) {\n nearestDistance = currentDistance;\n bestElement = selectElem;\n }\n \n }\n \n }\n \n if (nearestDistance == INF) {\n console.log(\"NA\");\n } else {\n console.log((bestElement + 1) + \" \" + nearestDistance);\n }\n \n readLines++;\n }\n \n}\n\nfunction dist(from, to){\n // x座標とy座標の切り出し(11ビット右シフトでxを、2047(下位10ビット1)とのAND演算でyを取り出す)\n return abs((from >> 11) - (to >> 11)) + abs((from & 2047) - (to & 2047));\n}\n\nfunction min(a, b){\n // ビット演算で高速化\n return b + ((a - b) & ((a - b) >> 31));// 変数宣言よりもこっちの方が高速\n}\n\nfunction pos(a, b){\n // オブジェクトのインスタンス作るよりもプリミティブの方が早い\n // 2^10 = 1024なので、下位10ビットでy座標を、上位ビットでx座標を表す\n return (a << 11) + b;\n}\n\nfunction abs(a){\n // ビット演算で高速化\n return (a ^ (a >> 31)) - (a >> 31);// これも\n}", "problem_context": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入��として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "sample_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\n"}, "reference_outputs": ["2 10\nNA\n"], "source_document_id": "p00215", "source_text": "パチモンクリーチャー\n\n某国で大人気のゲーム、パチモンクリーチャーが日本でリメイクされて発売されました。 ゲームが大好きなあなたは、 このゲームを何度もプレイするうちにどうしたら最速でクリアできるのか考えるようになりました。しかし、いくら考えても最速の攻略方法がわからなかったあなたは、どれだけ早くゲームをクリアできるかを求めるプログラムを作成することにしました。\n\nゲームの詳細は以下の通りです。\n\nパチモンクリーチャー(以下、パチクリ)という生物が多く存在する世界がゲームの舞台です。各パチクリは、火属性、氷属性、木属性、土属性、水属性の 5 種類の属性のいずれか1つの属性を持ちます。ゲームの主人公は、ゲーム開始時に好きな属性のパチクリ一匹を冒険のパートナーとして選びます。そのパチクリと共にゴールを目指し、ゴールにいるライバルを倒してパチクリマスターになることがゲームの目的です。\n\nしかし、ライバルを倒すためには全属性のパチクリがいないと勝てないので、途中で全属性のパチクリを捕まえなければなりません。パチクリを捕まえるには属性がカギとなります。火属性のパチクリは氷属性のパチクリを捕まえることができ、同様に、氷属性は木属性、木属性は土属性、土属性は水属性、水属性は火属性を捕まえることができます。属性の関連は以下の図のようになります。\n\n以下の図はゲームが行われるマップの一例を表しています。\n\n主人公はパチクリを一匹もってスタート地点である「S」から出発し、一マスずつ移動しながらゴール地点である「G」を目指します。その途中で、最初に持っているパチクリ以外の 4 つの属性のパチクリを捕まえ、ゴール地点であるマス目に移動するとゲーム終了となります。\n\n主人公は、今いるマス目から、辺を共有する隣のマス目に移動することができ、それを一回の移動と数えます。主人公がパチクリのいるマスに移動した場合、そのパチクリを捕まえられる属性のパチクリを持っていればそのパチクリを捕まえたことになります。そのマスにいるパチクリを捕まえられるかの可否にかかわらず、すべてのマスに何度でも移動することができます。\n\nマップの大きさ(横方向の列数、縦方向の行数)とマップの初期状態を入力とし、初めに選んだパチクリの属性と、それ以外の 4 つの属性のパチクリを捕まえるのにかかる、スタート地点からゴール地点に至る最小移動数を出力するプログラムを作成してください。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終りはゼロふたつの行で示されます。各データセットは以下の形式で与えられます。\n\nW H\nc11c12...c1W\nc21c22...c2W\n:\ncH1cH2...cHW\n\n1 行目にマップの横方向の列数 W と縦方向の行数 H (2 ≤ W, H ≤ 1000) が与えられます。続く H 行にマップの i 行目の情報が与えられます。入力されるマップには各マスの状態が与えられます。 「S」は主人公のスタート地点を、 「G」はゴール地点を、「1」「2」「3」「4」「5」はそこにいるパチクリの属性を( 1:火属性、 2:氷属性、 3:木属性、 4:土属性、 5:水属性 をそれぞれ表します)、 「.(ピリオド) 」は何もないマスをそれぞれ表します。\n各属性のパチクリの数はそれぞれ 0 以上 1000 以下とします。\n\nデータセットの数は140 を超えません。また、データセットの 80 % について、W, H は100 を超えません。\n\nOutput\n\n入力データセットごとに、最初に選んだパチクリの属性と最小移動数を1行に出力します。なお、どのように初めのパチクリを選んでも、どのような経路で移動してもそれら 4 つの属性のパチクリを捕まえることができない場合は NA と出力してください。 また、最小移動数が同じになるような最初のパチクリの選び方が複数ある場合は、属性の数字が小さいものを出力してください。\n\nSample Input\n\n6 6\nS.1..4\n3..5..\n..4.1.\n4....5\n.2.32.\n5.1..G\n3 2\n...\nS.G\n0 0\n\nOutput for the Sample Input\n\n2 10\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5009, "cpu_time_ms": 160, "memory_kb": 41336}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s749740472", "group_id": "codeNet:p00221", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var mn=arr.shift().split(\" \");\n if(mn.join(\" \")==\"0 0\")break;\n var m=mn[0]-0;\n var n=mn[1]-0;\n var p=[];\n for(var i=0;i=m)j=0;\n }\n console.log(p.join(\" \"));\n}", "language": "JavaScript", "metadata": {"date": 1449398477, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00221.html", "problem_id": "p00221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00221/input.txt", "sample_output_relpath": "derived/input_output/data/p00221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00221/JavaScript/s749740472.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s749740472", "user_id": "u540218629"}, "prompt_components": {"gold_output": "2 3 4 5\n1\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var mn=arr.shift().split(\" \");\n if(mn.join(\" \")==\"0 0\")break;\n var m=mn[0]-0;\n var n=mn[1]-0;\n var p=[];\n for(var i=0;i=m)j=0;\n }\n console.log(p.join(\" \"));\n}", "problem_context": "FizzBuzz\n\n「Fizz Buzz」と言われる数字を使ったゲームがあります。このゲームは複数のプレイヤーで数字を1 から順にひとつずつ数え上げていくもので、各プレイヤーは直前のプレイヤーが発言した次の数字をひとつだけ発言します。その時、3 で割り切れる場合は 「Fizz」, 5 で割り切れる場合は 「Buzz」、両者で割り切れる場合は「FizzBuzz」と数の代わりに発言しなければなりません。例えば、最初の 16 までの発言は以下のようになります。\n\n1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, ・・・\n\n太郎君は友達と「Fizz Buzz」をして遊ぶことにしました。太郎君たちはルールを次のように決めました。\n\n「間違えた人は脱落する。その次の人は間違えた数の���の数から始める。つまり、1, 2, 3 と発言した場合、3 で間違えたので次は 4 から始めることになる。」\n\nこのルールに従ってゲームを行うのですが、ゲームに慣れていないため、間違えたことに気付かないことがあり、公平な判断ができません。そこであなたは太郎君たちがこのゲームを楽しめるように、決められた発言回数が終わった時点で残っていた人を出力するプログラムを作成することにしました。\n\nプレイヤー数、ゲーム中に発言された回数、それぞれの発言を入力とし、入力が終わった時点で残っているプレイヤーの番号を小さい順に出力するプログラムを作成してください。ただし、プレイヤーには 1 から番号が割り振られており、発言順番も 1 番目のプレイヤーから順に行い、一通り発言が終わると、再度 1 番目のプレイヤーから発言することとします。順番の回ってきたプレイヤーが既に脱落している場合は、その次のプレイヤーが発言します。また、このプログラムは、プレイヤーが一人になった時点で、その後の発言を無視しなければなりません。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終わりはゼロふたつの行で示されます。\n各データセットは以下の形式で与えられます。\n\nm n\ns1\ns2\n:\nsn\n\n1 行目にプレイヤー数 m (2 ≤ m ≤ 1000) と発言回数 n (1 ≤ n ≤ 10000) が与えられます。\n\n続く n 行に i 番目の発言 s1 が与えられます。 si は整数、Fizz、Buzz、または FizzBuzz を示す文字列(8文字以下)です。\n\nデータセットの数は 50 を超えません。\n\nOutput\n\n入力データセットごとに、指定された発言回数まで入力されたときに残っているプレイヤーの番号を小さい順に出力します。\n\nSample Input\n\n5 7\n1\n2\nFizz\n4\nBuzz\n6\n7\n3 5\n1\n2\n3\n4\n5\n0 0\n\nOutput for the Sample Input\n\n2 3 4 5\n1", "sample_input": "5 7\n1\n2\nFizz\n4\nBuzz\n6\n7\n3 5\n1\n2\n3\n4\n5\n0 0\n"}, "reference_outputs": ["2 3 4 5\n1\n"], "source_document_id": "p00221", "source_text": "FizzBuzz\n\n「Fizz Buzz」と言われる数字を使ったゲームがあります。このゲームは複数のプレイヤーで数字を1 から順にひとつずつ数え上げていくもので、各プレイヤーは直前のプレイヤーが発言した次の数字をひとつだけ発言します。その時、3 で割り切れる場合は 「Fizz」, 5 で割り切れる場合は 「Buzz」、両者で割り切れる場合は「FizzBuzz」と数の代わりに発言しなければなりません。例えば、最初の 16 までの発言は以下のようになります。\n\n1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14, FizzBuzz, 16, ・・・\n\n太郎君は友達と「Fizz Buzz」をして遊ぶことにしました。太郎君たちはルールを次のように決めました。\n\n「間違えた人は脱落する。その次の人は間違えた数の次の数から始める。つまり、1, 2, 3 と発言した場合、3 で間違えたので次は 4 から始めることになる。」\n\nこのルールに従ってゲームを行うのですが、ゲームに慣れていないため、間違えたことに気付かないことがあり、公平な判断ができません。そこであなたは太郎君たちがこのゲームを楽しめるように、決められた発言回数が終わった時点で残っていた人を出力するプログラムを作成することにしました。\n\nプレイヤー数、ゲーム中に発言された回数、それぞれの発言を入力とし、入力が終わった時点で残っているプレイヤーの番号を小さい順に出力するプログラムを作成してください。ただし、プレイヤーには 1 から番号が割り振られており、発言順番も 1 番目のプレイヤーから順に行い、一通り発言が終わると、再度 1 番目のプレイヤーから発言することとします。順番の回ってきたプレイヤーが既に脱落している場合は、その次のプレイヤーが発言します。また、このプログラムは、プレイヤーが一人になった時点で、その後の発言を無視しなければなりません。\n\nInput\n\n複数のデータセットの並びが入力として与えられます。入力の終わりはゼロふたつの行で示されます。\n各データセットは以下の形式で与えられます。\n\nm n\ns1\ns2\n:\nsn\n\n1 行目にプレイヤー数 m (2 ≤ m ≤ 1000) と発言回数 n (1 ≤ n ≤ 10000) が与えられます。\n\n続く n 行に i 番目の発言 s1 が与えられます。 si は整数、Fizz、Buzz、または FizzBuzz を示す文字列(8文字以下)です。\n\nデータセットの数は 50 を超えません。\n\nOutput\n\n入力データセットごとに、指定された発言回数まで入力されたときに残っているプレイヤーの番号を小さい順に出力します。\n\nSample Input\n\n5 7\n1\n2\nFizz\n4\nBuzz\n6\n7\n3 5\n1\n2\n3\n4\n5\n0 0\n\nOutput for the Sample Input\n\n2 3 4 5\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 624, "cpu_time_ms": 39730, "memory_kb": 27632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s000686739", "group_id": "codeNet:p00254", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nwhile(true){\n var n=Arr.shift();\n if(n==\"0000\")break;\n if(n==\"1111\" || n==\"2222\" || n==\"3333\" || n==\"4444\" || n==\"5555\"){console.log(\"NA\");continue;}\n if(n==\"6666\" || n==\"7777\" || n==\"8888\" || n==\"9999\"){console.log(\"NA\");continue;}\n var i=0;\n while(true){\n if(n==\"6174\")break;\n i++;\n var arr=n.split(\"\").map(Number);\n arr.sort(function(a,b){return b-a;});\n var L=parseInt(\"\"+arr[0]+arr[1]+arr[2]+arr[3],10);\n var S=parseInt(\"\"+arr[3]+arr[2]+arr[1]+arr[0],10);\n n=(\"0000\"+(L-S)).slice(-4);\n }\n console.log(i);\n}", "language": "JavaScript", "metadata": {"date": 1427197502, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00254.html", "problem_id": "p00254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00254/input.txt", "sample_output_relpath": "derived/input_output/data/p00254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00254/JavaScript/s000686739.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000686739", "user_id": "u540218629"}, "prompt_components": {"gold_output": "0\n3\nNA\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nwhile(true){\n var n=Arr.shift();\n if(n==\"0000\")break;\n if(n==\"1111\" || n==\"2222\" || n==\"3333\" || n==\"4444\" || n==\"5555\"){console.log(\"NA\");continue;}\n if(n==\"6666\" || n==\"7777\" || n==\"8888\" || n==\"9999\"){console.log(\"NA\");continue;}\n var i=0;\n while(true){\n if(n==\"6174\")break;\n i++;\n var arr=n.split(\"\").map(Number);\n arr.sort(function(a,b){return b-a;});\n var L=parseInt(\"\"+arr[0]+arr[1]+arr[2]+arr[3],10);\n var S=parseInt(\"\"+arr[3]+arr[2]+arr[1]+arr[0],10);\n n=(\"0000\"+(L-S)).slice(-4);\n }\n console.log(i);\n}", "problem_context": "すべての数は6174に通ず\n\n0 から 9 の数字からなる四桁の数 N に対して以下の操作を行う。\n\nN の桁それぞれの数値を大きい順に並べた結果得た数を L とする\n\nN の桁それぞれの数値を小さい順に並べた結果得た数を S とする\n\n差 L-S を新しい N とする(1回分の操作終了)\n\n新しい N に対して 1. から繰り返す\n\nこのとき、全桁が同じ数字(0000, 1111など)である場合を除き、あらゆる四桁の数はいつかは 6174になることが知られている。例えば N = 2012の場合\n\n       1回目 (N = 2012): L = 2210, S = 0122, L-S = 2088\n\n       2回目 (N = 2088): L = 8820, S = 0288, L-S = 8532\n\n       3回目 (N = 8532): L = 8532, S = 2358, L-S = 6174\n\nとなり、3 回の操作で 6174 に到達する。\n\n0 から 9 の数字からなる四桁の数が与えられたとき、何回の操作で 6174 に到達するか計算するプログラムを作成して下さい。\n\n入力\n\n入力は複数のデータセットからなる。入力の終わりは 0000 が1つの行で示される。各データセットは以下の形式で与えられる。\n\nN\n\nデータセットは1行であり、N (1 ≤ N ≤ 9999) は四桁の数を示す。N < 1000 の場合は上の桁は 0 で埋められている。\n\nデータセットの数は 10000 を超えない。\n\n出力\n\n各データセットごとに何回の操作で 6174 に到達したかを1行に出力する。ただし全桁が同じ数字である数が入力として与えられた場合は NA と出力する。\n\n入力例\n\n6174\n2012\n3333\n0000\n\n出力例\n\n0\n3\nNA", "sample_input": "6174\n2012\n3333\n0000\n"}, "reference_outputs": ["0\n3\nNA\n"], "source_document_id": "p00254", "source_text": "すべての数は6174に通ず\n\n0 から 9 の数字からなる四桁の数 N に対して以下の操作を行う。\n\nN の桁それぞれの数値を大���い順に並べた結果得た数を L とする\n\nN の桁それぞれの数値を小さい順に並べた結果得た数を S とする\n\n差 L-S を新しい N とする(1回分の操作終了)\n\n新しい N に対して 1. から繰り返す\n\nこのとき、全桁が同じ数字(0000, 1111など)である場合を除き、あらゆる四桁の数はいつかは 6174になることが知られている。例えば N = 2012の場合\n\n       1回目 (N = 2012): L = 2210, S = 0122, L-S = 2088\n\n       2回目 (N = 2088): L = 8820, S = 0288, L-S = 8532\n\n       3回目 (N = 8532): L = 8532, S = 2358, L-S = 6174\n\nとなり、3 回の操作で 6174 に到達する。\n\n0 から 9 の数字からなる四桁の数が与えられたとき、何回の操作で 6174 に到達するか計算するプログラムを作成して下さい。\n\n入力\n\n入力は複数のデータセットからなる。入力の終わりは 0000 が1つの行で示される。各データセットは以下の形式で与えられる。\n\nN\n\nデータセットは1行であり、N (1 ≤ N ≤ 9999) は四桁の数を示す。N < 1000 の場合は上の桁は 0 で埋められている。\n\nデータセットの数は 10000 を超えない。\n\n出力\n\n各データセットごとに何回の操作で 6174 に到達したかを1行に出力する。ただし全桁が同じ数字である数が入力として与えられた場合は NA と出力する。\n\n入力例\n\n6174\n2012\n3333\n0000\n\n出力例\n\n0\n3\nNA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 660, "cpu_time_ms": 180, "memory_kb": 20156}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s019822507", "group_id": "codeNet:p00276", "input_text": "Main(function(input) {\n\tinput = input.trim().split('\\n');\n\tinput.shift();\n\tinput.forEach(function(line) {\n\t\tvar tmp = line.split(' ');\n\t\tvar c = +tmp[0];\n\t\tvar a = +tmp[1];\n\t\tvar n = +tmp[2];\n\t\tvar ans = 0;\n\t\tvar min;\n\n\t\t/**\n\t\t * CAN pattern\n\t\t */\n\t\tmin = Math.min(c, a, n);\n\t\tc -= min;\n\t\ta -= min;\n\t\tn -= min;\n\t\tans += min;\n\n\t\t/**\n\t\t * CCA pattern\n\t\t */\n\t\tmin = Math.min(Math.floor(c / 2), a);\n\t\tc -= min * 2;\n\t\ta -= min;\n\t\tans += min;\n\n\t\t/**\n\t\t * CCC pattern\n\t\t */\n\t\tans += Math.floor(c / 3);\n\n\t\tconsole.log(ans);\n\t});\n});\n\nfunction Main(main) {\n\tvar input = '';\n\n\tprocess.stdin.resume();\n\tprocess.stdin.setEncoding('utf8');\n\tprocess.stdin.on('data', function(chunk) {\n\t\tinput += chunk;\n\t});\n\tprocess.stdin.on('end', function() {\n\t\tmain(input);\n\t});\n};", "language": "JavaScript", "metadata": {"date": 1454150555, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00276.html", "problem_id": "p00276", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00276/input.txt", "sample_output_relpath": "derived/input_output/data/p00276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00276/JavaScript/s019822507.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s019822507", "user_id": "u113878491"}, "prompt_components": {"gold_output": "1\n1\n4\n0\n", "input_to_evaluate": "Main(function(input) {\n\tinput = input.trim().split('\\n');\n\tinput.shift();\n\tinput.forEach(function(line) {\n\t\tvar tmp = line.split(' ');\n\t\tvar c = +tmp[0];\n\t\tvar a = +tmp[1];\n\t\tvar n = +tmp[2];\n\t\tvar ans = 0;\n\t\tvar min;\n\n\t\t/**\n\t\t * CAN pattern\n\t\t */\n\t\tmin = Math.min(c, a, n);\n\t\tc -= min;\n\t\ta -= min;\n\t\tn -= min;\n\t\tans += min;\n\n\t\t/**\n\t\t * CCA pattern\n\t\t */\n\t\tmin = Math.min(Math.floor(c / 2), a);\n\t\tc -= min * 2;\n\t\ta -= min;\n\t\tans += min;\n\n\t\t/**\n\t\t * CCC pattern\n\t\t */\n\t\tans += Math.floor(c / 3);\n\n\t\tconsole.log(ans);\n\t});\n});\n\nfunction Main(main) {\n\tvar input = '';\n\n\tprocess.stdin.resume();\n\tprocess.stdin.setEncoding('utf8');\n\tprocess.stdin.on('data', function(chunk) {\n\t\tinput += chunk;\n\t});\n\tprocess.stdin.on('end', function() {\n\t\tmain(input);\n\t});\n};", "problem_context": "陣形\n\nプログラマー養成校であるアカベ高校では、チーム戦の競技プログラマーの役割を以下の3タイプに分けています。\n\nC:\n\nコーダー\n\n言語を熟知しており、コーディングを行う。\n\nA:\n\nアルゴリズマー\n\n論理的思考が得意であり、アルゴリズムを考える。\n\nN:\n\nナビゲーター\n\n読解力に長けており、問題の分析・デバッグをする。\n\nこ��高校では以下のいずれかの陣形で3人一組のチームを構成しています。\n\nCCA:\n\nバランスがとれている安定型\n\nCCC:\n\nスピードを見込めるがリスクの高い速攻型\n\nCAN:\n\n正確に問題を解く慎重型\n\n競技プログラミング部のコーチであるあなたは、これらの部員をうまく組み合わせ、できるだけ多くのチームを結成できるよう、毎年気を配っています。そこで、コーダーの人数、アルゴリズマーの人数、ナビゲーターの人数が入力として与えられたとき、最大何チーム作れるかを出力するプログラムを作成してください。\n\n入力\n\n入力は1つのデータセットからなる。入力データは以下の形式で与えられる。\n\nQ\nc1 a1 n1\nc2 a2 n2\n:\ncQ aQ nQ\n\n1行目のQ(0 ≤ Q ≤ 100)はチーム数を求めたい年数である。続くQ行に各年の役割別の人数が与えられる。各行にはコーダーの人数ci(0 ≤ ci ≤ 1000)、アルゴリズマーの人数ai(0 ≤ ai ≤ 1000)、ナビゲーターの人数ni(0 ≤ ni ≤ 1000)が与えられる。\n\n出力\n\n年ごとに、作成できる最大のチーム数を1行に出力する。\n\n入力例\n\n4\n3 0 0\n1 1 1\n9 4 1\n0 1 2\n\n出力例\n\n1\n1\n4\n0", "sample_input": "4\n3 0 0\n1 1 1\n9 4 1\n0 1 2\n"}, "reference_outputs": ["1\n1\n4\n0\n"], "source_document_id": "p00276", "source_text": "陣形\n\nプログラマー養成校であるアカベ高校では、チーム戦の競技プログラマーの役割を以下の3タイプに分けています。\n\nC:\n\nコーダー\n\n言語を熟知しており、コーディングを行う。\n\nA:\n\nアルゴリズマー\n\n論理的思考が得意であり、アルゴリズムを考える。\n\nN:\n\nナビゲーター\n\n読解力に長けており、問題の分析・デバッグをする。\n\nこの高校では以下のいずれかの陣形で3人一組のチームを構成しています。\n\nCCA:\n\nバランスがとれている安定型\n\nCCC:\n\nスピードを見込めるがリスクの高い速攻型\n\nCAN:\n\n正確に問題を解く慎重型\n\n競技プログラミング部のコーチであるあなたは、これらの部員をうまく組み合わせ、できるだけ多くのチームを結成できるよう、毎年気を配っています。そこで、コーダーの人数、アルゴリズマーの人数、ナビゲーターの人数が入力として与えられたとき、最大何チーム作れるかを出力するプログラムを作成してください。\n\n入力\n\n入力は1つのデータセットからなる。入力データは以下の形式で与えられる。\n\nQ\nc1 a1 n1\nc2 a2 n2\n:\ncQ aQ nQ\n\n1行目のQ(0 ≤ Q ≤ 100)はチーム数を求めたい年数である。続くQ行に各年の役割別の人数が与えられる。各行にはコーダーの人数ci(0 ≤ ci ≤ 1000)、アルゴリズマーの人数ai(0 ≤ ai ≤ 1000)、ナビゲーターの人数ni(0 ≤ ni ≤ 1000)が与えられる。\n\n出力\n\n年ごとに、作成できる最大のチーム数を1行に出力する。\n\n入力例\n\n4\n3 0 0\n1 1 1\n9 4 1\n0 1 2\n\n出力例\n\n1\n1\n4\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 754, "cpu_time_ms": 70, "memory_kb": 16456}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s799009792", "group_id": "codeNet:p00282", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var mn=arr.shift();\n if(mn==\"0 0\")break;\n mn=mn.split(\" \").map(Number);\n var m=mn[0];\n var n=mn[1];\n var ary=[];\n for(var i=0;i<18;i++)ary[i]=0;\n ary[0]=m;\n for(var j=1;j<=n;j++){\n if(j==n)m=1;\n var plus=[];\n for(var i=0;i<18;i++)plus[i]=0;\n ary.forEach(function(v,i){\n var k=v*m;\n if(k>=10000){\n ary[i]=k%10000;\n plus[i+1]+=Math.floor(k/10000);\n }else{\n ary[i]=k;\n }\n });\n ary.forEach(function(v,i){\n ary[i]=ary[i]+plus[i];\n });\n }\n var us=[\"\",\"Man\",\"Oku\",\"Cho\",\"Kei\",\"Gai\",\"Jo\",\"Jou\",\"Ko\",\"Kan\",\"Sei\",\"Sai\",\"Gok\",\"Ggs\",\"Asg\",\"Nyt\",\"Fks\",\"Mts\"];\n var str=\"\";\n ary.forEach(function(v,i){\n if(v!=0)str=v+us[i]+str;\n });\n if(str==\"\")str=0;\n console.log(str);\n}", "language": "JavaScript", "metadata": {"date": 1448708492, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00282.html", "problem_id": "p00282", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00282/input.txt", "sample_output_relpath": "derived/input_output/data/p00282/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00282/JavaScript/s799009792.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s799009792", "user_id": "u540218629"}, "prompt_components": {"gold_output": "1024\n95Cho3674Oku3164Man625\n1Oku\n131Gai720Kei\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var mn=arr.shift();\n if(mn==\"0 0\")break;\n mn=mn.split(\" \").map(Number);\n var m=mn[0];\n var n=mn[1];\n var ary=[];\n for(var i=0;i<18;i++)ary[i]=0;\n ary[0]=m;\n for(var j=1;j<=n;j++){\n if(j==n)m=1;\n var plus=[];\n for(var i=0;i<18;i++)plus[i]=0;\n ary.forEach(function(v,i){\n var k=v*m;\n if(k>=10000){\n ary[i]=k%10000;\n plus[i+1]+=Math.floor(k/10000);\n }else{\n ary[i]=k;\n }\n });\n ary.forEach(function(v,i){\n ary[i]=ary[i]+plus[i];\n });\n }\n var us=[\"\",\"Man\",\"Oku\",\"Cho\",\"Kei\",\"Gai\",\"Jo\",\"Jou\",\"Ko\",\"Kan\",\"Sei\",\"Sai\",\"Gok\",\"Ggs\",\"Asg\",\"Nyt\",\"Fks\",\"Mts\"];\n var str=\"\";\n ary.forEach(function(v,i){\n if(v!=0)str=v+us[i]+str;\n });\n if(str==\"\")str=0;\n console.log(str);\n}", "problem_context": "塵劫記\n\n大きな数を表そうとすると、文字数も多くなるし、位取りがわからなくなってしまうので、なかなか面倒です。大きな数をわかりやすく表すために、人々は数の単位を使ってきました。江戸時代に書かれた「塵劫記」という本の中では、数の単位が次のように書かれています。\n\nたとえば、2の100乗のようなとても大きな数は、126穣7650(じょ)6002垓2822京9401兆4967億320万5376と表せます。それでは、正の整数 m と n が与えられたとき、m の n 乗を塵劫記の単位を使って上のように表すプログラムを作成してください。\n\n入力\n\n入力は複数のデータセットからなる。入力の終わりはゼロ2つの行で示される。各データセットは以下の形式で与えられる。\n\nm n\n\nm (2 ≤ m ≤ 20) が基数、n (1 ≤ n < 240) が指数を表す。ただし、mnは 1072 未満である。\n\nデータセットの数は 100 を超えない。\n\n出力\n\nデータセットごとに、mn を塵劫記の単位で表した文字列を1行に出力する。ただし、各単位は以下の表記で出力する。\n\nmnを表す文字列は、1 から 9999 までの数と上の表に現れる単位を表す文字列からなる。文字列には、余分な 0 や単位を含めない。\n\n入出力例\n\n入力例\n\n2 10\n5 20\n10 8\n20 17\n0 0\n\n出力例\n\n1024\n95Cho3674Oku3164Man625\n1Oku\n131Gai720Kei", "sample_input": "2 10\n5 20\n10 8\n20 17\n0 0\n"}, "reference_outputs": ["1024\n95Cho3674Oku3164Man625\n1Oku\n131Gai720Kei\n"], "source_document_id": "p00282", "source_text": "塵劫記\n\n大きな数を表そうとすると、文字数も多くなるし、位取りがわからなくなってしまうので、なかなか面倒です。大きな数をわかりやすく表すために、人々は数の単位を使ってきました。江戸時代に書かれた「塵劫記」という本の中では、数の単位が次のように書かれています。\n\nたとえば、2の100乗のようなとても大きな数は、126穣7650(じょ)6002垓2822京9401兆4967億320万5376と表せます。それでは、正の整数 m と n が与えられたとき、m の n 乗を塵劫記の単位を使って上のように表すプログラムを作成してください。\n\n入力\n\n入力は複数のデータセットからなる。入力の終わりはゼロ2つの行で示される。各データセットは以下の形式で与えられる。\n\nm n\n\nm (2 ≤ m ≤ 20) が基数、n (1 ≤ n < 240) が指数を表す。ただし、mnは 1072 未満である。\n\nデータセットの数は 100 を超えない。\n\n出力\n\nデータセットごとに、mn を塵劫記の単位で表した文字列を1行に出力する。ただし、各単位は以下の表記で出力する。\n\nmnを表す文字列は、1 から 9999 までの数と上の表に現れる単位を表す文字列からなる。文字列には、余分な 0 や単位を含めない。\n\n入出力例\n\n入力例\n\n2 10\n5 20\n10 8\n20 17\n0 0\n\n出力例\n\n1024\n95Cho3674Oku3164Man625\n1Oku\n131Gai720Kei", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 913, "cpu_time_ms": 60, "memory_kb": 17888}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s708493545", "group_id": "codeNet:p00444", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\").map(Number);\nfor(var i=0;i=500){sum++;v=v-500;}\nsum+=Math.floor(v/100);\nv=v%100;\nif(v>=50){sum++;v=v-50;}\nsum+=Math.floor(v/10);\nv=v%10;\nif(v>=5){sum++;v=v-5;}\nconsole.log(sum+v);\n}", "language": "JavaScript", "metadata": {"date": 1425302228, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00444.html", "problem_id": "p00444", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00444/input.txt", "sample_output_relpath": "derived/input_output/data/p00444/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00444/JavaScript/s708493545.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s708493545", "user_id": "u540218629"}, "prompt_components": {"gold_output": "4\n15\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\").map(Number);\nfor(var i=0;i=500){sum++;v=v-500;}\nsum+=Math.floor(v/100);\nv=v%100;\nif(v>=50){sum++;v=v-50;}\nsum+=Math.floor(v/10);\nv=v%10;\nif(v>=5){sum++;v=v-5;}\nconsole.log(sum+v);\n}", "problem_context": "おつり\n\n問題\n\n太郎君はよくJOI雑貨店で買い物をする. JOI雑貨店には硬貨は500円,100円,50円,10円,5円,1円が十分な数だけあり,いつも最も枚数が少なくなるようなおつりの支払い方をする.太郎君がJOI雑貨店で買い物をしてレジで1000円札を1枚出した時,もらうおつりに含まれる硬貨の枚数を求めるプログラムを作成せよ.\n\n例えば入力例1の場合は下の図に示すように,4を出力しなければならない.\n\n入力\n\n入力は複数のデータセットからなる.各データセットは1行からなり,太郎君が支払う金額(1以上1000未満の整数)が1つだけ書かれている.入力データはゼロ1つの行で終了する.\n\nデータセットの数は 5 を超えない.\n\n出力\n\nデータセットごとにおつりに含まれる硬貨の枚数を1行に出力せよ.\n\n入出力例\n\n入力例\n\n380\n1\n0\n\n出力例\n\n4\n15\n\n上記問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。", "sample_input": "380\n1\n0\n"}, "reference_outputs": ["4\n15\n"], "source_document_id": "p00444", "source_text": "おつり\n\n問題\n\n太郎君はよくJOI雑貨店で買い物をする. JOI雑貨店には硬貨は500円,100円,50円,10円,5円,1円が十分な数だけあり,いつも最も枚数が少なくなるようなおつりの支払い方をする.太郎君がJOI雑貨店で買い物をしてレジで1000円札を1枚出した時,もらうおつりに含まれる硬貨の枚数を求めるプログラムを作成せよ.\n\n例えば入力例1の場合は下の図に示すように,4を出力しなければならない.\n\n入力\n\n入力は複数のデータセットからなる.各データセットは1行からなり,太郎君が支払う金額(1以上1000未満の整数)が1つだけ書かれている.入力データはゼロ1つの行で終了する.\n\nデータセットの数は 5 を超えない.\n\n出力\n\nデータセットごとにおつりに含まれる硬貨の枚数を1行に出力せよ.\n\n入出力例\n\n入力例\n\n380\n1\n0\n\n出力例\n\n4\n15\n\n上記問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 351, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s944854384", "group_id": "codeNet:p00453", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\n\nwhile(true){\n var last=[];\n var nm=arr.shift().split(\" \").map(Number);\n if(nm.join(\" \")==\"0 0\")break;\n var n=nm[0];\n var m=nm[1];\n var yx=[];\n for(var i=0;iparseInt(x)); }\nArray.prototype.fmap = function() { return this.map((x)=>parseFloat(x)); }\nArray.prototype.smap = function() { return this.map((x)=>String(x)); }\nArray.prototype.ffill = function(cb) {\n for(var i=0; istdin.readline()).imap().sum(x=>x<40?40:x)/5);", "language": "JavaScript", "metadata": {"date": 1512796692, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p00515.html", "problem_id": "p00515", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p00515/input.txt", "sample_output_relpath": "derived/input_output/data/p00515/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p00515/JavaScript/s305665066.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s305665066", "user_id": "u260980560"}, "prompt_components": {"gold_output": "68\n", "input_to_evaluate": "var fs = require('fs');\n\n// class Stdin\nfunction Stdin() {\n this.__input = null;\n this.__lines = [];\n this.__index = 0;\n}\nStdin.prototype.init = function() {\n this.__input = fs.readFileSync('/dev/stdin', 'utf-8');\n this.__lines = this.__input.split(\"\\n\");\n this.__index = 0;\n}\nStdin.prototype.readline = function() {\n if(this.__index === this.__lines.length) this.init();\n return this.__lines[this.__index++];\n};\nStdin.prototype.readlines = function() {\n if(this.__index === this.__lines.length) this.init();\n cur = this.__index; this.__index = this.__lines.length;\n return this.__lines.slice(cur);\n};\nvar stdin = new Stdin;\n\nArray.prototype.imap = function() { return this.map((x)=>parseInt(x)); }\nArray.prototype.fmap = function() { return this.map((x)=>parseFloat(x)); }\nArray.prototype.smap = function() { return this.map((x)=>String(x)); }\nArray.prototype.ffill = function(cb) {\n for(var i=0; istdin.readline()).imap().sum(x=>x<40?40:x)/5);", "problem_context": "問題 1: 平均点 (Average Score)\n\n問題\n\nJOI 高校の授業には,太郎君,次郎君,三郎君,四郎君,花子さんの 5 人の生徒が参加した.\n\nこの授業では,期末試験を実施した.期末試験は,5 人全員が受験した.期末試験の点数が 40 点以上の生徒は,期末試験の点数がそのまま成績になった.期末試験の点数が 40 点未満の生徒は全員,補習を受け,成績が 40 点になった.\n\n5 人の生徒の期末試験の点数が与えられたとき,5 人の成績の平均点を計算するプログラムを作成せよ.\n\n入力\n\n入力は 5 行からなり,1 行に 1 つずつ整数が書かれている.\n\n1 行目には 太郎君の期末試験の点数が書かれている.\n\n2 行目には 次郎君の期末試験の点数が書かれている.\n\n3 行目には 三郎君の期末試験の点数が書かれている.\n\n4 行目には 四郎君の期末試験の点数が書かれている.\n\n5 行目には 花子さんの期末試験の点数が書かれている.\n\n生徒の期末試験の点数はすべて 0 点以上 100 点以下の整数である.\n\n生徒の期末試験の点数はすべて 5 の倍数である.\n\n5 人の生徒の成績の平均点は必ず整数になる.\n\n出力\n\n5 人の生徒の成績の平均点をあらわす整数を 1 行で出力せよ.\n\n入出力例\n\n入力例 1\n\n10\n65\n100\n30\n95\n\n出力例 1\n\n68\n\n入出力例 1 では,太郎君と四郎君の期末試験の点数は 40 点未満なので,太郎君と四郎君の成績は 40 点になる.次郎君と三郎君と花子さんの期末試験の点数は 40 点以上なので,次郎君の成績は 65 点,三郎君の成績は 100 点,花子さんの成績は 95 点となる.5 人の成績の合計は 340 なので,平均点は 68 点となる.\n\n入力例 2\n\n40\n95\n0\n95\n50\n\n出力例 2\n\n64\n\n問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。", "sample_input": "10\n65\n100\n30\n95\n"}, "reference_outputs": ["68\n"], "source_document_id": "p00515", "source_text": "問題 1: 平均点 (Average Score)\n\n問題\n\nJOI 高校の授業には,太郎君,次郎君,三郎君,四郎君,花子さんの 5 人の��徒が参加した.\n\nこの授業では,期末試験を実施した.期末試験は,5 人全員が受験した.期末試験の点数が 40 点以上の生徒は,期末試験の点数がそのまま成績になった.期末試験の点数が 40 点未満の生徒は全員,補習を受け,成績が 40 点になった.\n\n5 人の生徒の期末試験の点数が与えられたとき,5 人の成績の平均点を計算するプログラムを作成せよ.\n\n入力\n\n入力は 5 行からなり,1 行に 1 つずつ整数が書かれている.\n\n1 行目には 太郎君の期末試験の点数が書かれている.\n\n2 行目には 次郎君の期末試験の点数が書かれている.\n\n3 行目には 三郎君の期末試験の点数が書かれている.\n\n4 行目には 四郎君の期末試験の点数が書かれている.\n\n5 行目には 花子さんの期末試験の点数が書かれている.\n\n生徒の期末試験の点数はすべて 0 点以上 100 点以下の整数である.\n\n生徒の期末試験の点数はすべて 5 の倍数である.\n\n5 人の生徒の成績の平均点は必ず整数になる.\n\n出力\n\n5 人の生徒の成績の平均点をあらわす整数を 1 行で出力せよ.\n\n入出力例\n\n入力例 1\n\n10\n65\n100\n30\n95\n\n出力例 1\n\n68\n\n入出力例 1 では,太郎君と四郎君の期末試験の点数は 40 点未満なので,太郎君と四郎君の成績は 40 点になる.次郎君と三郎君と花子さんの期末試験の点数は 40 点以上なので,次郎君の成績は 65 点,三郎君の成績は 100 点,花子さんの成績は 95 点となる.5 人の成績の合計は 340 なので,平均点は 68 点となる.\n\n入力例 2\n\n40\n95\n0\n95\n50\n\n出力例 2\n\n64\n\n問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1981, "cpu_time_ms": 90, "memory_kb": 15192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s367777034", "group_id": "codeNet:p00723", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nvar n=Arr.shift()-0;\nfor(var I=0;Im)break;\n if(PRIME[q]*a <= PRIME[p]*b && ans[2]m)break;\n if(PRIME[q]*a <= PRIME[p]*b && ans[2] 4 and 0 < a/b ≤ 1 . You should find the pair of prime numbers p, q such that pq ≤ m and a/b ≤ p/q ≤ 1 , and furthermore, the product pq takes the maximum value among such pairs of two prime numbers. You should report p and q as the \"most suitable\" width and height of the translated picture.\n\nInput\n\nThe input is a sequence of at most 2000 triplets of positive integers, delimited by a space character in between. Each line contains a single triplet. The sequence is followed by a triplet of zeros, 0 0 0, which indicates the end of the input and should not be treated as data to be processed.\n\nThe integers of each input triplet are the integer m, the numerator a, and the denominator b described above, in this order. You may assume 4 < m < 100000 and 1 ≤ a ≤ b ≤ 1000.\n\nOutput\n\nThe output is a sequence of pairs of positive integers. The i-th output pair corresponds to the i-th input triplet. The integers of each output pair are the width p and the height q described above, in this order.\n\nEach output line contains a single pair. A space character is put between the integers as a delimiter. No other characters should appear in the output.\n\nSample Input\n\n5 1 2\n99999 999 999\n1680 5 16\n1970 1 1\n2002 4 11\n0 0 0\n\nOutput for the Sample Input\n\n2 2\n313 313\n23 73\n43 43\n37 53", "sample_input": "5 1 2\n99999 999 999\n1680 5 16\n1970 1 1\n2002 4 11\n0 0 0\n"}, "reference_outputs": ["2 2\n313 313\n23 73\n43 43\n37 53\n"], "source_document_id": "p00811", "source_text": "Problem A: Calling Extraterrestrial Intelligence Again\n\nA message from humans to extraterrestrial intelligence was sent through the Arecibo radio telescope in Puerto Rico on the afternoon of Saturday November l6, l974. The message consisted of l679 bits and was meant to be translated to a rectangular picture with 23 × 73 pixels. Since both 23 and 73 are prime numbers, 23 × 73 is the unique possible size of the translated rectangular picture each edge of which is longer than l pixel. Of course, there was no guarantee that the receivers would try to translate the message to a rectangular picture. Even if they would, they might put the pixels into the rectangle incorrectly. The senders of the Arecibo message were optimistic.\n\nWe are planning a similar project. Your task in the project is to find the most suitable width and height of the translated rectangular picture. The term ``most suitable'' is defined as follows. An integer m greater than 4 is given. A positive fraction a/b less than or equal to 1 is also given. The area of the picture should not be greater than m. Both of the width and the height of the translated picture should be prime numbers. The ratio of the width to the height should not be less than a/b nor greater than 1. You should maximize the area of the picture under these constraints.\n\nIn other words, you will receive an integer m and a fraction a/b . It holds that m > 4 and 0 < a/b ≤ 1 . You should find the pair of prime numbers p, q such that pq ≤ m and a/b ≤ p/q ≤ 1 , and furthermore, the product pq takes the maximum value among such pairs of two prime numbers. You should report p and q as the \"most suitable\" width and height of the translated picture.\n\nInput\n\nThe input is a sequence of at most 2000 triplets of positive integers, delimited by a space character in between. Each line contains a single triplet. The sequence is followed by a triplet of zeros, 0 0 0, which indicates the end of the input and should not be treated as data to be processed.\n\nThe integers of each input triplet are the integer m, the numerator a, and the denominator b described above, in this order. You may assume 4 < m < 100000 and 1 ≤ a ≤ b ≤ 1000.\n\nOutput\n\nThe output is a sequence of pairs of positive integers. The i-th output pair corresponds to the i-th input triplet. The integers of each output pair are the width p and the height q described above, in this order.\n\nEach output line contains a single pair. A space character is put between the integers as a delimiter. No other characters should appear in the output.\n\nSample Input\n\n5 1 2\n99999 999 999\n1680 5 16\n1970 1 1\n2002 4 11\n0 0 0\n\nOutput for the Sample Input\n\n2 2\n313 313\n23 73\n43 43\n37 53", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 947, "cpu_time_ms": 980, "memory_kb": 26328}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s493248703", "group_id": "codeNet:p00895", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var hw=arr.shift();\n if(hw==\"0 0\")break;\n hw=hw.split(\" \").map(Number);\n var h=hw[0];\n var w=hw[1];\n var yx=[];\n for(var i=0;i=2 && max=2 && max a)\n min = a;\n }\n }\n console.log(min);\n k++;\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1495179560, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01093.html", "problem_id": "p01093", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01093/input.txt", "sample_output_relpath": "derived/input_output/data/p01093/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01093/JavaScript/s200500444.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s200500444", "user_id": "u172120093"}, "prompt_components": {"gold_output": "0\n1\n5\n", "input_to_evaluate": "function Main(input){\n input = input.split(\"\\n\");\n var k = 0;\n while(1){\n var n = parseInt(input[k++],10);\n if(n == 0)\n break;\n\n input[k] = input[k].split(\" \");\n\n var min = 1000000000;\n for(var i = 0;i < n;i++){\n for(var j = i + 1;j < n;j++){\n var a = Math.abs(parseInt(input[k][i],10) - parseInt(input[k][j],10));\n if(min > a)\n min = a;\n }\n }\n console.log(min);\n k++;\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "Selection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training.\nIn order to evaluate the effectiveness of this method,\nhe plans to carry out a control experiment.\nHaving two students as the participants of the experiment,\none of them will be trained under the conventional method\nand the other under his new method.\nComparing the final scores of these two,\nhe will be able to judge the effectiveness of his method.\n\nIt is important to select two students having the closest possible scores,\nfor making the comparison fair.\nHe has a list of the scores of all students\nwho can participate in the experiment.\nYou are asked to write a program which selects two of them\nhaving the smallest difference in their scores.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn\n\na1 a2 … an\n\nA dataset consists of two lines.\nThe number of students n is given in the first line.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nThe second line gives scores of n students.\nai (1 ≤ i ≤ n) is the score of the i-th student, which is a non-negative integer not greater than 1,000,000.\n\nThe end of the input is indicated by a line containing a zero.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, select two students with the smallest difference in their scores,\nand output in a line (the absolute value of) the difference.\n\nSample Input\n\n5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n\nOutput for the Sample Input\n\n0\n1\n5", "sample_input": "5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n"}, "reference_outputs": ["0\n1\n5\n"], "source_document_id": "p01093", "source_text": "Selection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training.\nIn order to evaluate the effectiveness of this method,\nhe plans to carry out a control experiment.\nHaving two students as the participants of the experiment,\none of them will be trained under the conventional method\nand the other under his new method.\nComparing the final scores of these two,\nhe will be able to judge the effectiveness of his method.\n\nIt is important to select two students having the closest possible scores,\nfor making the comparison fair.\nHe has a list of the scores of all students\nwho can participate in the experiment.\nYou are asked to write a program which selects two of them\nhaving the smallest difference in their scores.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn\n\na1 a2 … an\n\nA dataset consists of two lines.\nThe number of students n is given in the first line.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nThe second line gives scores of n students.\nai (1 ≤ i ≤ n) is the score of the i-th student, which is a non-negative integer not greater than 1,000,000.\n\nThe end of the input is indicated by a line containing a zero.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, select two students with the smallest difference in their scores,\nand output in a line (the absolute value of) the difference.\n\nSample Input\n\n5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n\nOutput for the Sample Input\n\n0\n1\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 578, "cpu_time_ms": 330, "memory_kb": 18436}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s701271475", "group_id": "codeNet:p01093", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst lines = input.trim().split('\\n');\n\nlet count = 0;\nvar numberOfStudents = 0;\nvar totalStudents = 0;\n\nwhile(count < lines.length) {\n\t\n\n\tif(count%2 == 0) {\n\t\tnumberOfStudents = +lines[count];\n\t\tif (numberOfStudents==0) {\n\t\t\tbreak;\n\t\t} else if(numberOfStudents>1000) {\n\t\t\tconsole.log('Number of students must not be greater than 1,000.');\n\t\t\tbreak;\n\t\t} else if(numberOfStudents<2) {\n\t\t\tconsole.log('Number of students must not be less than 2.');\n\t\t\tbreak;\n\t\t} else {\n\t\t\ttotalStudents += numberOfStudents;\n\t\t\tif(totalStudents>50000) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet scoresString = lines[count].split(' ');\n\t\t\n\t\tif(scoresString.length != numberOfStudents) {\n\t\t\tconsole.log(`Number of students is not equal to number of scores at line ${count+1}`);\n\t\t\tbreak;\n\t\t} else {\n\t\tlet scores = scoresString.map(score => +score);\n\t\t\tvar leastDiff = null;\n\t\t\tvar currentDiff;\n\t\t\tfor (let i = scores.length - 1; i >= 0; i--) {\n\t\t\t\tif(isNotGreaterThanMillion(scores[i])) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tfor(j=i; j>=0; j--) {\n\t\t\t\t\tif(i) {\n\t\t\t\t\t\tif (leastDiff != null) {\n\t\t\t\t\t\t\tcurrentDiff = Math.abs(scores[i] - scores[j-1]);\n\t\t\t\t\t\tif (currentDiff < leastDiff) {\n\t\t\t\t\t\t\tleastDiff = currentDiff;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleastDiff = Math.abs(scores[i] - scores[j-1]);\n\t\t\t\t\t}\n\n\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t\tconsole.log(leastDiff);\n\t\t}\n\t}\n\ncount++;\n\n}\n\nfunction isNotGreaterThanMillion(number) {\n\tif (number>1000000) {\n\t\treturn true;\n\t}\n}\n", "language": "JavaScript", "metadata": {"date": 1557387624, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01093.html", "problem_id": "p01093", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01093/input.txt", "sample_output_relpath": "derived/input_output/data/p01093/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01093/JavaScript/s701271475.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s701271475", "user_id": "u044707717"}, "prompt_components": {"gold_output": "0\n1\n5\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst lines = input.trim().split('\\n');\n\nlet count = 0;\nvar numberOfStudents = 0;\nvar totalStudents = 0;\n\nwhile(count < lines.length) {\n\t\n\n\tif(count%2 == 0) {\n\t\tnumberOfStudents = +lines[count];\n\t\tif (numberOfStudents==0) {\n\t\t\tbreak;\n\t\t} else if(numberOfStudents>1000) {\n\t\t\tconsole.log('Number of students must not be greater than 1,000.');\n\t\t\tbreak;\n\t\t} else if(numberOfStudents<2) {\n\t\t\tconsole.log('Number of students must not be less than 2.');\n\t\t\tbreak;\n\t\t} else {\n\t\t\ttotalStudents += numberOfStudents;\n\t\t\tif(totalStudents>50000) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else {\n\t\tlet scoresString = lines[count].split(' ');\n\t\t\n\t\tif(scoresString.length != numberOfStudents) {\n\t\t\tconsole.log(`Number of students is not equal to number of scores at line ${count+1}`);\n\t\t\tbreak;\n\t\t} else {\n\t\tlet scores = scoresString.map(score => +score);\n\t\t\tvar leastDiff = null;\n\t\t\tvar currentDiff;\n\t\t\tfor (let i = scores.length - 1; i >= 0; i--) {\n\t\t\t\tif(isNotGreaterThanMillion(scores[i])) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tfor(j=i; j>=0; j--) {\n\t\t\t\t\tif(i) {\n\t\t\t\t\t\tif (leastDiff != null) {\n\t\t\t\t\t\t\tcurrentDiff = Math.abs(scores[i] - scores[j-1]);\n\t\t\t\t\t\tif (currentDiff < leastDiff) {\n\t\t\t\t\t\t\tleastDiff = currentDiff;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tleastDiff = Math.abs(scores[i] - scores[j-1]);\n\t\t\t\t\t}\n\n\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t}\n\t\t\tconsole.log(leastDiff);\n\t\t}\n\t}\n\ncount++;\n\n}\n\nfunction isNotGreaterThanMillion(number) {\n\tif (number>1000000) {\n\t\treturn true;\n\t}\n}\n", "problem_context": "Selection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training.\nIn order to evaluate the effectiveness of this method,\nhe plans to carry out a control experiment.\nHaving two students as the participants of the experiment,\none of them will be trained under the conventional method\nand the other under his new method.\nComparing the final scores of these two,\nhe will be able to judge the effectiveness of his method.\n\nIt is important to select two students having the closest possible scores,\nfor making the comparison fair.\nHe has a list of the scores of all students\nwho can participate in the experiment.\nYou are asked to write a program which selects two of them\nhaving the smallest difference in their scores.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn\n\na1 a2 … an\n\nA dataset consists of two lines.\nThe number of students n is given in the first line.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nThe second line gives scores of n students.\nai (1 ≤ i ≤ n) is the score of the i-th student, which is a non-negative integer not greater than 1,000,000.\n\nThe end of the input is indicated by a line containing a zero.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, select two students with the smallest difference in their scores,\nand output in a line (the absolute value of) the difference.\n\nSample Input\n\n5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n\nOutput for the Sample Input\n\n0\n1\n5", "sample_input": "5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n"}, "reference_outputs": ["0\n1\n5\n"], "source_document_id": "p01093", "source_text": "Selection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training.\nIn order to evaluate the effectiveness of this method,\nhe plans to carry out a control experiment.\nHaving two students as the participants of the experiment,\none of them will be trained under the conventional method\nand the other under his new method.\nComparing the final scores of these two,\nhe will be able to judge the effectiveness of his method.\n\nIt is important to select two students having the closest possible scores,\nfor making the comparison fair.\nHe has a list of the scores of all students\nwho can participate in the experiment.\nYou are asked to write a program which selects two of them\nhaving the smallest difference in their scores.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn\n\na1 a2 … an\n\nA dataset consists of two lines.\nThe number of students n is given in the first line.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nThe second line gives scores of n students.\nai (1 ≤ i ≤ n) is the score of the i-th student, which is a non-negative integer not greater than 1,000,000.\n\nThe end of the input is indicated by a line containing a zero.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, select two students with the smallest difference in their scores,\nand output in a line (the absolute value of) the difference.\n\nSample Input\n\n5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n\nOutput for the Sample Input\n\n0\n1\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1495, "cpu_time_ms": 160, "memory_kb": 18484}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s382228468", "group_id": "codeNet:p01093", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst lines = input.trim().split('\\n');\n\nwhile (line = lines.shift()) {\n\n const numbers = line.split(' ').map(Number);\n // Edit from here\n\n if(numbers.length > 1){\n let keys = [...numbers.keys()]\n let nearest = Math.max(...numbers) - Math.min(...numbers) + 1;\n let result = [];\n for(let key = 0, lngth = numbers.length; key < lngth; key++){\n\n for(let innerKey = key + 1; innerKey < lngth; innerKey++){\n if( (Math.abs(numbers[keys[key]] - numbers[keys[innerKey]])) < nearest){\n result = [numbers[keys[key]], numbers[keys[innerKey]]];\n nearest = (Math.abs(numbers[keys[key]] - numbers[keys[innerKey]]));\n }\n }\n \n }\n if(result.length === 2){\n const [first, sec] = result\n var res = [first > sec ? first - sec : sec - first ]\n }\n console.log(res.toString())\n }\n // to here\n}\n\n", "language": "JavaScript", "metadata": {"date": 1551962794, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01093.html", "problem_id": "p01093", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01093/input.txt", "sample_output_relpath": "derived/input_output/data/p01093/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01093/JavaScript/s382228468.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s382228468", "user_id": "u873516385"}, "prompt_components": {"gold_output": "0\n1\n5\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst lines = input.trim().split('\\n');\n\nwhile (line = lines.shift()) {\n\n const numbers = line.split(' ').map(Number);\n // Edit from here\n\n if(numbers.length > 1){\n let keys = [...numbers.keys()]\n let nearest = Math.max(...numbers) - Math.min(...numbers) + 1;\n let result = [];\n for(let key = 0, lngth = numbers.length; key < lngth; key++){\n\n for(let innerKey = key + 1; innerKey < lngth; innerKey++){\n if( (Math.abs(numbers[keys[key]] - numbers[keys[innerKey]])) < nearest){\n result = [numbers[keys[key]], numbers[keys[innerKey]]];\n nearest = (Math.abs(numbers[keys[key]] - numbers[keys[innerKey]]));\n }\n }\n \n }\n if(result.length === 2){\n const [first, sec] = result\n var res = [first > sec ? first - sec : sec - first ]\n }\n console.log(res.toString())\n }\n // to here\n}\n\n", "problem_context": "Selection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training.\nIn order to evaluate the effectiveness of this method,\nhe plans to carry out a control experiment.\nHaving two students as the participants of the experiment,\none of them will be trained under the conventional method\nand the other under his new method.\nComparing the final scores of these two,\nhe will be able to judge the effectiveness of his method.\n\nIt is important to select two students having the closest possible scores,\nfor making the comparison fair.\nHe has a list of the scores of all students\nwho can participate in the experiment.\nYou are asked to write a program which selects two of them\nhaving the smallest difference in their scores.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn\n\na1 a2 … an\n\nA dataset consists of two lines.\nThe number of students n is given in the first line.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nThe second line gives scores of n students.\nai (1 ≤ i ≤ n) is the score of the i-th student, which is a non-negative integer not greater than 1,000,000.\n\nThe end of the input is indicated by a line containing a zero.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, select two students with the smallest difference in their scores,\nand output in a line (the absolute value of) the difference.\n\nSample Input\n\n5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n\nOutput for the Sample Input\n\n0\n1\n5", "sample_input": "5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n"}, "reference_outputs": ["0\n1\n5\n"], "source_document_id": "p01093", "source_text": "Selection of Participants of an Experiment\n\nDr. Tsukuba has devised a new method of programming training.\nIn order to evaluate the effectiveness of this method,\nhe plans to carry out a control experiment.\nHaving two students as the participants of the experiment,\none of them will be trained under the conventional method\nand the other under his new method.\nComparing the final scores of these two,\nhe will be able to judge the effectiveness of his method.\n\nIt is important to select two students having the closest possible scores,\nfor making the comparison fair.\nHe has a list of the scores of all students\nwho can participate in the experiment.\nYou are asked to write a program which selects two of them\nhaving the smallest difference in their scores.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn\n\na1 a2 … an\n\nA dataset consists of two lines.\nThe number of students n is given in the first line.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nThe second line gives scores of n students.\nai (1 ≤ i ≤ n) is the score of the i-th student, which is a non-negative integer not greater than 1,000,000.\n\nThe end of the input is indicated by a line containing a zero.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, select two students with the smallest difference in their scores,\nand output in a line (the absolute value of) the difference.\n\nSample Input\n\n5\n10 10 10 10 10\n5\n1 5 8 9 11\n7\n11 34 83 47 59 29 70\n0\n\nOutput for the Sample Input\n\n0\n1\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1031, "cpu_time_ms": 210, "memory_kb": 20336}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s726660704", "group_id": "codeNet:p01101", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst lines = input.trim().split('\\n');\nwhile (line = lines.shift()) {\n\tconst [n, max] = line.split(' ').map(Number);\n\tif (n === 0 && max === 0) { break; }\n\tconst temp = [];\n\n\tlet prices = lines.shift().split(' ').map(Number);\n\tfor (let i = 0; i <= max; i++) {\n\t\tfor (let j = i; j <= n; j++) {\n\t\t\tif (prices[i] + prices[j] <= max) {\n\t\t\t\ttemp.push(prices[i] + prices[j]);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst maxShits = Math.max(temp[temp.length - 1]);\n\n\tconsole.log(`${(temp.length > 1 && maxShits <= max) ? maxShits : 'NONE'}`)\n} \n\n", "language": "JavaScript", "metadata": {"date": 1545403946, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01101.html", "problem_id": "p01101", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01101/input.txt", "sample_output_relpath": "derived/input_output/data/p01101/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01101/JavaScript/s726660704.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s726660704", "user_id": "u389220812"}, "prompt_components": {"gold_output": "40\n10\n99\nNONE\n20\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst lines = input.trim().split('\\n');\nwhile (line = lines.shift()) {\n\tconst [n, max] = line.split(' ').map(Number);\n\tif (n === 0 && max === 0) { break; }\n\tconst temp = [];\n\n\tlet prices = lines.shift().split(' ').map(Number);\n\tfor (let i = 0; i <= max; i++) {\n\t\tfor (let j = i; j <= n; j++) {\n\t\t\tif (prices[i] + prices[j] <= max) {\n\t\t\t\ttemp.push(prices[i] + prices[j]);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst maxShits = Math.max(temp[temp.length - 1]);\n\n\tconsole.log(`${(temp.length > 1 && maxShits <= max) ? maxShits : 'NONE'}`)\n} \n\n", "problem_context": "Taro's Shopping\n\nMammy decided to give Taro his first shopping experience.\nMammy tells him to choose any two items he wants from those\nlisted in the shopping catalogue,\nbut Taro cannot decide which two, as all the items look attractive.\nThus he plans to buy the pair of two items with\nthe highest price sum, not exceeding the amount Mammy allows.\nAs getting two of the same item is boring, he wants two different items.\n\nYou are asked to help Taro select the two items.\nThe price list for all of the items is given.\nAmong pairs of two items in the list,\nfind the pair with the highest price sum\nnot exceeding the allowed amount,\nand report the sum.\nTaro is buying two items, not one, nor three, nor more.\nNote that, two or more items in the list may be priced equally.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn m\na1 a2 ... an\n\nA dataset consists of two lines.\nIn the first line, the number of items n and the maximum\npayment allowed m are given.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nm is an integer satisfying 2 ≤ m ≤ 2,000,000.\nIn the second line, prices of n items are given.\nai (1 ≤ i ≤ n) is the price\nof the i-th item.\nThis value is an integer greater than or equal to 1 and\nless than or equal to 1,000,000.\n\nThe end of the input is indicated by a line containing two zeros.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, find the pair with the highest price sum\nnot exceeding the allowed amount m\nand output the sum in a line.\nIf the price sum of every pair of items exceeds m,\noutput NONE instead.\n\nSample Input\n\n3 45\n10 20 30\n6 10\n1 2 5 8 9 11\n7 100\n11 34 83 47 59 29 70\n4 100\n80 70 60 50\n4 20\n10 5 10 16\n0 0\n\nOutput for the Sample Input\n\n40\n10\n99\nNONE\n20", "sample_input": "3 45\n10 20 30\n6 10\n1 2 5 8 9 11\n7 100\n11 34 83 47 59 29 70\n4 100\n80 70 60 50\n4 20\n10 5 10 16\n0 0\n"}, "reference_outputs": ["40\n10\n99\nNONE\n20\n"], "source_document_id": "p01101", "source_text": "Taro's Shopping\n\nMammy decided to give Taro his first shopping experience.\nMammy tells him to choose any two items he wants from those\nlisted in the shopping catalogue,\nbut Taro cannot decide which two, as all the items look attractive.\nThus he plans to buy the pair of two items with\nthe highest price sum, not exceeding the amount Mammy allows.\nAs getting two of the same item is boring, he wants two different items.\n\nYou are asked to help Taro select the two items.\nThe price list for all of the items is given.\nAmong pairs of two items in the list,\nfind the pair with the highest price sum\nnot exceeding the allowed amount,\nand report the sum.\nTaro is buying two items, not one, nor three, nor more.\nNote that, two or more items in the list may be priced equally.\n\nInput\n\nThe input consists of multiple datasets, each in the following format.\n\nn m\na1 a2 ... an\n\nA dataset consists of two lines.\nIn the first line, the number of items n and the maximum\npayment allowed m are given.\nn is an integer satisfying 2 ≤ n ≤ 1000.\nm is an integer satisfying 2 ≤ m ≤ 2,000,000.\nIn the second line, prices of n items are given.\nai (1 ≤ i ≤ n) is the price\nof the i-th item.\nThis value is an integer greater than or equal to 1 and\nless than or equal to 1,000,000.\n\nThe end of the input is indicated by a line containing two zeros.\nThe sum of n's of all the datasets does not exceed 50,000.\n\nOutput\n\nFor each dataset, find the pair with the highest price sum\nnot exceeding the allowed amount m\nand output the sum in a line.\nIf the price sum of every pair of items exceeds m,\noutput NONE instead.\n\nSample Input\n\n3 45\n10 20 30\n6 10\n1 2 5 8 9 11\n7 100\n11 34 83 47 59 29 70\n4 100\n80 70 60 50\n4 20\n10 5 10 16\n0 0\n\nOutput for the Sample Input\n\n40\n10\n99\nNONE\n20", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 580, "cpu_time_ms": 2510, "memory_kb": 43944}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s631750669", "group_id": "codeNet:p01131", "input_text": "var button = [\n [],\n ['.',',','!','?',' '],\n ['a','b','c'],\n ['d','e','f'],\n ['g','h','i'],\n ['j','k','l'],\n ['m','n','o'],\n ['p','q','r','s'],\n ['t','u','v'],\n ['w','x','y','z']\n]\n\n\nfunction Main(input){\n input = input.split(\"\\n\");\n var n = parseInt(input[0],10);\n\n for(var i = 1;i <= n;i++){\n var c,pre = 0,ans = \"\";\n for(var j = 0;j < input[i].length;j++){\n if(input[i][j] === '0'){\n if(pre != 0)\n ans += button[parseInt(input[i][j - 1],10)][c];\n }else if(pre == 0){\n c = 0;\n }else{\n c++;\n if(input[i][j] == \"1\")\n c %= 5;\n else if(input[i][j] == \"7\" || input[i][j] == '9')\n c %= 4;\n else\n c %= 3;\n }\n pre = parseInt(input[i][j],10);\n }\n console.log(ans);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\n ", "language": "JavaScript", "metadata": {"date": 1495152925, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01131.html", "problem_id": "p01131", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01131/input.txt", "sample_output_relpath": "derived/input_output/data/p01131/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01131/JavaScript/s631750669.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s631750669", "user_id": "u172120093"}, "prompt_components": {"gold_output": "a\nb\nb\nhello, world!\nkeitai\n", "input_to_evaluate": "var button = [\n [],\n ['.',',','!','?',' '],\n ['a','b','c'],\n ['d','e','f'],\n ['g','h','i'],\n ['j','k','l'],\n ['m','n','o'],\n ['p','q','r','s'],\n ['t','u','v'],\n ['w','x','y','z']\n]\n\n\nfunction Main(input){\n input = input.split(\"\\n\");\n var n = parseInt(input[0],10);\n\n for(var i = 1;i <= n;i++){\n var c,pre = 0,ans = \"\";\n for(var j = 0;j < input[i].length;j++){\n if(input[i][j] === '0'){\n if(pre != 0)\n ans += button[parseInt(input[i][j - 1],10)][c];\n }else if(pre == 0){\n c = 0;\n }else{\n c++;\n if(input[i][j] == \"1\")\n c %= 5;\n else if(input[i][j] == \"7\" || input[i][j] == '9')\n c %= 4;\n else\n c %= 3;\n }\n pre = parseInt(input[i][j],10);\n }\n console.log(ans);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\n ", "problem_context": "Problem A: Keitai Message\n\nAlice さんは Miku さんに携帯電話でメールを送ろうとしている。\n\n携帯電話には入力に使えるボタンは数字のボタンしかない。 そこで、文字の入力をするために数字ボタンを何度か押して文字の入力を行う。携帯電話の数字ボタンには、次の文字が割り当てられており、ボタン 0 は確定ボタンが割り当てられている。この携帯電話では 1 文字の入力が終わったら必ず確定ボタンを押すことになっている。\n\n1: . , ! ? (スペース)\n\n2: a b c\n\n3: d e f\n\n4: g h i\n\n5: j k l\n\n6: m n o\n\n7: p q r s\n\n8: t u v\n\n9: w x y z\n\n0: 確定ボタン\n\n例えば、ボタン 2、ボタン 2、ボタン 0 と押すと、文字が 'a' → 'b' と変化し、ここで確定ボタンが押されるので、文字 b が出力される。\n同じ数字を続けて入力すると変化する文字はループする。すなわち、ボタン 2 を 5 回押して、次にボタン 0 を押すと、文字が 'a' → 'b' → 'c' → 'a' → 'b' と変化し、ここで確定ボタンを押されるから 'b' が出力される。\n\n何もボタンが押されていないときに確定ボタンを押すことはできるが、その場合には何も文字は出力されない。\n\nあなたの仕事は、Alice さんが押したボタンの列から、Alice さんが作ったメッセージを再現することである。\n\nInput\n\n最初の行にテストケースの数が与えられる。 続いて各テストケースについて、最大で長さ 1024 の数字列が1行で与えられる。\n\nOutput\n\nAlice さんが作ったメッセージの文字列をそれぞれのテストケースについて 1 行ごとに出力せよ。\nただし、出力は 1 文字以上 76 文字未満であると仮定してよい。\n\nSample Input\n\n5\n20\n220\n222220\n44033055505550666011011111090666077705550301110\n000555555550000330000444000080000200004440000\n\nOutput for the Sample Input\n\na\nb\nb\nhello, world!\nkeitai", "sample_input": "5\n20\n220\n222220\n44033055505550666011011111090666077705550301110\n000555555550000330000444000080000200004440000\n"}, "reference_outputs": ["a\nb\nb\nhello, world!\nkeitai\n"], "source_document_id": "p01131", "source_text": "Problem A: Keitai Message\n\nAlice さんは Miku さんに携帯電話でメールを送ろうとしている。\n\n携帯電話には入力に使えるボタンは数字のボタンしかない。 そこで、文字の入力をするために数字ボタンを何度か押して文字の入力を行う。携帯電話の数字ボタンには、次の文字が割り当てられており、ボタン 0 は確定ボタンが割り当てられている。この携帯電話では 1 文字の入力が終わったら必ず確定ボタンを押すことになっている。\n\n1: . , ! ? (スペース)\n\n2: a b c\n\n3: d e f\n\n4: g h i\n\n5: j k l\n\n6: m n o\n\n7: p q r s\n\n8: t u v\n\n9: w x y z\n\n0: 確定ボタン\n\n例えば、ボタン 2、ボタン 2、ボタン 0 と押すと、文字が 'a' → 'b' と変化し、ここで確定ボタンが押されるので、文字 b が出力される。\n同じ数字を続けて入力すると変化する文字はループする。すなわち、ボタン 2 を 5 回押して、次にボタン 0 を押すと、文字が 'a' → 'b' → 'c' → 'a' → 'b' と変化し、ここで確定ボタンを押されるから 'b' が出力される。\n\n何もボタンが押されていないときに確定ボタンを押すことはできるが、その場合には何も文字は出力されない。\n\nあなたの仕事は、Alice さんが押したボタンの列から、Alice さんが作ったメッセージを再現することである。\n\nInput\n\n最初の行にテストケースの数が与えられる。 続いて各テストケースについて、最大で長さ 1024 の数字列が1行で与えられる。\n\nOutput\n\nAlice さんが作ったメッセージの文字列をそれぞれのテストケースについて 1 行ごとに出力せよ。\nただし、出力は 1 文字以上 76 文字未満であると仮定してよい。\n\nSample Input\n\n5\n20\n220\n222220\n44033055505550666011011111090666077705550301110\n000555555550000330000444000080000200004440000\n\nOutput for the Sample Input\n\na\nb\nb\nhello, world!\nkeitai", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1012, "cpu_time_ms": 70, "memory_kb": 16988}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s911560835", "group_id": "codeNet:p01139", "input_text": "function bomb(y,x){\n cnt++;\n var dx=[0,-1,1,0];\n var dy=[-1,0,0,1];\n for(var i=0;i<4;i++){\n var X=x+dx[i];\n var Y=y+dy[i];\n if(Y>=h || Y<0 || X>=w || X<0)continue;\n if(yx[Y][X]==\"S\")continue;\n else if(yx[Y][X]==\".\"){yx[Y][X]=\"S\";bomb(Y,X);}\n else {\n if(color==\"\" || color==yx[Y][X])color=yx[Y][X];\n else color=\"bad\";\n }\n }\n}\nvar input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var wh=arr.shift();\n if(wh==\"0 0\")break;\n wh=wh.split(\" \").map(Number);\n var w=wh[0];\n var h=wh[1];\n var yx=[];\n for(var i=0;i=h || Y<0 || X>=w || X<0)continue;\n if(yx[Y][X]==\"S\")continue;\n else if(yx[Y][X]==\".\"){yx[Y][X]=\"S\";bomb(Y,X);}\n else {\n if(color==\"\" || color==yx[Y][X])color=yx[Y][X];\n else color=\"bad\";\n }\n }\n}\nvar input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\");\nwhile(true){\n var wh=arr.shift();\n if(wh==\"0 0\")break;\n wh=wh.split(\" \").map(Number);\n var w=wh[0];\n var h=wh[1];\n var yx=[];\n for(var i=0;i{\n var flag = v.every(val=> val==\".\");\n if(!flag){\n cnt=0;\n return true;\n }else if(flag && cnt==0){\n cnt++;\n return true;\n }else {\n return false;\n }\n });\n return yx;\n}\n\nfunction kaiten(yx){\n return yx[0].map((a, i) => yx.map(b => b[i]));\n}\n\nfunction saikiY(y,x,d){\n if(yx[y][x] != \".\")return yx[y][x];\n else if(y+d!=-1 && y+d!=h)return saikiY(y+d,x,d);\n else return \".\";\n}\n\nfunction saikiX(y,x,d){\n if(yx[y][x]!=\".\")return yx[y][x];\n else if(x+d!=-1 && x+d!=w)return saikiX(y,x+d,d);\n else return \".\";\n}\n\nfunction kesu(y,x){\n var arr= [saikiY(y,x,1),saikiY(y,x,-1),saikiX(y,x,1),saikiX(y,x,-1)];\n var a = arr.filter(function (x, i, self) {\n if(x==\".\")return false;\n return self.indexOf(x) === i && i !== self.lastIndexOf(x);\n });\n a.forEach(v=> replaceFn(y,x,v));\n return a.length*2;\n}\n\nfunction replaceFn(y,x,s){\n for(var i=0;i v.split(\"\"));\nyx=syukusyou(yx);\nyx=kaiten(yx);\nyx=syukusyou(yx);\nvar h=yx.length;\nvar w=yx[0].length;\nvar sum=0;\nwhile(true){\n var flag=false;\n yx.forEach((ary,y)=>{\n ary.forEach((v,x)=>{\n if(v==\".\"){\n var add = kesu(y,x);\n if(add != 0)flag=true;\n sum += add;\n }\n });\n });\n if(!flag)break;\n}\nconsole.log(sum);\n", "language": "JavaScript", "metadata": {"date": 1560269331, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01416.html", "problem_id": "p01416", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01416/input.txt", "sample_output_relpath": "derived/input_output/data/p01416/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01416/JavaScript/s632858151.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s632858151", "user_id": "u540218629"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "function syukusyou(yx){\n var cnt=0;\n yx=yx.filter(v=>{\n var flag = v.every(val=> val==\".\");\n if(!flag){\n cnt=0;\n return true;\n }else if(flag && cnt==0){\n cnt++;\n return true;\n }else {\n return false;\n }\n });\n return yx;\n}\n\nfunction kaiten(yx){\n return yx[0].map((a, i) => yx.map(b => b[i]));\n}\n\nfunction saikiY(y,x,d){\n if(yx[y][x] != \".\")return yx[y][x];\n else if(y+d!=-1 && y+d!=h)return saikiY(y+d,x,d);\n else return \".\";\n}\n\nfunction saikiX(y,x,d){\n if(yx[y][x]!=\".\")return yx[y][x];\n else if(x+d!=-1 && x+d!=w)return saikiX(y,x+d,d);\n else return \".\";\n}\n\nfunction kesu(y,x){\n var arr= [saikiY(y,x,1),saikiY(y,x,-1),saikiX(y,x,1),saikiX(y,x,-1)];\n var a = arr.filter(function (x, i, self) {\n if(x==\".\")return false;\n return self.indexOf(x) === i && i !== self.lastIndexOf(x);\n });\n a.forEach(v=> replaceFn(y,x,v));\n return a.length*2;\n}\n\nfunction replaceFn(y,x,s){\n for(var i=0;i v.split(\"\"));\nyx=syukusyou(yx);\nyx=kaiten(yx);\nyx=syukusyou(yx);\nvar h=yx.length;\nvar w=yx[0].length;\nvar sum=0;\nwhile(true){\n var flag=false;\n yx.forEach((ary,y)=>{\n ary.forEach((v,x)=>{\n if(v==\".\"){\n var add = kesu(y,x);\n if(add != 0)flag=true;\n sum += add;\n }\n });\n });\n if(!flag)break;\n}\nconsole.log(sum);\n", "problem_context": "J: Tiles are Colorful\n\nICPC で良い成績を収めるには修行が欠かせない.うさぎは ICPC で勝ちたいので,今日も修行をすることにした.\n\n今日の修行は,流行りのパズルをすばやく解いて,瞬発力を鍛えようというものである.今日挑戦するのは,色とりどりのタイルが並んでいてそれらを上手く消していくパズルだ\n\n初期状態では,グリッド上のいくつかのマスにタイルが置かれている.各タイルには色がついている.プレイヤーはゲーム開始後,以下の手順で示される操作を何回も行うことができる.\n\nタイルが置かれていないマスを 1 つ選択し,そのマスを叩く.\n\n叩いたマスから上に順に辿っていき,タイルが置かれているマスに至ったところでそのタイルに着目する.タイルが置かれているマスがないまま盤面の端に辿り着いたら何にも着目しない.\n\n同様の操作を叩いたマスから下・左・右方向に対して行う.最大 4 枚のタイルが着目されることになる.\n\n着目したタイルの中で同じ色のものがあれば,それらのタイルを盤面から取り除く.同じ色のタイルの組が 2 組あれば,それら両方を取り除く.\n\nタイルを取り除いた枚数と同じ値の得点が入る.\n\n着目をやめる.\n\nたとえば,以下のような状況を考えよう.タイルが置かれていないマスはピリオドで,タイルの色はアルファベット大文字で表されている.\n\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....\n\nここで上から 2 行目,左から 3 列目のマスを叩く操作を考える.着目することになるタイルは A , B , B の 3 枚であるから,B の 2 枚が消えて盤面は以下のようになり,2 点を得る.\n\n..A.......\n..........\n..........\n..........\n..A.CC....\n\nこのパズルはゆっくりしていると時間切れになってしまい,盤面の一部が見えなくなりどのくらい修行が足りなかったのかがわからなくなってしまう.\n各色のタイルは 2 枚ずつ置かれているが,それらをすべて消せるとは限らないので,予めプログラムに得点の最大値を計算させておきたい.\n\nInput\n\nM N\nC1,1C1,2...C1,N\nC2,1C2,2...C2,N\n...\nCM,1CM,2...CM,N\n\n整数 M, N は盤が 縦 M × 横 N のマス目であることを表す.Ci, j はアルファベット大文字またはピリオド ( . ) であり,上から i 行目,左から j 列目のマスについて,アルファベット大文字の場合は置かれているタイルの色を表し,ピリオドの場合はこのマスにタイルが置かれていないことを表す.\n\n1 ≤ M ≤ 500,1 ≤ N ≤ 500 を満たす.各アルファベット大文字は入力中に 0 個または 2 個現れる.\n\nOutput\n\n得点の最大値を 1 行に出力せよ.\n\nSample Input 1\n\n5 10\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....\n\nSample Output 1\n\n4\n\nSample Input 2\n\n3 3\nABC\nD.D\nCBA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n5 7\nNUTUBOR\nQT.SZRQ\nSANAGIP\nLMDGZBM\nKLKIODP\n\nSample Output 3\n\n34", "sample_input": "5 10\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....\n"}, "reference_outputs": ["4\n"], "source_document_id": "p01416", "source_text": "J: Tiles are Colorful\n\nICPC で良い成績を収めるには修行が欠かせない.うさぎは ICPC で勝ちたいので,今日も修行をすることにした.\n\n今日の修行は,流行りのパズルをすばやく解いて,瞬発力を鍛えようというものである.今日挑戦するのは,色とりどりのタイルが並んでいてそれらを上手く消していくパズルだ\n\n初期状態では,グリッド上のいくつかのマスにタイルが置かれている.各タイルには色がついている.プレイヤーはゲーム開始後,以下の手順で示される操作を何回も行うことができる.\n\nタイルが置かれていないマスを 1 つ選択し,そのマスを叩く.\n\n叩いたマスから上に順に辿っていき,タイルが置かれているマスに至ったところでそのタイルに着目する.タ��ルが置かれているマスがないまま盤面の端に辿り着いたら何にも着目しない.\n\n同様の操作を叩いたマスから下・左・右方向に対して行う.最大 4 枚のタイルが着目されることになる.\n\n着目したタイルの中で同じ色のものがあれば,それらのタイルを盤面から取り除く.同じ色のタイルの組が 2 組あれば,それら両方を取り除く.\n\nタイルを取り除いた枚数と同じ値の得点が入る.\n\n着目をやめる.\n\nたとえば,以下のような状況を考えよう.タイルが置かれていないマスはピリオドで,タイルの色はアルファベット大文字で表されている.\n\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....\n\nここで上から 2 行目,左から 3 列目のマスを叩く操作を考える.着目することになるタイルは A , B , B の 3 枚であるから,B の 2 枚が消えて盤面は以下のようになり,2 点を得る.\n\n..A.......\n..........\n..........\n..........\n..A.CC....\n\nこのパズルはゆっくりしていると時間切れになってしまい,盤面の一部が見えなくなりどのくらい修行が足りなかったのかがわからなくなってしまう.\n各色のタイルは 2 枚ずつ置かれているが,それらをすべて消せるとは限らないので,予めプログラムに得点の最大値を計算させておきたい.\n\nInput\n\nM N\nC1,1C1,2...C1,N\nC2,1C2,2...C2,N\n...\nCM,1CM,2...CM,N\n\n整数 M, N は盤が 縦 M × 横 N のマス目であることを表す.Ci, j はアルファベット大文字またはピリオド ( . ) であり,上から i 行目,左から j 列目のマスについて,アルファベット大文字の場合は置かれているタイルの色を表し,ピリオドの場合はこのマスにタイルが置かれていないことを表す.\n\n1 ≤ M ≤ 500,1 ≤ N ≤ 500 を満たす.各アルファベット大文字は入力中に 0 個または 2 個現れる.\n\nOutput\n\n得点の最大値を 1 行に出力せよ.\n\nSample Input 1\n\n5 10\n..A.......\n.......B..\n..........\n..B.......\n..A.CC....\n\nSample Output 1\n\n4\n\nSample Input 2\n\n3 3\nABC\nD.D\nCBA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n5 7\nNUTUBOR\nQT.SZRQ\nSANAGIP\nLMDGZBM\nKLKIODP\n\nSample Output 3\n\n34", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1611, "cpu_time_ms": 140, "memory_kb": 26532}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s318593231", "group_id": "codeNet:p01428", "input_text": "var dx = [1,1,1,0,0,-1,-1,-1];\nvar dy = [1,0,-1,1,-1,1,0,-1];\n\nfunction judge(s,turn,ii,jj){\n var sum = 0;\n for(var i = 0;i < 8;i++){\n var su = 0;\n var x = jj + dx[i],y = ii + dy[i];\n while(x > 0 && x < 9 && y > 0 && y < 9){\n if(s[y][x] == turn){sum += su;break;}\n else if(s[y][x] == turn * (-1))su++;\n else\n break;\n x += dx[i];y += dy[i];\n }\n }\n return sum;\n}\n\nfunction put(s,turn,ii,jj){\n for(var i = 0;i < 8;i++){\n var su = 0;\n var x = jj + dx[i],y = ii + dy[i];\n var flag = false;\n while(x > 0 && x < 9 && y > 0 && y < 9){\n if(s[y][x] == turn){flag = true;break;}\n else if(s[y][x] == turn * (-1))su++;\n else\n break;\n x += dx[i];y += dy[i];\n }\n if(flag){\n var x = jj + dx[i],y = ii + dy[i];\n for(var j = 0;j < su;j++){\n s[y][x] = turn;\n x += dx[i];y += dy[i];\n }\n }\n }\n s[ii][jj] = turn;\n}\n\n\n\nfunction Main(input){\n input = input.split(\"\\n\");\n var s = [];\n for(var i = 1;i <= 8;i++){\n s[i] = [];\n }\n\n var fin = 0;\n\n for(var i = 1;i <= 8;i++){\n for(var j = 1;j <= 8;j++){\n if(input[i - 1][j - 1] == 'o'){\n fin++;\n s[i][j] = 1;\n }\n else if (input[i - 1][j - 1] == 'x'){\n fin++;\n s[i][j] = -1;\n }\n else\n s[i][j] = 0;\n }\n }\n\n var turn = 1;var aaa = false;\n\n while(fin < 64){\n var maxi = 0,imax = -1,jmax = -1;\n if(turn == 1){\n for(var i = 1;i <= 8;i++){\n for(var j = 1;j <= 8;j++){\n if(s[i][j] == 0){\n var a = judge(s,turn,i,j);\n if(a > maxi){\n maxi = a;imax = i;jmax = j;\n }\n }\n }\n }\n }else{\n for(var i = 1;i <= 8;i++){\n for(var j = 1;j <= 8;j++){\n if(s[i][j] == 0){\n var a = judge(s,turn,i,j);\n if(a >= maxi){\n maxi = a;imax = i;jmax = j;\n }\n }\n }\n }\n }\n\n if(maxi > 0){\n aaa = false;\n fin++;\n put(s,turn,imax,jmax);\n }else{\n if(aaa)\n break;\n aaa = true;\n }\n turn *= (-1);\n }\n\n for(var i = 1;i <= 8;i++){\n var ans = \"\";\n for(var j = 1;j <= 8;j++){\n if(s[i][j] == 1)\n ans += 'o';\n else if(s[i][j] == (-1))\n ans += 'x';\n else\n ans += '.';\n }\n console.log(ans);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1495597744, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01428.html", "problem_id": "p01428", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01428/input.txt", "sample_output_relpath": "derived/input_output/data/p01428/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01428/JavaScript/s318593231.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s318593231", "user_id": "u172120093"}, "prompt_components": {"gold_output": "ooooo...\n.o......\nooo.....\n...o....\n....o...\n........\n........\n........\n", "input_to_evaluate": "var dx = [1,1,1,0,0,-1,-1,-1];\nvar dy = [1,0,-1,1,-1,1,0,-1];\n\nfunction judge(s,turn,ii,jj){\n var sum = 0;\n for(var i = 0;i < 8;i++){\n var su = 0;\n var x = jj + dx[i],y = ii + dy[i];\n while(x > 0 && x < 9 && y > 0 && y < 9){\n if(s[y][x] == turn){sum += su;break;}\n else if(s[y][x] == turn * (-1))su++;\n else\n break;\n x += dx[i];y += dy[i];\n }\n }\n return sum;\n}\n\nfunction put(s,turn,ii,jj){\n for(var i = 0;i < 8;i++){\n var su = 0;\n var x = jj + dx[i],y = ii + dy[i];\n var flag = false;\n while(x > 0 && x < 9 && y > 0 && y < 9){\n if(s[y][x] == turn){flag = true;break;}\n else if(s[y][x] == turn * (-1))su++;\n else\n break;\n x += dx[i];y += dy[i];\n }\n if(flag){\n var x = jj + dx[i],y = ii + dy[i];\n for(var j = 0;j < su;j++){\n s[y][x] = turn;\n x += dx[i];y += dy[i];\n }\n }\n }\n s[ii][jj] = turn;\n}\n\n\n\nfunction Main(input){\n input = input.split(\"\\n\");\n var s = [];\n for(var i = 1;i <= 8;i++){\n s[i] = [];\n }\n\n var fin = 0;\n\n for(var i = 1;i <= 8;i++){\n for(var j = 1;j <= 8;j++){\n if(input[i - 1][j - 1] == 'o'){\n fin++;\n s[i][j] = 1;\n }\n else if (input[i - 1][j - 1] == 'x'){\n fin++;\n s[i][j] = -1;\n }\n else\n s[i][j] = 0;\n }\n }\n\n var turn = 1;var aaa = false;\n\n while(fin < 64){\n var maxi = 0,imax = -1,jmax = -1;\n if(turn == 1){\n for(var i = 1;i <= 8;i++){\n for(var j = 1;j <= 8;j++){\n if(s[i][j] == 0){\n var a = judge(s,turn,i,j);\n if(a > maxi){\n maxi = a;imax = i;jmax = j;\n }\n }\n }\n }\n }else{\n for(var i = 1;i <= 8;i++){\n for(var j = 1;j <= 8;j++){\n if(s[i][j] == 0){\n var a = judge(s,turn,i,j);\n if(a >= maxi){\n maxi = a;imax = i;jmax = j;\n }\n }\n }\n }\n }\n\n if(maxi > 0){\n aaa = false;\n fin++;\n put(s,turn,imax,jmax);\n }else{\n if(aaa)\n break;\n aaa = true;\n }\n turn *= (-1);\n }\n\n for(var i = 1;i <= 8;i++){\n var ans = \"\";\n for(var j = 1;j <= 8;j++){\n if(s[i][j] == 1)\n ans += 'o';\n else if(s[i][j] == (-1))\n ans += 'x';\n else\n ans += '.';\n }\n console.log(ans);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "問題文\n\nお菓子の魔女 CHARLOTTE は巴マミとクッキーゲームを楽しんでいる.クッキーゲームは 8\\times 8 の格子状���区切られたテーブルクロスの上にチーズクッキーとチョコレートクッキーを置いて行われる.各格子には高々 1 個のチョコレートクッキーまたはチーズクッキーしか置くことはできない.\n\nお菓子の魔女はチーズクッキーを,巴マミはチョコレートクッキーを交互に置いてゲームを行う.自分のクッキーを置いたあと,そのクッキーから上下左右斜めの各 8 方向について,置くクッキーとすでに置いていた自分のクッキーの間に相手のクッキーのみが直線に並んでいた場合に,その挟まれた相手のクッキーのすべてが自分のクッキーで置き換えられる.クッキーゲームのプレイヤーは自分のターンが回ってきた時,1 つ自分のクッキーを置くことができる.ただし,相手のクッキーを少なくとも 1 つ以上自分のクッキーに置き換えられなければならない.そのような置き場がない場合,自分のターンをパスをしなければならない.\n\nお菓子の魔女も巴マミも考えるのが少々苦手である.そこで,回ってきたターン毎にそのターンの中で置き換えられるクッキーの数を最大化することを考えることにした.巴マミのターンのときに置き換えられるクッキーの数を最大にするようなクッキーを置く場所の候補が複数ある場合は,より上の場所を,それでも複数ある場合はより左の場所を選択することにした.また同様に,お菓子の魔女のターンのときに候補が複数ある場合はより下の場所を,それでも複数ある場合はより右の場所を選択することにした.\n\nテーブルクロスに置かれたクッキーの状態が与えられるので,巴マミからはじめ,彼女たちがそこからクッキーゲームを行い,共に新たなクッキーが置けなくなるまでゲームを続けた時のテーブルクロスの上に置かれたクッキーの状態を求めよ.\n\n入力形式\n\n入力は以下の形式で与えられる.\n\ns_{11} s_{12} ... s_{18}\\\\\ns_{21} s_{22} ... s_{28}\\\\\n...\\\\\ns_{81} s_{82} ... s_{88}\\\\\n\ns_{ij} はテーブルクロスに置かれたクッキーの初期状態を表す文字で,上から i 行目,左から j 列目の格子の状態を表す.チョコレートクッキーが置かれているときs_{ij}は 'o' であり,チーズクッキーが置かれているときは 'x', 何も置かれていないときは '.' となる.\n\n出力形式\n\nクッキーゲームが行われた後のテーブルクロスの上に置かれたクッキーの状態を,入力形式と同じ形式で出力せよ.\n\n制約\n\ns_{ij} は 'o', 'x', '.' のいずれかである.\n\n入出力例\n\n入力例 1\n\nooox....\n.x......\nooo.....\n........\n........\n........\n........\n........\n\n出力例1\n\nooooo...\n.o......\nooo.....\n...o....\n....o...\n........\n........\n........\n\n入力例 2\n\n........\n........\n........\n...ox...\n...xo...\n........\n........\n........\n\n出力例 2\n\nxxxxxxxx\nxxxooxxx\nxxxxooxx\nxxxxxxxx\nooxxooox\nooxoooox\noxooooox\nooooooox\n\n入力例 3\n\n........\n........\n..ooo...\n..oxo...\n..ooo...\n........\n........\n........\n\n出力例 3\n\n........\n........\n..ooo...\n..ooo...\n..ooo...\n.....o..\n......o.\n........\n\nProblem Setter: Flat35", "sample_input": "ooox....\n.x......\nooo.....\n........\n........\n........\n........\n........\n"}, "reference_outputs": ["ooooo...\n.o......\nooo.....\n...o....\n....o...\n........\n........\n........\n"], "source_document_id": "p01428", "source_text": "問題文\n\nお菓子の魔女 CHARLOTTE は巴マミとクッキーゲームを楽しんでいる.クッキーゲームは 8\\times 8 の格子状に区切られたテーブルクロスの上にチーズクッキーとチョコレートクッキーを置いて行われる.各格子には高々 1 個のチョコレートクッキーまたはチーズクッキーしか置くことはできない.\n\nお菓子の魔女はチーズクッキーを,巴マミはチョコレートクッキーを交互に置いてゲームを行う.自分のクッキーを置いたあと,そのクッキーから上下左右斜めの各 8 方向について,置くクッキーとすでに置いていた自分のクッキーの間に相手のクッキーのみが直線に並んでいた場合に,その挟まれた相手のクッキーのすべてが自分のクッキーで置き換えられる.クッキーゲームのプレイヤーは自分のターンが回ってきた時,1 つ自分のクッキーを置くことができる.ただし,相手のクッキーを少なくとも 1 つ以上自分のクッキーに置き換えられなければならない.そのような置き場がない場合,自分のターンをパスをしなければならない.\n\nお菓子の魔女も巴マミも考えるのが少々苦手である.そこで,回ってきたターン毎にそのターンの中で置き換えられるクッキーの数を最大化することを考えることにした.巴マミのターンのときに置き換えられるクッキーの数を最大にするようなクッキーを置く場所の候補が複数ある場合は,より上の場所を,それでも複数ある場合はより左の場所を選択することにした.また同様に,お菓子の魔女のターンのときに候補が複数ある場合はより下の場所を,それでも複数ある場合はより右の場所を選択することにした.\n\nテーブルクロスに置かれたクッキーの状態が与えられるので,巴マミからはじめ,彼女たちがそこからクッキーゲームを行い,共に新たなクッキーが置けなくなるまでゲームを続けた時のテーブルクロスの上に置かれたクッキーの状態を求めよ.\n\n入力形式\n\n入力は以下の形式で与えられる.\n\ns_{11} s_{12} ... s_{18}\\\\\ns_{21} s_{22} ... s_{28}\\\\\n...\\\\\ns_{81} s_{82} ... s_{88}\\\\\n\ns_{ij} はテーブルクロスに置かれたクッキーの初期状態を表す文字で,上から i 行目,左から j 列目の格子の状態を表す.チョコレートクッキーが置かれているときs_{ij}は 'o' であり,チーズクッキーが置かれているときは 'x', 何も置かれていないときは '.' となる.\n\n出力形式\n\nクッキーゲームが行われた後のテーブルクロスの上に置かれたクッキーの状態を,入力形式と同じ形式で出力せよ.\n\n制約\n\ns_{ij} は 'o', 'x', '.' のいずれかである.\n\n入出力例\n\n入力例 1\n\nooox....\n.x......\nooo.....\n........\n........\n........\n........\n........\n\n出力例1\n\nooooo...\n.o......\nooo.....\n...o....\n....o...\n........\n........\n........\n\n入力例 2\n\n........\n........\n........\n...ox...\n...xo...\n........\n........\n........\n\n出力例 2\n\nxxxxxxxx\nxxxooxxx\nxxxxooxx\nxxxxxxxx\nooxxooox\nooxoooox\noxooooox\nooooooox\n\n入力例 3\n\n........\n........\n..ooo...\n..oxo...\n..ooo...\n........\n........\n........\n\n出力例 3\n\n........\n........\n..ooo...\n..ooo...\n..ooo...\n.....o..\n......o.\n........\n\nProblem Setter: Flat35", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2988, "cpu_time_ms": 60, "memory_kb": 15864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s763714206", "group_id": "codeNet:p01802", "input_text": "function Main(input){\n input = input.split(\"\\n\");\n var k = 0;\n while(1){\n input[k] = input[k].split(\" \");\n var d = parseInt(input[k][0],10);\n var e = parseInt(input[k++][1],10);\n if(d == 0 && e == 0)\n break;\n\n var min = 100000000;\n for(var i = 0;i <= d;i++){\n if(Math.abs(e - Math.sqrt(i * i + (d - i) * (d - i))) < min)\n min = Math.abs(e - Math.sqrt(i * i + (d - i) * (d - i)));\n }\n console.log(min);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1495179148, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01802.html", "problem_id": "p01802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01802/input.txt", "sample_output_relpath": "derived/input_output/data/p01802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01802/JavaScript/s763714206.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s763714206", "user_id": "u172120093"}, "prompt_components": {"gold_output": "0.4142135624\n0\n0.0827625303\n0\n48.7401153702\n33\n", "input_to_evaluate": "function Main(input){\n input = input.split(\"\\n\");\n var k = 0;\n while(1){\n input[k] = input[k].split(\" \");\n var d = parseInt(input[k][0],10);\n var e = parseInt(input[k++][1],10);\n if(d == 0 && e == 0)\n break;\n\n var min = 100000000;\n for(var i = 0;i <= d;i++){\n if(Math.abs(e - Math.sqrt(i * i + (d - i) * (d - i))) < min)\n min = Math.abs(e - Math.sqrt(i * i + (d - i) * (d - i)));\n }\n console.log(min);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "MathJax.Hub.Config({\ntex2jax: {inlineMath: [['$','$'], ['\\\\(','\\\\)']]}\n});\n\nKoto Municipal Subway\n\nKoto市営地下鉄\n\nKoto市は,下図のよ��に,道路が碁盤の目状である有名な街である.\n南北に伸びる道と東西に伸びる道は,それぞれ1kmの間隔で並んでいる.\nKoto市の最も南西の交差点にあるKoto駅を (0, 0) として,そこから東に x km,北に y km 進んだ位置を (x, y) と記すこととする (0 ≤ x, y である).\n\n5年後に開かれるオリンピックにより観光客が増大することを見越して,市はKoto駅を始発駅とする新しい地下鉄の路線を建設することを決めた.\n現在,Koto駅の次の駅として新しく建設されるShin-Koto駅までのレールを敷く計画を立てている.\nレールは,Koto駅からShin-Koto駅に向かってまっすぐ敷く.\n従って,Shin-Koto駅の場所を (x, y) としたとき,レールの長さは, √(x2 + y2) である.\nレールを敷くための費用は,敷いたレールの長さ分だけ必要になる.\nレールの長さが1.5kmのように小数であっても,費用も同じように1.5必要となる.\n\nShin-Koto駅の場所 (x, y) はまだ決定しておらず,以下の条件を満たす場所にする予定である.\n\n交差点である.つまり, x と y がそれぞれ整数である.\n\nKoto駅から道路に沿って歩いた最短距離が,ちょうど D である.つまり, x + y = D を満たす.\n\n上の2つの条件を満たす中で,市が定めるレールの予算 E とレールの費用とのずれ | √(x2 + y2) - E | が最小となるようにShin-Koto駅の場所を選ぶ.\nここで |A| は, A の絶対値を表す.\nあなたの仕事は,上記のようにShin-Koto駅を建設したときの,レールを敷くための費用と予算とのずれを出力するプログラムを作成することである.\n\nInput\n\n入力は,複数のデータセットから構成され,1つの入力に含まれるデータセットの数は100以下である. 各データセットの形式は次の通りである.\n\nD E\n\nD (1 ≤ D ≤ 100)は,Koto駅からShin-Koto駅まで道路に沿って歩いたときの最短距離を表す整数である.\nE (1 ≤ E ≤ 100)は,レール建設のための予算を表す整数である.\n\n入力の終わりは,空白で区切られた2つのゼロからなる行によって示される.\n\nOutput\n\n各データセットに対して,問題の条件を満たすようにレールを敷いたときの費用と予算とのずれを1行で出力せよ.\n答えには 10-3 を越える絶対誤差があってはならない.\n各行の終わりに改行を出力しなかった場合や,不必要な文字を出力した場合,誤答と判断されてしまうため,注意すること.\n\nSample Input\n\n2 1\n7 5\n7 6\n7 7\n76 5\n8 41\n0 0\n\nOutput for Sample Input\n\n0.4142135624\n0\n0.0827625303\n0\n48.7401153702\n33\n\nHint\n\n1つ目のデータセットでは,下図のように,Koto駅から道路に沿って2km進んだ交差点がShin-Koto駅を建設する場所の候補となる.\n\n各交差点にShin-Koto駅を建設した場合の,レールを敷くための費用と予算1とのずれは次のようになる.\n\n(2, 0) : | √(22 + 02) - 1 | = 1.0\n\n(1, 1) : | √(12 + 12) - 1 | = 0.4142135623...\n\n(0, 2) : | √(02 + 22) - 1 | = 1.0\n\nよって,費用と予算とのずれが最小になるのは, (1, 1) に建設した場合となる.", "sample_input": "2 1\n7 5\n7 6\n7 7\n76 5\n8 41\n0 0\n"}, "reference_outputs": ["0.4142135624\n0\n0.0827625303\n0\n48.7401153702\n33\n"], "source_document_id": "p01802", "source_text": "MathJax.Hub.Config({\ntex2jax: {inlineMath: [['$','$'], ['\\\\(','\\\\)']]}\n});\n\nKoto Municipal Subway\n\nKoto市営地下鉄\n\nKoto市は,下図のように,道路が碁盤の目状である有名な街である.\n南北に伸びる道と東西に伸びる道は,それぞれ1kmの間隔で並んでいる.\nKoto市の最も南西の交差点にあるKoto駅を (0, 0) として,そこから東に x km,北に y km 進んだ位置を (x, y) と記すこととする (0 ≤ x, y である).\n\n5年後に開かれるオリンピックにより観光客が増大することを見越して,市はKoto駅を始発駅とする新しい地下鉄の路線を建設することを決めた.\n現在,Koto駅の次の駅として新しく建設されるShin-Koto駅までのレールを敷く計画を立てている.\nレールは,Koto駅からShin-Koto駅に向かってまっすぐ敷く.\n従って,Shin-Koto駅の場所を (x, y) としたとき,レールの長さは, √(x2 + y2) である.\nレールを敷くための費用は,敷いたレールの長さ分だけ必要になる.\nレールの長さが1.5kmのように小数であっても,費用も同じように1.5必要となる.\n\nShin-Koto駅の場所 (x, y) はまだ決定しておらず,以下の条件を満たす場所にする予定である.\n\n交差点である.つまり, x と y がそれぞれ整���である.\n\nKoto駅から道路に沿って歩いた最短距離が,ちょうど D である.つまり, x + y = D を満たす.\n\n上の2つの条件を満たす中で,市が定めるレールの予算 E とレールの費用とのずれ | √(x2 + y2) - E | が最小となるようにShin-Koto駅の場所を選ぶ.\nここで |A| は, A の絶対値を表す.\nあなたの仕事は,上記のようにShin-Koto駅を建設したときの,レールを敷くための費用と予算とのずれを出力するプログラムを作成することである.\n\nInput\n\n入力は,複数のデータセットから構成され,1つの入力に含まれるデータセットの数は100以下である. 各データセットの形式は次の通りである.\n\nD E\n\nD (1 ≤ D ≤ 100)は,Koto駅からShin-Koto駅まで道路に沿って歩いたときの最短距離を表す整数である.\nE (1 ≤ E ≤ 100)は,レール建設のための予算を表す整数である.\n\n入力の終わりは,空白で区切られた2つのゼロからなる行によって示される.\n\nOutput\n\n各データセットに対して,問題の条件を満たすようにレールを敷いたときの費用と予算とのずれを1行で出力せよ.\n答えには 10-3 を越える絶対誤差があってはならない.\n各行の終わりに改行を出力しなかった場合や,不必要な文字を出力した場合,誤答と判断されてしまうため,注意すること.\n\nSample Input\n\n2 1\n7 5\n7 6\n7 7\n76 5\n8 41\n0 0\n\nOutput for Sample Input\n\n0.4142135624\n0\n0.0827625303\n0\n48.7401153702\n33\n\nHint\n\n1つ目のデータセットでは,下図のように,Koto駅から道路に沿って2km進んだ交差点がShin-Koto駅を建設する場所の候補となる.\n\n各交差点にShin-Koto駅を建設した場合の,レールを敷くための費用と予算1とのずれは次のようになる.\n\n(2, 0) : | √(22 + 02) - 1 | = 1.0\n\n(1, 1) : | √(12 + 12) - 1 | = 0.4142135623...\n\n(0, 2) : | √(02 + 22) - 1 | = 1.0\n\nよって,費用と予算とのずれが最小になるのは, (1, 1) に建設した場合となる.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 566, "cpu_time_ms": 60, "memory_kb": 17104}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s675977247", "group_id": "codeNet:p01839", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr = input.trim().split(\"\\n\");\nvar n = arr.shift() - 0;\nvar a = 0;\nfor (var i = 0; i < n; i++) {\n (arr[i] == \"A\") ? a++ : a--;\n if (a < 0) break;\n}\nconsole.log((a == 0) ? \"YES\" : \"NO\");", "language": "JavaScript", "metadata": {"date": 1481191116, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p01839.html", "problem_id": "p01839", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p01839/input.txt", "sample_output_relpath": "derived/input_output/data/p01839/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p01839/JavaScript/s675977247.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s675977247", "user_id": "u540218629"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr = input.trim().split(\"\\n\");\nvar n = arr.shift() - 0;\nvar a = 0;\nfor (var i = 0; i < n; i++) {\n (arr[i] == \"A\") ? a++ : a--;\n if (a < 0) break;\n}\nconsole.log((a == 0) ? \"YES\" : \"NO\");", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nA - 阿吽の呼吸\n\nProblem Statement\n\n時は進んで 2060 年,共に 70 歳を迎える前田さんと後藤さんは長い付き合いの友人であり,大学時代にACM-ICPCで共に戦った仲間でもある.\n\n二人は今でもよく一緒にお茶を飲みつつ,競技プログラミングの話で盛り上がっている.\n\n二人で一緒にお茶を飲む時,前田さんが 1 回Aと言うと,その発言の後に後藤さんがちょうど 1 回Unと返事をする習慣がいつのまにか出来た.\n\nしかし最近後藤さんは物忘れや勘違いをすることが多く,前田さんがAと言っても,後藤さんはたまにUnの返事を忘れたり,余計に返事をしたりする.\n\nついこの間も前田さんと後藤さんはお茶を飲みながら,二人のお気に入りのデータ構造について話し込んでいたようだ.\n\nこの時の会話の中から,Aで表される前田さんの発言と,Unで表される後藤さんの返事のみからなる記録が時系列で与えられたとき,後藤さんが習慣通りに反応したとみなすことが出来るかチェックしてほしい.\n\n注意点として,前田さんの発言に対し,後藤さんの返事が多少遅れても,後藤さんは習慣通りに反応したとみなせる場合がある,ということが挙げられる.\n例えば,前田さんが2回連続してAと言った後,後藤さんが 2 回連続してUnと返事をして会話が終了した場合は,後藤さんが習慣通りの返事をしたとみなされる (Sample Input 2 参照).\n\nまた,会話が終了した時点で,前田さんがAと言った回数と,後藤さんがUnと返事した回数が一致しても,後藤さんが習慣通りに返事をしたとはみなされない場合もあるので注意すること.\n例えば,前田さんが1回Aと言った後,後藤さんが 2 回連続してUnと返事し,その後で前田さんが 1 回Aと言って会話が終了した場合は,後藤さんが習慣通りの返事をしたとはみなされない (Sample Input 3 参照).\n\nInput\n\n入力は以下の形式で与えられる.\n\n$N$\n\n$S_1$\n\n$S_2$\n\n$…$\n\n$S_N$\n\n最初の行はひとつの整数からなる.\n$N$ は,記録に含まれる前田さんがAと発言した回数と後藤さんがUnと返事した回数の合計を表し,$1 \\leq N \\leq 100$ を満たす.\nその後 $N$ 行に,文字列 $S_i$ が続き,各 $S_i (1 \\leq i \\leq N)$ はAかUnのどちらかに一致する.ここでAは前田さんの発言,Unは後藤さんの返事を表す.\n$i$ の小さい順に $S_i$ が記録されたものとする.\n前田さんと後藤さんが同時に発言することは無かったとする.\n\nOutput\n\n後藤さんが習慣通りに反応したとみなすことが出来ればYES,出来なければNOを1行で出力すること.\n\nSample Input 1\n\n4\nA\nUn\nA\nUn\n\nOutput for the Sample Input 1\n\nYES\n\nSample Input 2\n\n4\nA\nA\nUn\nUn\n\nOutput for the Sample Input 2\n\nYES\n\nSample Input 3\n\n4\nA\nUn\nUn\nA\n\nOutput for the Sample Input 3\n\nNO\n\nSample Input 4\n\n1\nUn\n\nOutput for the Sample Input 4\n\nNO", "sample_input": "4\nA\nUn\nA\nUn\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p01839", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nA - 阿吽の呼吸\n\nProblem Statement\n\n時は進んで 2060 年,共に 70 歳を迎える前田さんと後藤さんは長い付き合いの友人であり,大学時代にACM-ICPCで共に戦った仲間でもある.\n\n二人は今でもよく一緒にお茶を飲みつつ,競技プログラミングの話で盛り上がっている.\n\n二人で一緒にお茶を飲む時,前田さんが 1 回Aと言うと,その発言の後に後藤さんがちょうど 1 回Unと返事をする習慣がいつのまにか出来た.\n\nしかし最近後藤さんは物忘れや勘違いをすることが多く,前田さんがAと言っても,後藤さんはたまにUnの返事を忘れたり,余計に返事をしたりする.\n\nついこの間も前田さんと後藤さんはお茶を飲みながら,二人のお気に入りのデータ構造について話し込んでいたようだ.\n\nこの時の会話の中から,Aで表される前田さんの発言と,Unで表される後藤さんの返事のみからなる記録が時系列で与えられたとき,後藤さんが習慣通りに反応したとみなすことが出来るかチェックしてほしい.\n\n注意点として,前田さんの発言に対し,後藤さんの返事が多少遅れても,後藤さんは習慣通りに反応したとみなせる場合がある,ということが挙げられる.\n例えば,前田さんが2回連続してAと言った後,後藤さんが 2 回連続してUnと返事をして会話が終了した場合は,後藤さんが習慣通りの返事をしたとみなされる (Sample Input 2 参照).\n\nまた,会話が終了した時点で,前田さんがAと言った回数と,後藤さんがUnと返事した回数が一致しても,後藤さんが習慣通りに返事をしたとはみなされない場合もあるので注意すること.\n例えば,前田さんが1回Aと言った後,後藤さんが 2 回連続してUnと返事し,その後で前田さんが 1 回Aと言って会話が終了した場合は,後藤さんが習慣通りの返事をしたとはみなされない (Sample Input 3 参照).\n\nInput\n\n入力は以下の形式で与えられる.\n\n$N$\n\n$S_1$\n\n$S_2$\n\n$…$\n\n$S_N$\n\n最初の行はひとつの整数からなる.\n$N$ は,記録に含まれる前田さんがAと発言した回数と後藤さんがUnと返事した回数の合計を��し,$1 \\leq N \\leq 100$ を満たす.\nその後 $N$ 行に,文字列 $S_i$ が続き,各 $S_i (1 \\leq i \\leq N)$ はAかUnのどちらかに一致する.ここでAは前田さんの発言,Unは後藤さんの返事を表す.\n$i$ の小さい順に $S_i$ が記録されたものとする.\n前田さんと後藤さんが同時に発言することは無かったとする.\n\nOutput\n\n後藤さんが習慣通りに反応したとみなすことが出来ればYES,出来なければNOを1行で出力すること.\n\nSample Input 1\n\n4\nA\nUn\nA\nUn\n\nOutput for the Sample Input 1\n\nYES\n\nSample Input 2\n\n4\nA\nA\nUn\nUn\n\nOutput for the Sample Input 2\n\nYES\n\nSample Input 3\n\n4\nA\nUn\nUn\nA\n\nOutput for the Sample Input 3\n\nNO\n\nSample Input 4\n\n1\nUn\n\nOutput for the Sample Input 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 256, "cpu_time_ms": 60, "memory_kb": 15524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s084875979", "group_id": "codeNet:p02016", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nif(input==\"ani\")console.log(\"square1001\");\nelse console.log(\"e869120\");\n", "language": "JavaScript", "metadata": {"date": 1546410419, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02016.html", "problem_id": "p02016", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02016/input.txt", "sample_output_relpath": "derived/input_output/data/p02016/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02016/JavaScript/s084875979.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s084875979", "user_id": "u540218629"}, "prompt_components": {"gold_output": "square1001\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nif(input==\"ani\")console.log(\"square1001\");\nelse console.log(\"e869120\");\n", "problem_context": "B: 双子 (Twins)\n\nとある双子は、自分たちのどちらが兄でどちらが弟かがあまり知られていないことに腹を立てた。\n\n\"ani\" と入力されたら \"square1001\"、\"otouto\" と入力されたら \"e869120\" と出力するプログラムを作りなさい。\n\n入力\n\n入力として \"ani\" または \"otouto\" という文字列のどちらかが与えられます。\n\n出力\n\n\"e869120\" または \"square1001\" を、問題文の通りに出力してください。最後の改行を忘れないようにしましょう。\n\n入力例1\n\nani\n\n出力例1\n\nsquare1001\n\n入力例2\n\notouto\n\n出力例2\n\ne869120", "sample_input": "ani\n"}, "reference_outputs": ["square1001\n"], "source_document_id": "p02016", "source_text": "B: 双子 (Twins)\n\nとある双子は、自分たちのどちらが兄でどちらが弟かがあまり知られていないことに腹を立てた。\n\n\"ani\" と入力されたら \"square1001\"、\"otouto\" と入力されたら \"e869120\" と出力するプログラムを作りなさい。\n\n入力\n\n入力として \"ani\" または \"otouto\" という文字列のどちらかが与えられます。\n\n出力\n\n\"e869120\" または \"square1001\" を、問題文の通りに出力してください。最後の改行を忘れないようにしましょう。\n\n入力例1\n\nani\n\n出力例1\n\nsquare1001\n\n入力例2\n\notouto\n\n出力例2\n\ne869120", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 134, "cpu_time_ms": 70, "memory_kb": 15088}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s970596489", "group_id": "codeNet:p02233", "input_text": "const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\\n');\n\nconst fib = n => {\n const memo = [];\n const helper = x => {\n if (x <= 1) return 1;\n if (memo[x] !== undefined) return memo[x];\n memo[x] = helper(x-1) + helper(x-2);\n return memo[x];\n }\n\n return helper(n);\n};\n\nconsole.log(fib(44));\n", "language": "JavaScript", "metadata": {"date": 1530582879, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02233.html", "problem_id": "p02233", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02233/input.txt", "sample_output_relpath": "derived/input_output/data/p02233/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02233/JavaScript/s970596489.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s970596489", "user_id": "u707214955"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\\n');\n\nconst fib = n => {\n const memo = [];\n const helper = x => {\n if (x <= 1) return 1;\n if (memo[x] !== undefined) return memo[x];\n memo[x] = helper(x-1) + helper(x-2);\n return memo[x];\n }\n\n return helper(n);\n};\n\nconsole.log(fib(44));\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nFibonacci Number\n\nWrite a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula:\n\n\\begin{equation*}\nfib(n)= \\left \\{\n\\begin{array}{ll}\n1  & (n = 0) \\\\\n1  & (n = 1) \\\\\nfib(n - 1) + fib(n - 2) & \\\\\n\\end{array}\n\\right.\n\\end{equation*}\n\nInput\n\nAn integer $n$ is given.\n\noutput\n\nPrint the $n$-th fibonacci number in a line.\n\nConstraints\n\n$0 \\leq n \\leq 44$\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02233", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nFibonacci Number\n\nWrite a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula:\n\n\\begin{equation*}\nfib(n)= \\left \\{\n\\begin{array}{ll}\n1  & (n = 0) \\\\\n1  & (n = 1) \\\\\nfib(n - 1) + fib(n - 2) & \\\\\n\\end{array}\n\\right.\n\\end{equation*}\n\nInput\n\nAn integer $n$ is given.\n\noutput\n\nPrint the $n$-th fibonacci number in a line.\n\nConstraints\n\n$0 \\leq n \\leq 44$\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 348, "cpu_time_ms": 80, "memory_kb": 15128}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s538527861", "group_id": "codeNet:p02237", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst inputs = input.trim().split('\\n');\nconst n = Number(inputs.shift());\nconst adj = inputs.map((s) => s.split(' ').map(Number));\n\nconst G = (new Array(n)).fill(0).map(() => (new Array(n)).fill(0));\nfor (let i = 0; i < n; i++) {\n const u = adj[i][0];\n const k = adj[i][1];\n const v = adj[i].slice(2);\n\n for (let j = 0; j < k; j++) {\n G[u - 1][v[j] - 1] = 1;\n }\n}\n\nfor (let i = 0; i < G.length; i++) {\n console.log(G[i].join(' '));\n}\n\n", "language": "JavaScript", "metadata": {"date": 1519362203, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02237.html", "problem_id": "p02237", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02237/input.txt", "sample_output_relpath": "derived/input_output/data/p02237/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02237/JavaScript/s538527861.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s538527861", "user_id": "u779137493"}, "prompt_components": {"gold_output": "0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst inputs = input.trim().split('\\n');\nconst n = Number(inputs.shift());\nconst adj = inputs.map((s) => s.split(' ').map(Number));\n\nconst G = (new Array(n)).fill(0).map(() => (new Array(n)).fill(0));\nfor (let i = 0; i < n; i++) {\n const u = adj[i][0];\n const k = adj[i][1];\n const v = adj[i].slice(2);\n\n for (let j = 0; j < k; j++) {\n G[u - 1][v[j] - 1] = 1;\n }\n}\n\nfor (let i = 0; i < G.length; i++) {\n console.log(G[i].join(' '));\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nGraph\n\nThere are two standard ways to represent a graph $G = (V, E)$, where $V$ is a set of vertices and $E$ is a set of edges; Adjacency list representation and Adjacency matrix representation.\n\nAn adjacency-list representation consists of an array $Adj[|V|]$ of $|V|$ lists, one for each vertex in $V$. For each $u \\in V$, the adjacency list $Adj[u]$ contains all vertices $v$ such that there is an edge $(u, v) \\in E$. That is, $Adj[u]$ consists of all vertices adjacent to $u$ in $G$.\n\nAn adjacency-matrix representation consists of $|V| \\times |V|$ matrix $A = a_{ij}$ such that $a_{ij} = 1$ if $(i, j) \\in E$, $a_{ij} = 0$ otherwise.\n\nWrite a program which reads a directed graph $G$ represented by the adjacency list, and prints its adjacency-matrix representation. $G$ consists of $n\\; (=|V|)$ vertices identified by their IDs $1, 2,.., n$ respectively.\n\nInput\n\nIn the first line, an integer $n$ is given. In the next $n$ lines, an adjacency list $Adj[u]$ for vertex $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is vertex ID and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nAs shown in the following sample output, print the adjacent-matrix representation of $G$. Put a single space character between $a_{ij}$.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input\n\n4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n\nSample Output\n\n0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0", "sample_input": "4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n"}, "reference_outputs": ["0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0\n"], "source_document_id": "p02237", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nGraph\n\nThere are two standard ways to represent a graph $G = (V, E)$, where $V$ is a set of vertices and $E$ is a set of edges; Adjacency list representation and Adjacency matrix representation.\n\nAn adjacency-list representation consists of an array $Adj[|V|]$ of $|V|$ lists, one for each vertex in $V$. For each $u \\in V$, the adjacency list $Adj[u]$ contains all vertices $v$ such that there is an edge $(u, v) \\in E$. That is, $Adj[u]$ consists of all vertices adjacent to $u$ in $G$.\n\nAn adjacency-matrix representation consists of $|V| \\times |V|$ matrix $A = a_{ij}$ such that $a_{ij} = 1$ if $(i, j) \\in E$, $a_{ij} = 0$ otherwise.\n\nWrite a program which reads a directed graph $G$ represented by the adjacency list, and prints its adjacency-matrix representation. $G$ consists of $n\\; (=|V|)$ vertices identified by their IDs $1, 2,.., n$ respectively.\n\nInput\n\nIn the first line, an integer $n$ is given. In the next $n$ lines, an adjacency list $Adj[u]$ for vertex $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is vertex ID and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nAs shown in the following sample output, print the adjacent-matrix representation of $G$. Put a single space character between $a_{ij}$.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input\n\n4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n\nSample Output\n\n0 1 0 1\n0 0 0 1\n0 0 0 0\n0 0 1 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 510, "cpu_time_ms": 80, "memory_kb": 16712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s310070390", "group_id": "codeNet:p02238", "input_text": "(function main() {\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const adjLists = Array.from(Array(n), () => []);\n lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => adjLists[i].push(e-1)));\n\n const d = [], f = [];\n dfs(adjLists, d, f);\n for (let i = 0; i < n; i++) {\n console.log(i + 1, d[i], f[i]);\n }\n})();\n\nfunction dfs(adjLists, d, f) {\n const WHITE = 0, GRAY = 1, BLACK = 2;\n const size = adjLists.length;\n const color = Array.from(adjLists, () => WHITE);\n\n let time = 0;\n function visit(u) {\n color[u] = GRAY;\n d[u] = ++time;\n adjLists[u].forEach(v => {\n if (color[v] === WHITE) {\n visit(v);\n }\n });\n color[u] = BLACK;\n f[u] = ++time;\n }\n adjLists.forEach((u, i) => {\n if (color[i] === WHITE) visit(i);\n });\n}\n\n", "language": "JavaScript", "metadata": {"date": 1532055053, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02238.html", "problem_id": "p02238", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02238/input.txt", "sample_output_relpath": "derived/input_output/data/p02238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02238/JavaScript/s310070390.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s310070390", "user_id": "u298224238"}, "prompt_components": {"gold_output": "1 1 8\n2 2 7\n3 4 5\n4 3 6\n", "input_to_evaluate": "(function main() {\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const adjLists = Array.from(Array(n), () => []);\n lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => adjLists[i].push(e-1)));\n\n const d = [], f = [];\n dfs(adjLists, d, f);\n for (let i = 0; i < n; i++) {\n console.log(i + 1, d[i], f[i]);\n }\n})();\n\nfunction dfs(adjLists, d, f) {\n const WHITE = 0, GRAY = 1, BLACK = 2;\n const size = adjLists.length;\n const color = Array.from(adjLists, () => WHITE);\n\n let time = 0;\n function visit(u) {\n color[u] = GRAY;\n d[u] = ++time;\n adjLists[u].forEach(v => {\n if (color[v] === WHITE) {\n visit(v);\n }\n });\n color[u] = BLACK;\n f[u] = ++time;\n }\n adjLists.forEach((u, i) => {\n if (color[i] === WHITE) visit(i);\n });\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDepth First Search\n\nDepth-first search (DFS) follows the strategy to search ”deeper” in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leaving it. When all of $v$'s edges have been explored, the search ”backtracks” to explore edges leaving the vertex from which $v$ was discovered.\n\nThis process continues until all the vertices that are reachable from the original source vertex have been discovered. If any undiscovered vertices remain, then one of them is selected as a new source and the search is repeated from that source.\n\nDFS timestamps each vertex as follows:\n\n$d[v]$ records when $v$ is first discovered.\n\n$f[v]$ records when the search finishes examining $v$’s adjacency list.\n\nWrite a program which reads a directed graph $G = (V, E)$ and demonstrates DFS on the graph based on the following rules:\n\n$G$ is given in an adjacency-list. Vertices are identified by IDs $1, 2,... n$ respectively.\n\nIDs in the adjacency list are arranged in ascending order.\n\nThe program should report the discover time and the finish time for each vertex.\n\nWhen there are several candidates to visit during DFS, the algorithm should select the vertex with the smallest ID.\n\nThe timestamp starts with 1.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices of $G$ is given. In the next $n$ lines, adjacency lists of $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nFor each vertex, print $id$, $d$ and $f$ separated by a space character in a line. $id$ is ID of the vertex, $d$ and $f$ is the discover time and the finish time respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input 1\n\n4\n1 1 2\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 1 8\n2 2 7\n3 4 5\n4 3 6\n\nSample Input 2\n\n6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 0\n\nSample Output 2\n\n1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n\nThis is example for Sample Input 2 (discover/finish)\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "4\n1 1 2\n2 1 4\n3 0\n4 1 3\n"}, "reference_outputs": ["1 1 8\n2 2 7\n3 4 5\n4 3 6\n"], "source_document_id": "p02238", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDepth First Search\n\nDepth-first search (DFS) follows the strategy to search ”deeper” in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leaving it. When all of $v$'s edges have been explored, the search ”backtracks” to explore edges leaving the vertex from which $v$ was discovered.\n\nThis process continues until all the vertices that are reachable from the original source vertex have been discovered. If any undiscovered vertices remain, then one of them is selected as a new source and the search is repeated from that source.\n\nDFS timestamps each vertex as follows:\n\n$d[v]$ records when $v$ is first discovered.\n\n$f[v]$ records when the search finishes examining $v$’s adjacency list.\n\nWrite a program which reads a directed graph $G = (V, E)$ and demonstrates DFS on the graph based on the following rules:\n\n$G$ is given in an adjacency-list. Vertices are identified by IDs $1, 2,... n$ respectively.\n\nIDs in the adjacency list are arranged in ascending order.\n\nThe program should report the discover time and the finish time for each vertex.\n\nWhen there are several candidates to visit during DFS, the algorithm should select the vertex with the smallest ID.\n\nThe timestamp starts with 1.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices of $G$ is given. In the next $n$ lines, adjacency lists of $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nFor each vertex, print $id$, $d$ and $f$ separated by a space character in a line. $id$ is ID of the vertex, $d$ and $f$ is the discover time and the finish time respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input 1\n\n4\n1 1 2\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 1 8\n2 2 7\n3 4 5\n4 3 6\n\nSample Input 2\n\n6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 0\n\nSample Output 2\n\n1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n\nThis is example for Sample Input 2 (discover/finish)\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 858, "cpu_time_ms": 90, "memory_kb": 16800}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s609810582", "group_id": "codeNet:p02238", "input_text": "(function main() {\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const adjLists = Array.from(Array(n), () => []);\n lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => adjLists[i].push(e-1)));\n\n const d = [], f = [];\n dfs(adjLists, d, f);\n for (let i = 0; i < n; i++) {\n console.log(`${i + 1} ${d[i]} ${f[i]}`);\n }\n})();\n\nfunction dfs(adjLists, d, f) {\n const WHITE = 0, GRAY = 1, BLACK = 2;\n const size = adjLists.length;\n const color = Array.from(adjLists, () => WHITE);\n\n let time = 0;\n function visit(u) {\n color[u] = GRAY;\n d[u] = ++time;\n adjLists[u].forEach(v => {\n if (color[v] === WHITE) {\n visit(v);\n }\n });\n color[u] = BLACK;\n f[u] = ++time;\n }\n adjLists.forEach((e, u) => {\n if (color[u] === WHITE) visit(u);\n });\n}\n\n", "language": "JavaScript", "metadata": {"date": 1532060877, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02238.html", "problem_id": "p02238", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02238/input.txt", "sample_output_relpath": "derived/input_output/data/p02238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02238/JavaScript/s609810582.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s609810582", "user_id": "u298224238"}, "prompt_components": {"gold_output": "1 1 8\n2 2 7\n3 4 5\n4 3 6\n", "input_to_evaluate": "(function main() {\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const adjLists = Array.from(Array(n), () => []);\n lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => adjLists[i].push(e-1)));\n\n const d = [], f = [];\n dfs(adjLists, d, f);\n for (let i = 0; i < n; i++) {\n console.log(`${i + 1} ${d[i]} ${f[i]}`);\n }\n})();\n\nfunction dfs(adjLists, d, f) {\n const WHITE = 0, GRAY = 1, BLACK = 2;\n const size = adjLists.length;\n const color = Array.from(adjLists, () => WHITE);\n\n let time = 0;\n function visit(u) {\n color[u] = GRAY;\n d[u] = ++time;\n adjLists[u].forEach(v => {\n if (color[v] === WHITE) {\n visit(v);\n }\n });\n color[u] = BLACK;\n f[u] = ++time;\n }\n adjLists.forEach((e, u) => {\n if (color[u] === WHITE) visit(u);\n });\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDepth First Search\n\nDepth-first search (DFS) follows the strategy to search ”deeper” in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leaving it. When all of $v$'s edges have been explored, the search ”backtracks” to explore edges leaving the vertex from which $v$ was discovered.\n\nThis process continues until all the vertices that are reachable from the original source vertex have been discovered. If any undiscovered vertices remain, then one of them is selected as a new source and the search is repeated from that source.\n\nDFS timestamps each vertex as follows:\n\n$d[v]$ records when $v$ is first discovered.\n\n$f[v]$ records when the search finishes examining $v$’s adjacency list.\n\nWrite a program which reads a directed graph $G = (V, E)$ and demonstrates DFS on the graph based on the following rules:\n\n$G$ is given in an adjacency-list. Vertices are identified by IDs $1, 2,... n$ respectively.\n\nIDs in the adjacency list are arranged in ascending order.\n\nThe program should report the discover time and the finish time for each vertex.\n\nWhen there are several candidates to visit during DFS, the algorithm should select the vertex with the smallest ID.\n\nThe timestamp starts with 1.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices of $G$ is given. In the next $n$ lines, adjacency lists of $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nFor each vertex, print $id$, $d$ and $f$ separated by a space character in a line. $id$ is ID of the vertex, $d$ and $f$ is the discover time and the finish time respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input 1\n\n4\n1 1 2\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 1 8\n2 2 7\n3 4 5\n4 3 6\n\nSample Input 2\n\n6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 0\n\nSample Output 2\n\n1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n\nThis is example for Sample Input 2 (discover/finish)\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "4\n1 1 2\n2 1 4\n3 0\n4 1 3\n"}, "reference_outputs": ["1 1 8\n2 2 7\n3 4 5\n4 3 6\n"], "source_document_id": "p02238", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDepth First Search\n\nDepth-first search (DFS) follows the strategy to search ”deeper” in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leaving it. When all of $v$'s edges have been explored, the search ”backtracks” to explore edges leaving the vertex from which $v$ was discovered.\n\nThis process continues until all the vertices that are reachable from the original source vertex have been discovered. If any undiscovered vertices remain, then one of them is selected as a new source and the search is repeated from that source.\n\nDFS timestamps each vertex as follows:\n\n$d[v]$ records when $v$ is first discovered.\n\n$f[v]$ records when the search finishes examining $v$’s adjacency list.\n\nWrite a program which reads a directed graph $G = (V, E)$ and demonstrates DFS on the graph based on the following rules:\n\n$G$ is given in an adjacency-list. Vertices are identified by IDs $1, 2,... n$ respectively.\n\nIDs in the adjacency list are arranged in ascending order.\n\nThe program should report the discover time and the finish time for each vertex.\n\nWhen there are several candidates to visit during DFS, the algorithm should select the vertex with the smallest ID.\n\nThe timestamp starts with 1.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices of $G$ is given. In the next $n$ lines, adjacency lists of $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nFor each vertex, print $id$, $d$ and $f$ separated by a space character in a line. $id$ is ID of the vertex, $d$ and $f$ is the discover time and the finish time respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input 1\n\n4\n1 1 2\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 1 8\n2 2 7\n3 4 5\n4 3 6\n\nSample Input 2\n\n6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 0\n\nSample Output 2\n\n1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n\nThis is example for Sample Input 2 (discover/finish)\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 867, "cpu_time_ms": 80, "memory_kb": 17064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s002570421", "group_id": "codeNet:p02238", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst inputs = input.trim().split('\\n');\nconst n = Number(inputs.shift());\nconst adj = inputs.map((s) => s.split(' ').map(Number));\n\nclass Time {\n constructor(now = 0) {\n this.now = now;\n }\n getNow() {\n return ++this.now;\n }\n}\nconst time = new Time();\n\nclass Node {\n constructor(id) {\n this.id = id;\n this.children = [];\n }\n add(node) {\n this.children.push(node);\n }\n isVisited() {\n return !!this.start;\n }\n calc() {\n this.start = time.getNow();\n this.children.sort((a, b) => a.id > b.id);\n this.children.forEach(child => child.isVisited() || child.calc());\n this.end = time.getNow();\n }\n toString() {\n return [this.id, this.start, this.end].join(' ');\n }\n}\n\nclass Tree {\n constructor() {\n this.map = new Map();\n }\n getNode(id) {\n this.map.has(id) || this.map.set(id, new Node(id));\n return this.map.get(id);\n }\n calc() {\n for (let i = 1; i <= this.map.size; i++) {\n const node = this.map.get(i);\n node.isVisited() || node.calc();\n }\n }\n print() {\n for (let i = 1; i <= this.map.size; i++) {\n const node = this.map.get(i);\n console.log(node.toString());\n }\n }\n}\n\nconst tree = new Tree();\nadj.forEach(([u, k, ...vk]) => {\n const parent = tree.getNode(u);\n vk.forEach(v => {\n const node = tree.getNode(v);\n parent.add(node);\n });\n});\n\ntree.calc();\ntree.print();\n\n", "language": "JavaScript", "metadata": {"date": 1519908719, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02238.html", "problem_id": "p02238", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02238/input.txt", "sample_output_relpath": "derived/input_output/data/p02238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02238/JavaScript/s002570421.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s002570421", "user_id": "u779137493"}, "prompt_components": {"gold_output": "1 1 8\n2 2 7\n3 4 5\n4 3 6\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst inputs = input.trim().split('\\n');\nconst n = Number(inputs.shift());\nconst adj = inputs.map((s) => s.split(' ').map(Number));\n\nclass Time {\n constructor(now = 0) {\n this.now = now;\n }\n getNow() {\n return ++this.now;\n }\n}\nconst time = new Time();\n\nclass Node {\n constructor(id) {\n this.id = id;\n this.children = [];\n }\n add(node) {\n this.children.push(node);\n }\n isVisited() {\n return !!this.start;\n }\n calc() {\n this.start = time.getNow();\n this.children.sort((a, b) => a.id > b.id);\n this.children.forEach(child => child.isVisited() || child.calc());\n this.end = time.getNow();\n }\n toString() {\n return [this.id, this.start, this.end].join(' ');\n }\n}\n\nclass Tree {\n constructor() {\n this.map = new Map();\n }\n getNode(id) {\n this.map.has(id) || this.map.set(id, new Node(id));\n return this.map.get(id);\n }\n calc() {\n for (let i = 1; i <= this.map.size; i++) {\n const node = this.map.get(i);\n node.isVisited() || node.calc();\n }\n }\n print() {\n for (let i = 1; i <= this.map.size; i++) {\n const node = this.map.get(i);\n console.log(node.toString());\n }\n }\n}\n\nconst tree = new Tree();\nadj.forEach(([u, k, ...vk]) => {\n const parent = tree.getNode(u);\n vk.forEach(v => {\n const node = tree.getNode(v);\n parent.add(node);\n });\n});\n\ntree.calc();\ntree.print();\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDepth First Search\n\nDepth-first search (DFS) follows the strategy to search ”deeper” in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leaving it. When all of $v$'s edges have been explored, the search ”backtracks” to explore edges leaving the vertex from which $v$ was discovered.\n\nThis process continues until all the vertices that are reachable from the original source vertex have been discovered. If any undiscovered vertices remain, then one of them is selected as a new source and the search is repeated from that source.\n\nDFS timestamps each vertex as follows:\n\n$d[v]$ records when $v$ is first discovered.\n\n$f[v]$ records when the search finishes examining $v$’s adjacency list.\n\nWrite a program which reads a directed graph $G = (V, E)$ and demonstrates DFS on the graph based on the following rules:\n\n$G$ is given in an adjacency-list. Vertices are identified by IDs $1, 2,... n$ respectively.\n\nIDs in the adjacency list are arranged in ascending order.\n\nThe program should report the discover time and the finish time for each vertex.\n\nWhen there are several candidates to visit during DFS, the algorithm should select the vertex with the smallest ID.\n\nThe timestamp starts with 1.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices of $G$ is given. In the next $n$ lines, adjacency lists of $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nFor each vertex, print $id$, $d$ and $f$ separated by a space character in a line. $id$ is ID of the vertex, $d$ and $f$ is the discover time and the finish time respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input 1\n\n4\n1 1 2\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 1 8\n2 2 7\n3 4 5\n4 3 6\n\nSample Input 2\n\n6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 0\n\nSample Output 2\n\n1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n\nThis is example for Sample Input 2 (discover/finish)\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "4\n1 1 2\n2 1 4\n3 0\n4 1 3\n"}, "reference_outputs": ["1 1 8\n2 2 7\n3 4 5\n4 3 6\n"], "source_document_id": "p02238", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDepth First Search\n\nDepth-first search (DFS) follows the strategy to search ”deeper” in the graph whenever possible. In DFS, edges are recursively explored out of the most recently discovered vertex $v$ that still has unexplored edges leaving it. When all of $v$'s edges have been explored, the search ”backtracks” to explore edges leaving the vertex from which $v$ was discovered.\n\nThis process continues until all the vertices that are reachable from the original source vertex have been discovered. If any undiscovered vertices remain, then one of them is selected as a new source and the search is repeated from that source.\n\nDFS timestamps each vertex as follows:\n\n$d[v]$ records when $v$ is first discovered.\n\n$f[v]$ records when the search finishes examining $v$’s adjacency list.\n\nWrite a program which reads a directed graph $G = (V, E)$ and demonstrates DFS on the graph based on the following rules:\n\n$G$ is given in an adjacency-list. Vertices are identified by IDs $1, 2,... n$ respectively.\n\nIDs in the adjacency list are arranged in ascending order.\n\nThe program should report the discover time and the finish time for each vertex.\n\nWhen there are several candidates to visit during DFS, the algorithm should select the vertex with the smallest ID.\n\nThe timestamp starts with 1.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices of $G$ is given. In the next $n$ lines, adjacency lists of $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree. $v_i$ are IDs of vertices adjacent to $u$.\n\nOutput\n\nFor each vertex, print $id$, $d$ and $f$ separated by a space character in a line. $id$ is ID of the vertex, $d$ and $f$ is the discover time and the finish time respectively. Print in order of vertex IDs.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nSample Input 1\n\n4\n1 1 2\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 1 8\n2 2 7\n3 4 5\n4 3 6\n\nSample Input 2\n\n6\n1 2 2 3\n2 2 3 4\n3 1 5\n4 1 6\n5 1 6\n6 0\n\nSample Output 2\n\n1 1 12\n2 2 11\n3 3 8\n4 9 10\n5 4 7\n6 5 6\n\nThis is example for Sample Input 2 (discover/finish)\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1431, "cpu_time_ms": 80, "memory_kb": 16912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s483937829", "group_id": "codeNet:p02239", "input_text": "(function main() {\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const adjLists = Array.from(Array(n), () => []);\n lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => adjLists[i].push(e-1)));\n\n const d = [], f = [];\n dfs(adjLists, d, f);\n str = '';\n for (let i = 0; i < n; i++) {\n str += `${i + 1} ${d[i]} ${f[i]}\\n`;\n }\n console.log(str);\n})();\n\nfunction dfs(adjLists, d, f) {\n const WHITE = 0, GRAY = 1, BLACK = 2;\n const size = adjLists.length;\n const color = Array.from(adjLists, () => WHITE);\n\n let time = 0;\n function visit(u) {\n color[u] = GRAY;\n d[u] = ++time;\n adjLists[u].forEach(v => {\n if (color[v] === WHITE) {\n visit(v);\n }\n });\n color[u] = BLACK;\n f[u] = ++time;\n }\n adjLists.forEach((e, u) => {\n if (color[u] === WHITE) visit(u);\n });\n}\n\n", "language": "JavaScript", "metadata": {"date": 1532060654, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02239.html", "problem_id": "p02239", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02239/input.txt", "sample_output_relpath": "derived/input_output/data/p02239/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02239/JavaScript/s483937829.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s483937829", "user_id": "u298224238"}, "prompt_components": {"gold_output": "1 0\n2 1\n3 2\n4 1\n", "input_to_evaluate": "(function main() {\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const adjLists = Array.from(Array(n), () => []);\n lines.forEach((l, i) => l.split(' ').splice(2).forEach(e => adjLists[i].push(e-1)));\n\n const d = [], f = [];\n dfs(adjLists, d, f);\n str = '';\n for (let i = 0; i < n; i++) {\n str += `${i + 1} ${d[i]} ${f[i]}\\n`;\n }\n console.log(str);\n})();\n\nfunction dfs(adjLists, d, f) {\n const WHITE = 0, GRAY = 1, BLACK = 2;\n const size = adjLists.length;\n const color = Array.from(adjLists, () => WHITE);\n\n let time = 0;\n function visit(u) {\n color[u] = GRAY;\n d[u] = ++time;\n adjLists[u].forEach(v => {\n if (color[v] === WHITE) {\n visit(v);\n }\n });\n color[u] = BLACK;\n f[u] = ++time;\n }\n adjLists.forEach((e, u) => {\n if (color[u] === WHITE) visit(u);\n });\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nBreadth First Search\n\nWrite a program which reads an directed graph $G = (V, E)$, and finds the shortest distance from vertex $1$ to each vertex (the number of edges in the shortest path). Vertices are identified by IDs $1, 2, ... n$.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices, is given. In the next $n$ lines, adjacent lists of vertex $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree.$v_i$ are IDs of vertices adjacent to $u$.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nOutput\n\nFor each vertex $u$, print $id$ and $d$ in a line. $id$ is ID of vertex $u$ and $d$ is the distance from vertex $1$ to vertex $u$. If there are no path from vertex $1$ to vertex $u$, print -1 as the shortest distance. Print in order of IDs.\n\nSample Input 1\n\n4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 0\n2 1\n3 2\n4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n"}, "reference_outputs": ["1 0\n2 1\n3 2\n4 1\n"], "source_document_id": "p02239", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nBreadth First Search\n\nWrite a program which reads an directed graph $G = (V, E)$, and finds the shortest distance from vertex $1$ to each vertex (the number of edges in the shortest path). Vertices are identified by IDs $1, 2, ... n$.\n\nInput\n\nIn the first line, an integer $n$ denoting the number of vertices, is given. In the next $n$ lines, adjacent lists of vertex $u$ are given in the following format:\n\n$u$ $k$ $v_1$ $v_2$ ... $v_k$\n\n$u$ is ID of the vertex and $k$ denotes its degree.$v_i$ are IDs of vertices adjacent to $u$.\n\nConstraints\n\n$1 \\leq n \\leq 100$\n\nOutput\n\nFor each vertex $u$, print $id$ and $d$ in a line. $id$ is ID of vertex $u$ and $d$ is the distance from vertex $1$ to vertex $u$. If there are no path from vertex $1$ to vertex $u$, print -1 as the shortest distance. Print in order of IDs.\n\nSample Input 1\n\n4\n1 2 2 4\n2 1 4\n3 0\n4 1 3\n\nSample Output 1\n\n1 0\n2 1\n3 2\n4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 895, "cpu_time_ms": 70, "memory_kb": 15152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s061970691", "group_id": "codeNet:p02240", "input_text": "//config = { input: 'tmp', newline: '\\r\\n' }; // win\nconfig = { input: '/dev/stdin', newline: '\\n' }; // linux\n\nline = require('fs').readFileSync(config.input, 'ascii')\n .trim()\n .split(config.newline)\n .map(function (line) { return line.split(' ').map(Number); });\n\nn = line[0][0];\nm = line[0][1];\nq = line[m+1][0];\n\nadj = new Array(n+1);\nfor (i = 0; i <= n; i++) adj[i] = null;\n\nfor (i = 1; i <= m; i++) {\n min = Math.min(line[i][0], line[i][1]);\n max = Math.max(line[i][0], line[i][1]);\n while (adj[min] !== null) min = adj[min];\n adj[max] = min;\n}\n\nfor (i = m+2; i < (m+2) + q; i++) {\n q0 = line[i][0];\n q1 = line[i][1];\n while (adj[q0] !== null) q0 = adj[q0];\n while (adj[q1] !== null) q1 = adj[q1];\n console.log((q0 === q1) ? 'yes' : 'no');\n}", "language": "JavaScript", "metadata": {"date": 1504073841, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02240.html", "problem_id": "p02240", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02240/input.txt", "sample_output_relpath": "derived/input_output/data/p02240/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02240/JavaScript/s061970691.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s061970691", "user_id": "u239637240"}, "prompt_components": {"gold_output": "yes\nyes\nno\n", "input_to_evaluate": "//config = { input: 'tmp', newline: '\\r\\n' }; // win\nconfig = { input: '/dev/stdin', newline: '\\n' }; // linux\n\nline = require('fs').readFileSync(config.input, 'ascii')\n .trim()\n .split(config.newline)\n .map(function (line) { return line.split(' ').map(Number); });\n\nn = line[0][0];\nm = line[0][1];\nq = line[m+1][0];\n\nadj = new Array(n+1);\nfor (i = 0; i <= n; i++) adj[i] = null;\n\nfor (i = 1; i <= m; i++) {\n min = Math.min(line[i][0], line[i][1]);\n max = Math.max(line[i][0], line[i][1]);\n while (adj[min] !== null) min = adj[min];\n adj[max] = min;\n}\n\nfor (i = m+2; i < (m+2) + q; i++) {\n q0 = line[i][0];\n q1 = line[i][1];\n while (adj[q0] !== null) q0 = adj[q0];\n while (adj[q1] !== null) q1 = adj[q1];\n console.log((q0 === q1) ? 'yes' : 'no');\n}", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nConnected Components\n\nWrite a program which reads relations in a SNS (Social Network Service), and judges that given pairs of users are reachable each other through the network.\n\nInput\n\nIn the first line, two integer $n$ and $m$ are given. $n$ is the number of users in the SNS and $m$ is the number of relations in the SNS. The users in the SNS are identified by IDs $0, 1, ..., n-1$.\n\nIn the following $m$ lines, the relations are given. Each relation is given by two integers $s$ and $t$ that represents $s$ and $t$ are friends (and reachable each other).\n\nIn the next line, the number of queries $q$ is given. In the following $q$ lines, $q$ queries are given respectively. Each query consists of two integers $s$ and $t$ separated by a space character.\n\nOutput\n\nFor each query, print \"yes\" if $t$ is reachable from $s$ through the social network, \"no\" otherwise.\n\nConstraints\n\n$2 \\leq n \\leq 100,000$\n\n$0 \\leq m \\leq 100,000$\n\n$1 \\leq q \\leq 10,000$\n\nSample Input\n\n10 9\n0 1\n0 2\n3 4\n5 7\n5 6\n6 7\n6 8\n7 8\n8 9\n3\n0 1\n5 9\n1 3\n\nSample Output\n\nyes\nyes\nno", "sample_input": "10 9\n0 1\n0 2\n3 4\n5 7\n5 6\n6 7\n6 8\n7 8\n8 9\n3\n0 1\n5 9\n1 3\n"}, "reference_outputs": ["yes\nyes\nno\n"], "source_document_id": "p02240", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nConnected Components\n\nWrite a program which reads relations in a SNS (Social Network Service), and judges that given pairs of users are reachable each other through the network.\n\nInput\n\nIn the first line, two integer $n$ and $m$ are given. $n$ is the number of users in the SNS and $m$ is the number of relations in the SNS. The users in the SNS are identified by IDs $0, 1, ..., n-1$.\n\nIn the following $m$ lines, the relations are given. Each relation is given by two integers $s$ and $t$ that represents $s$ and $t$ are friends (and reachable each other).\n\nIn the next line, the number of queries $q$ is given. In the following $q$ lines, $q$ queries are given respectively. Each query consists of two integers $s$ and $t$ separated by a space character.\n\nOutput\n\nFor each query, print \"yes\" if $t$ is reachable from $s$ through the social network, \"no\" otherwise.\n\nConstraints\n\n$2 \\leq n \\leq 100,000$\n\n$0 \\leq m \\leq 100,000$\n\n$1 \\leq q \\leq 10,000$\n\nSample Input\n\n10 9\n0 1\n0 2\n3 4\n5 7\n5 6\n6 7\n6 8\n7 8\n8 9\n3\n0 1\n5 9\n1 3\n\nSample Output\n\nyes\nyes\nno", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 760, "cpu_time_ms": 60, "memory_kb": 15400}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s700903003", "group_id": "codeNet:p02249", "input_text": "//config = { input: 'tmp', newline: '\\r\\n' }; // win\nconfig = { input: '/dev/stdin', newline: '\\n' }; // linux\n\nline = require('fs').readFileSync(config.input, 'ascii')\n .split(config.newline);\nline[0] = line[0].split(' ').map(Number);\nH = line[0][0];\nW = line[0][1];\nfield = line.slice(1, 1+H);\nline[1+H] = line[1+H].split(' ').map(Number);\nR = line[1+H][0];\nC = line[1+H][1];\npat = line.slice(1+H+1, 1+H+1+R);\n\nif (H < R || W < C) process.exit();\n\nmem = new Array(H-R+1);\nfor (i = 0; i <= H-R; i++) {\n mem[i] = new Array(W-C+1);\n for (j = 0; j <= W-C; j++) mem[i][j] = 0;\n}\n\nmatch_count = new Array(W-C+1);\nmatch = new Array(W-C+1);\nfor (i = 0; i <= W-C; i++) {\n match_count[i] = 0;\n match[i] = false;\n}\n\nfunction string_match(str1, str2, W, C) {\n var i, j, k;\n for (i in match_count) match_count[i] = 0;\n for (i = 0; i <= W-C; i++) {\n for (j = 0; j < C; j++) {\n if (str1[i+j] === str2[j]) match_count[i]++;\n }\n }\n for (i in match) match[i] = (match_count[i] === C);\n}\n\nfor (i = 0; i < H; i++) {\n for (j = Math.max(0, i-H+R); j < R && j <= i; j++) {\n string_match(field[i], pat[j], W, C);\n for (k in match) {\n if (!match[k]) continue;\n mem[i-j][k]++;\n }\n }\n}\n\nfor (i in mem)\n for (j in mem[i])\n if (mem[i][j] === R) console.log('%s %s', i, j);", "language": "JavaScript", "metadata": {"date": 1506609024, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02249.html", "problem_id": "p02249", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02249/input.txt", "sample_output_relpath": "derived/input_output/data/p02249/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02249/JavaScript/s700903003.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s700903003", "user_id": "u239637240"}, "prompt_components": {"gold_output": "0 3\n1 2\n", "input_to_evaluate": "//config = { input: 'tmp', newline: '\\r\\n' }; // win\nconfig = { input: '/dev/stdin', newline: '\\n' }; // linux\n\nline = require('fs').readFileSync(config.input, 'ascii')\n .split(config.newline);\nline[0] = line[0].split(' ').map(Number);\nH = line[0][0];\nW = line[0][1];\nfield = line.slice(1, 1+H);\nline[1+H] = line[1+H].split(' ').map(Number);\nR = line[1+H][0];\nC = line[1+H][1];\npat = line.slice(1+H+1, 1+H+1+R);\n\nif (H < R || W < C) process.exit();\n\nmem = new Array(H-R+1);\nfor (i = 0; i <= H-R; i++) {\n mem[i] = new Array(W-C+1);\n for (j = 0; j <= W-C; j++) mem[i][j] = 0;\n}\n\nmatch_count = new Array(W-C+1);\nmatch = new Array(W-C+1);\nfor (i = 0; i <= W-C; i++) {\n match_count[i] = 0;\n match[i] = false;\n}\n\nfunction string_match(str1, str2, W, C) {\n var i, j, k;\n for (i in match_count) match_count[i] = 0;\n for (i = 0; i <= W-C; i++) {\n for (j = 0; j < C; j++) {\n if (str1[i+j] === str2[j]) match_count[i]++;\n }\n }\n for (i in match) match[i] = (match_count[i] === C);\n}\n\nfor (i = 0; i < H; i++) {\n for (j = Math.max(0, i-H+R); j < R && j <= i; j++) {\n string_match(field[i], pat[j], W, C);\n for (k in match) {\n if (!match[k]) continue;\n mem[i-j][k]++;\n }\n }\n}\n\nfor (i in mem)\n for (j in mem[i])\n if (mem[i][j] === R) console.log('%s %s', i, j);", "problem_context": "Pattern Search\n\nFind places where a R × C pattern is found within a H × W region. Print top-left coordinates (i, j) of sub-regions where the pattern found. The top-left and bottom-right coordinates of the region is (0, 0) and (H-1, W-1) respectively.\n\nInput\n\nIn the first line, two integers H and W are given. In the following H lines, i-th lines of the region are given.\n\nIn the next line, two integers R and C are given. In the following R lines, i-th lines of the pattern are given.\n\noutput\n\nFor each sub-region found, print a coordinate i and j separated by a space character in a line. Print the coordinates in ascending order of the row numbers (i), or the column numbers (j) in case of a tie.\n\nConstraints\n\n1 ≤ H, W ≤ 1000\n\n1 ≤ R, C ≤ 1000\n\nThe input consists of alphabetical characters and digits\n\nSample Input 1\n\n4 5\n00010\n00101\n00010\n00100\n3 2\n10\n01\n10\n\nSample Output 1\n\n0 3\n1 2", "sample_input": "4 5\n00010\n00101\n00010\n00100\n3 2\n10\n01\n10\n"}, "reference_outputs": ["0 3\n1 2\n"], "source_document_id": "p02249", "source_text": "Pattern Search\n\nFind places where a R × C pattern is found within a H × W region. Print top-left coordinates (i, j) of sub-regions where the pattern found. The top-left and bottom-right coordinates of the region is (0, 0) and (H-1, W-1) respectively.\n\nInput\n\nIn the first line, two integers H and W are given. In the following H lines, i-th lines of the region are given.\n\nIn the next line, two integers R and C are given. In the following R lines, i-th lines of the pattern are given.\n\noutput\n\nFor each sub-region found, print a coordinate i and j separated by a space character in a line. Print the coordinates in ascending order of the row numbers (i), or the column numbers (j) in case of a tie.\n\nConstraints\n\n1 ≤ H, W ≤ 1000\n\n1 ≤ R, C ≤ 1000\n\nThe input consists of alphabetical characters and digits\n\nSample Input 1\n\n4 5\n00010\n00101\n00010\n00100\n3 2\n10\n01\n10\n\nSample Output 1\n\n0 3\n1 2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1291, "cpu_time_ms": 40000, "memory_kb": 41324}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s275865436", "group_id": "codeNet:p02250", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr = input.trim().split(\"\\n\");\nvar str=arr.shift();\nvar n = arr.shift()-0;\nvar ans = \"\";\nfor(var i=0;i y) {\n x = x % y;\n } else if (x < y) {\n var tmp = y;\n y = x;\n x = tmp % x;\n }\n var a = [];\n for (var i = 1; i <= x; i++) {\n if (x % i === 0 && y % i === 0) {\n a.push(i);\n }\n }\n return a;\n}", "language": "JavaScript", "metadata": {"date": 1428200247, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02256.html", "problem_id": "p02256", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02256/input.txt", "sample_output_relpath": "derived/input_output/data/p02256/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02256/JavaScript/s060914135.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s060914135", "user_id": "u759826653"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "(function(input) {\n var p = input.split(' ').map(Number);\n var x = p.shift();\n var y = p.shift();\n console.log(greatestCommonDevisor(x, y));\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction greatestCommonDevisor(x, y) {\n return Math.max.apply(null, commonDevisor(x, y));\n}\n\nfunction commonDevisor(x, y) {\n if (x > y) {\n x = x % y;\n } else if (x < y) {\n var tmp = y;\n y = x;\n x = tmp % x;\n }\n var a = [];\n for (var i = 1; i <= x; i++) {\n if (x % i === 0 && y % i === 0) {\n a.push(i);\n }\n }\n return a;\n}", "problem_context": "Greatest Common Divisor\n\nWrite a program which finds the greatest common divisor of two natural numbers a and b\n\nInput\n\na and b are given in a line sparated by a single space.\n\nOutput\n\nOutput the greatest common divisor of a and b.\n\nConstrants\n\n1 ≤ a, b ≤ 109\n\nHint\n\nYou can use the following observation:\n\nFor integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)\n\nSample Input 1\n\n54 20\n\nSample Output 1\n\n2\n\nSample Input 2\n\n147 105\n\nSample Output 2\n\n21", "sample_input": "54 20\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02256", "source_text": "Greatest Common Divisor\n\nWrite a program which finds the greatest common divisor of two natural numbers a and b\n\nInput\n\na and b are given in a line sparated by a single space.\n\nOutput\n\nOutput the greatest common divisor of a and b.\n\nConstrants\n\n1 ≤ a, b ≤ 109\n\nHint\n\nYou can use the following observation:\n\nFor integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)\n\nSample Input 1\n\n54 20\n\nSample Output 1\n\n2\n\nSample Input 2\n\n147 105\n\nSample Output 2\n\n21", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 605, "cpu_time_ms": 810, "memory_kb": 8572}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s468487708", "group_id": "codeNet:p02257", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\").map(Number);\nArr.shift();\nvar max=Arr.reduce(function(a,b){return Math.max(a,b);});\nArr.sort(function(a,b){a-b;});\nvar max=Arr[Arr.length-1];\nvar arr=[2];\nfor(var i=3;i<=max;i++){\n var a=true;\n for(var j=0;j y) {\n x = x % y;\n } else if (x < y) {\n var tmp = y;\n y = x;\n x = tmp % x;\n }\n var a = [];\n var ds = divisors(x);\n for (var i = 0; i < ds.length ; i++) {\n var d = ds[i];\n if (y % d === 0) {\n a.push(i);\n }\n }\n return a;\n}\n\nfunction divisors(x) {\n var a = [];\n for (var i = 1; i <= x; i++) {\n if (x % i === 0) {\n a.push(i);\n }\n }\n return a;\n}\n\nfunction isPrimeNumber(x) {\n if (x < 2) {\n return false;\n }\n for (var i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction inArray(needle, heystack) {\n return heystack.indexOf(needle) !== -1;\n}\n\nfunction primeNumbersIn(a) {\n a = a.sort(function(a, b) {\n return a - b;\n });\n var t = 0;\n var n = a[t];\n do {\n for (var i = n * 2; i <= Math.max.apply(null, a); i += n) {\n var index = a.indexOf(i);\n if (index > -1) {\n a = a.slice(0, index).concat(a.slice(index + 1, a.length));\n }\n }\n n = a[++t];\n } while (n < Math.sqrt(Math.max.apply(null, a)))\n return a;\n}", "language": "JavaScript", "metadata": {"date": 1428202802, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02257.html", "problem_id": "p02257", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02257/input.txt", "sample_output_relpath": "derived/input_output/data/p02257/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02257/JavaScript/s441287648.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s441287648", "user_id": "u759826653"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "(function(input) {\n var p = input.split('\\n').map(Number);\n var n = p.shift();\n var a = p.slice(0, n);\n var pns = primeNumbersIn(a);\n console.log(pns.length);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction greatestCommonDevisor(x, y) {\n return Math.max.apply(null, commonDevisors(x, y));\n}\n\nfunction commonDevisors(x, y) {\n if (x > y) {\n x = x % y;\n } else if (x < y) {\n var tmp = y;\n y = x;\n x = tmp % x;\n }\n var a = [];\n var ds = divisors(x);\n for (var i = 0; i < ds.length ; i++) {\n var d = ds[i];\n if (y % d === 0) {\n a.push(i);\n }\n }\n return a;\n}\n\nfunction divisors(x) {\n var a = [];\n for (var i = 1; i <= x; i++) {\n if (x % i === 0) {\n a.push(i);\n }\n }\n return a;\n}\n\nfunction isPrimeNumber(x) {\n if (x < 2) {\n return false;\n }\n for (var i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction inArray(needle, heystack) {\n return heystack.indexOf(needle) !== -1;\n}\n\nfunction primeNumbersIn(a) {\n a = a.sort(function(a, b) {\n return a - b;\n });\n var t = 0;\n var n = a[t];\n do {\n for (var i = n * 2; i <= Math.max.apply(null, a); i += n) {\n var index = a.indexOf(i);\n if (index > -1) {\n a = a.slice(0, index).concat(a.slice(index + 1, a.length));\n }\n }\n n = a[++t];\n } while (n < Math.sqrt(Math.max.apply(null, a)))\n return a;\n}", "problem_context": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "sample_input": "5\n2\n3\n4\n5\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02257", "source_text": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1566, "cpu_time_ms": 350, "memory_kb": 10408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s832486484", "group_id": "codeNet:p02257", "input_text": "(() => {\n\n var lines = [];\n\n require('readline').createInterface({\n input: process.stdin,\n }).on('line', (line) => {\n lines.push(Number(line));\n });\n\n process.stdin.on(\"end\", () => {\n console.log(lines.filter(isPrime).length);\n });\n\n const isPrime = function(x){\n if(x == 2){\n return true;\n }\n\n if(x < 2 || (x % 2) === 0){\n return false;\n }\n\n const sqrt_x = Math.sqrt(x);\n for(let i = 3; i <= sqrt_x; i+=2){\n if(x % i === 0){\n return false;\n }\n }\n return true;\n }\n\n\n})();\n", "language": "JavaScript", "metadata": {"date": 1516971110, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02257.html", "problem_id": "p02257", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02257/input.txt", "sample_output_relpath": "derived/input_output/data/p02257/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02257/JavaScript/s832486484.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s832486484", "user_id": "u949517845"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "(() => {\n\n var lines = [];\n\n require('readline').createInterface({\n input: process.stdin,\n }).on('line', (line) => {\n lines.push(Number(line));\n });\n\n process.stdin.on(\"end\", () => {\n console.log(lines.filter(isPrime).length);\n });\n\n const isPrime = function(x){\n if(x == 2){\n return true;\n }\n\n if(x < 2 || (x % 2) === 0){\n return false;\n }\n\n const sqrt_x = Math.sqrt(x);\n for(let i = 3; i <= sqrt_x; i+=2){\n if(x % i === 0){\n return false;\n }\n }\n return true;\n }\n\n\n})();\n", "problem_context": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "sample_input": "5\n2\n3\n4\n5\n6\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02257", "source_text": "Prime Numbers\n\nA prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.\n\nWrite a program which reads a list of N integers and prints the number of prime numbers in the list.\n\nInput\n\nThe first line contains an integer N, the number of elements in the list.\n\nN numbers are given in the following lines.\n\nOutput\n\nPrint the number of prime numbers in the given list.\n\nConstraints\n\n1 ≤ N ≤ 10000\n\n2 ≤ an element of the list ≤ 108\n\nSample Input 1\n\n5\n2\n3\n4\n5\n6\n\nSample Output 1\n\n3\n\nSample Input 2\n\n11\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n\nSample Output 2\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 632, "cpu_time_ms": 100, "memory_kb": 19496}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s142703404", "group_id": "codeNet:p02258", "input_text": "function main() {\n var n = input[0];\n var maxv = -1000000000;\n var minv = input[1];\n for (j = 2; j <= n; j++) {\n maxv = Math.max(maxv, input[j] - minv);\n minv = Math.min(minv, input[j]);\n }\n console.log(maxv);\n}\n\nvar input = '';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n input.pop();\n main();\n});", "language": "JavaScript", "metadata": {"date": 1512215890, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/JavaScript/s142703404.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s142703404", "user_id": "u798565376"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function main() {\n var n = input[0];\n var maxv = -1000000000;\n var minv = input[1];\n for (j = 2; j <= n; j++) {\n maxv = Math.max(maxv, input[j] - minv);\n minv = Math.min(minv, input[j]);\n }\n console.log(maxv);\n}\n\nvar input = '';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n input.pop();\n main();\n});", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 459, "cpu_time_ms": 140, "memory_kb": 34880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s628658210", "group_id": "codeNet:p02258", "input_text": "const getMaxv = arr => {\n let j = 0;\n let maxv = -Infinity;\n let min = Infinity;\n for (j = 0; j < arr.length; j++) {\n maxv = Math.max(maxv, arr[j] - min);\n min = Math.min(min, arr[j]);\n }\n console.log(maxv);\n};\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\nlet input_string = \"\";\n\nprocess.stdin.on(\"data\", chunk => {\n input_string += chunk;\n});\n\nprocess.stdin.on(\"end\", () => {\n // const lines = input_string.split(\"\\n\").filter(v => {\n // return v !== \"\";\n // });\n\n const lines = \"7 3 2 4 1 5 3 6\".split(\" \");\n getMaxv(lines);\n});\n\n", "language": "JavaScript", "metadata": {"date": 1525449349, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/JavaScript/s628658210.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s628658210", "user_id": "u571712009"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const getMaxv = arr => {\n let j = 0;\n let maxv = -Infinity;\n let min = Infinity;\n for (j = 0; j < arr.length; j++) {\n maxv = Math.max(maxv, arr[j] - min);\n min = Math.min(min, arr[j]);\n }\n console.log(maxv);\n};\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\nlet input_string = \"\";\n\nprocess.stdin.on(\"data\", chunk => {\n input_string += chunk;\n});\n\nprocess.stdin.on(\"end\", () => {\n // const lines = input_string.split(\"\\n\").filter(v => {\n // return v !== \"\";\n // });\n\n const lines = \"7 3 2 4 1 5 3 6\".split(\" \");\n getMaxv(lines);\n});\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 566, "cpu_time_ms": 90, "memory_kb": 15292}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s593195847", "group_id": "codeNet:p02258", "input_text": "let content = '';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', buf => {\n content += buf;\n});\n\nprocess.stdin.on('end', () => {\n const [, ...nums] = content\n .trim()\n .split('\\n')\n .map(n => +n);\n\n let max = null;\n let min = nums[0];\n for (let i = 1; i < nums.length; i++) {\n const bNum = nums[i];\n min = min > nums[i - 1] ? nums[i - 1] : min;\n const d = bNum - min;\n if (max === null || d > max) {\n max = d;\n }\n }\n\n console.log(max);\n});\n", "language": "JavaScript", "metadata": {"date": 1562344849, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02258.html", "problem_id": "p02258", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02258/input.txt", "sample_output_relpath": "derived/input_output/data/p02258/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02258/JavaScript/s593195847.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s593195847", "user_id": "u268361280"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "let content = '';\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', buf => {\n content += buf;\n});\n\nprocess.stdin.on('end', () => {\n const [, ...nums] = content\n .trim()\n .split('\\n')\n .map(n => +n);\n\n let max = null;\n let min = nums[0];\n for (let i = 1; i < nums.length; i++) {\n const bNum = nums[i];\n min = min > nums[i - 1] ? nums[i - 1] : min;\n const d = bNum - min;\n if (max === null || d > max) {\n max = d;\n }\n }\n\n console.log(max);\n});\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "sample_input": "6\n5\n3\n1\n3\n4\n3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02258", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Profit\n\nYou can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) × 1000 = 8000 yen.\n\nWrite a program which reads values of a currency $R_t$ at a certain time $t$ ($t = 0, 1, 2, ... n-1$), and reports the maximum value of $R_j - R_i$ where $j > i$ .\n\nInput\n\nThe first line contains an integer $n$. In the following $n$ lines, $R_t$ ($t = 0, 1, 2, ... n-1$) are given in order.\n\nOutput\n\nPrint the maximum value in a line.\n\nConstraints\n\n$2 \\leq n \\leq 200,000$\n\n$1 \\leq R_t \\leq 10^9$\n\nSample Input 1\n\n6\n5\n3\n1\n3\n4\n3\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n4\n3\n2\n\nSample Output 2\n\n-1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 512, "cpu_time_ms": 170, "memory_kb": 49960}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s818634521", "group_id": "codeNet:p02259", "input_text": "'use strict';\n\nconst main = input => {\n input = input.split('\\n');\n const N = Number(input[0]);\n const A = input[1]\n .trim()\n .split(' ')\n .map(Number);\n bubbleSort(A, N);\n};\n\nfunction bubbleSort(A, N) {\n let flag = true;\n let count = 0;\n while (flag) {\n flag = false;\n let i = 0;\n for (let j = N - 1; j >= i + 1; --j) {\n if (A[j - 1] > A[j]) {\n const tmp = A[j];\n A[j] = A[j - 1];\n A[j - 1] = tmp;\n flag = true;\n ++count;\n }\n }\n ++i;\n }\n console.log(A.join(' '));\n console.log(count);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n", "language": "JavaScript", "metadata": {"date": 1577868036, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02259.html", "problem_id": "p02259", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02259/input.txt", "sample_output_relpath": "derived/input_output/data/p02259/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02259/JavaScript/s818634521.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s818634521", "user_id": "u278985352"}, "prompt_components": {"gold_output": "1 2 3 4 5\n8\n", "input_to_evaluate": "'use strict';\n\nconst main = input => {\n input = input.split('\\n');\n const N = Number(input[0]);\n const A = input[1]\n .trim()\n .split(' ')\n .map(Number);\n bubbleSort(A, N);\n};\n\nfunction bubbleSort(A, N) {\n let flag = true;\n let count = 0;\n while (flag) {\n flag = false;\n let i = 0;\n for (let j = N - 1; j >= i + 1; --j) {\n if (A[j - 1] > A[j]) {\n const tmp = A[j];\n A[j] = A[j - 1];\n A[j - 1] = tmp;\n flag = true;\n ++count;\n }\n }\n ++i;\n }\n console.log(A.join(' '));\n console.log(count);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n", "problem_context": "Bubble Sort\n\nWrite a program of the Bubble Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:\n\nBubbleSort(A)\n1 for i = 0 to A.length-1\n2 for j = A.length-1 downto i+1\n3 if A[j] < A[j-1]\n4 swap A[j] and A[j-1]\n\nNote that, indices for array elements are based on 0-origin.\n\nYour program should also print the number of swap operations defined in line 4 of the pseudocode.\n\nInput\n\nThe first line of the input includes an integer N, the number of elements in the sequence.\n\nIn the second line, N elements of the sequence are given separated by spaces characters.\n\nOutput\n\nThe output consists of 2 lines.\n\nIn the first line, please print the sorted sequence. Two contiguous elements of the sequence should be separated by a space character.\n\nIn the second line, please print the number of swap operations.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nSample Input 1\n\n5\n5 3 2 4 1\n\nSample Output 1\n\n1 2 3 4 5\n8\n\nSample Input 2\n\n6\n5 2 4 6 1 3\n\nSample Output 2\n\n1 2 3 4 5 6\n9", "sample_input": "5\n5 3 2 4 1\n"}, "reference_outputs": ["1 2 3 4 5\n8\n"], "source_document_id": "p02259", "source_text": "Bubble Sort\n\nWrite a program of the Bubble Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:\n\nBubbleSort(A)\n1 for i = 0 to A.length-1\n2 for j = A.length-1 downto i+1\n3 if A[j] < A[j-1]\n4 swap A[j] and A[j-1]\n\nNote that, indices for array elements are based on 0-origin.\n\nYour program should also print the number of swap operations defined in line 4 of the pseudocode.\n\nInput\n\nThe first line of the input includes an integer N, the number of elements in the sequence.\n\nIn the second line, N elements of the sequence are given separated by spaces characters.\n\nOutput\n\nThe output consists of 2 lines.\n\nIn the first line, please print the sorted sequence. Two contiguous elements of the sequence should be separated by a space character.\n\nIn the second line, please print the number of swap operations.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nSample Input 1\n\n5\n5 3 2 4 1\n\nSample Output 1\n\n1 2 3 4 5\n8\n\nSample Input 2\n\n6\n5 2 4 6 1 3\n\nSample Output 2\n\n1 2 3 4 5 6\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 625, "cpu_time_ms": 70, "memory_kb": 15412}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s355234700", "group_id": "codeNet:p02263", "input_text": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst solve = arr => {\n const helper = (xs, stack) => {\n if (xs.length === 0) return stack[0];\n const hd = xs[0];\n const tl = xs.slice(1);\n if (hd === '+') {\n const snd = stack.pop();\n const fst = stack.pop();\n stack.push(fst + snd);\n } else if (hd === '-') {\n const snd = stack.pop();\n const fst = stack.pop();\n stack.push(fst - snd);\n } else if (hd === '*') {\n const snd = stack.pop();\n const fst = stack.pop();\n stack.push(fst * snd);\n } else {\n stack.push(parseFloat(hd));\n }\n return helper(tl, stack); \n };\n\n return helper(arr, []);\n};\n\nconsole.log(solve(line[0].split(' ')));\n\n", "language": "JavaScript", "metadata": {"date": 1529495470, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02263.html", "problem_id": "p02263", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02263/input.txt", "sample_output_relpath": "derived/input_output/data/p02263/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02263/JavaScript/s355234700.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s355234700", "user_id": "u707214955"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst solve = arr => {\n const helper = (xs, stack) => {\n if (xs.length === 0) return stack[0];\n const hd = xs[0];\n const tl = xs.slice(1);\n if (hd === '+') {\n const snd = stack.pop();\n const fst = stack.pop();\n stack.push(fst + snd);\n } else if (hd === '-') {\n const snd = stack.pop();\n const fst = stack.pop();\n stack.push(fst - snd);\n } else if (hd === '*') {\n const snd = stack.pop();\n const fst = stack.pop();\n stack.push(fst * snd);\n } else {\n stack.push(parseFloat(hd));\n }\n return helper(tl, stack); \n };\n\n return helper(arr, []);\n};\n\nconsole.log(solve(line[0].split(' ')));\n\n", "problem_context": "Reverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages of the Reverse Polish notation is that it is parenthesis-free.\n\nWrite a program which reads an expression in the Reverse Polish notation and prints the computational result.\n\nAn expression in the Reverse Polish notation is calculated using a stack. To evaluate the expression, the program should read symbols in order. If the symbol is an operand, the corresponding value should be pushed into the stack. On the other hand, if the symbols is an operator, the program should pop two elements from the stack, perform the corresponding operations, then push the result in to the stack. The program should repeat this operations.\n\nInput\n\nAn expression is given in a line. Two consequtive symbols (operand or operator) are separated by a space character.\n\nYou can assume that +, - and * are given as the operator and an operand is a positive integer less than 106\n\nOutput\n\nPrint the computational result in a line.\n\nConstraints\n\n2 ≤ the number of operands in the expression ≤ 100\n\n1 ≤ the number of operators in the expression ≤ 99\n\n-1 × 109 ≤ values in the stack ≤ 109\n\nSample Input 1\n\n1 2 +\n\nSample Output 1\n\n3\n\nSample Input 2\n\n1 2 + 3 4 - *\n\nSample Output 2\n\n-3\n\nNotes\n\nTemplate in C", "sample_input": "1 2 +\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02263", "source_text": "Reverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages of the Reverse Polish notation is that it is parenthesis-free.\n\nWrite a program which reads an expression in the Reverse Polish notation and prints the computational result.\n\nAn expression in the Reverse Polish notation is calculated using a stack. To evaluate the expression, the program should read symbols in order. If the symbol is an operand, the corresponding value should be pushed into the stack. On the other hand, if the symbols is an operator, the program should pop two elements from the stack, perform the corresponding operations, then push the result in to the stack. The program should repeat this operations.\n\nInput\n\nAn expression is given in a line. Two consequtive symbols (operand or operator) are separated by a space character.\n\nYou can assume that +, - and * are given as the operator and an operand is a positive integer less than 106\n\nOutput\n\nPrint the computational result in a line.\n\nConstraints\n\n2 ≤ the number of operands in the expression ≤ 100\n\n1 ≤ the number of operators in the expression ≤ 99\n\n-1 × 109 ≤ values in the stack ≤ 109\n\nSample Input 1\n\n1 2 +\n\nSample Output 1\n\n3\n\nSample Input 2\n\n1 2 + 3 4 - *\n\nSample Output 2\n\n-3\n\nNotes\n\nTemplate in C", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 916, "cpu_time_ms": 80, "memory_kb": 16028}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s887363957", "group_id": "codeNet:p02264", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nvar t=(Arr[0].split(\" \"))[1]-0;\nArr.shift();\nvar T=0;\nvar i=0;\nwhile(Arr.length!=0){\n var arr=Arr[0].split(\" \");\n Arr.shift();\n var a=arr[0];\n var b=arr[1]-0;\n if(b-t<=0){\n console.log(a+\" \"+(T+b));\n T+=b;\n }else{\n Arr.push(a+\" \"+(b-t));\n T+=t;\n }\n}", "language": "JavaScript", "metadata": {"date": 1424424881, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02264.html", "problem_id": "p02264", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02264/input.txt", "sample_output_relpath": "derived/input_output/data/p02264/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02264/JavaScript/s887363957.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s887363957", "user_id": "u540218629"}, "prompt_components": {"gold_output": "p2 180\np5 400\np1 450\np3 550\np4 800\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nvar t=(Arr[0].split(\" \"))[1]-0;\nArr.shift();\nvar T=0;\nvar i=0;\nwhile(Arr.length!=0){\n var arr=Arr[0].split(\" \");\n Arr.shift();\n var a=arr[0];\n var b=arr[1]-0;\n if(b-t<=0){\n console.log(a+\" \"+(T+b));\n T+=b;\n }else{\n Arr.push(a+\" \"+(b-t));\n T+=t;\n }\n}", "problem_context": "There are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then the scheduler handles the next process in the queue.\n\nFor example, we have the following queue with the quantum of 100ms.\n\nA(150) - B(80) - C(200) - D(200)\n\nFirst, process A is handled for 100ms, then the process is moved to the end of the queue with the remaining time (50ms).\n\nB(80) - C(200) - D(200) - A(50)\n\nNext, process B is handled for 80ms. The process is completed with the time stamp of 180ms and removed from the queue.\n\nC(200) - D(200) - A(50)\n\nYour task is to write a program which simulates the round-robin scheduling.\n\nInput\n\nn q\n\nname1 time1\n\nname2 time2\n\n...\n\nnamen timen\n\nIn the first line the number of processes n and the quantum q are given separated by a single space.\n\nIn the following n lines, names and times for the n processes are given. namei and timei are separated by a single space.\n\nOutput\n\nFor each process, prints its name and the time the process finished in order.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n1 ≤ q ≤ 1000\n\n1 ≤ timei ≤ 50000\n\n1 ≤ length of namei ≤ 10\n\n1 ≤ Sum of timei ≤ 1000000\n\nSample Input 1\n\n5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n\nSample Output 1\n\np2 180\np5 400\np1 450\np3 550\np4 800\n\nNotes\n\nTemplate in C", "sample_input": "5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n"}, "reference_outputs": ["p2 180\np5 400\np1 450\np3 550\np4 800\n"], "source_document_id": "p02264", "source_text": "There are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then the scheduler handles the next process in the queue.\n\nFor example, we have the following queue with the quantum of 100ms.\n\nA(150) - B(80) - C(200) - D(200)\n\nFirst, process A is handled for 100ms, then the process is moved to the end of the queue with the remaining time (50ms).\n\nB(80) - C(200) - D(200) - A(50)\n\nNext, process B is handled for 80ms. The process is completed with the time stamp of 180ms and removed from the queue.\n\nC(200) - D(200) - A(50)\n\nYour task is to write a program which simulates the round-robin scheduling.\n\nInput\n\nn q\n\nname1 time1\n\nname2 time2\n\n...\n\nnamen timen\n\nIn the first line the number of processes n and the quantum q are given separated by a single space.\n\nIn the following n lines, names and times for the n processes are given. namei and timei are separated by a single space.\n\nOutput\n\nFor each process, prints its name and the time the process finished in order.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n1 ≤ q ≤ 1000\n\n1 ≤ timei ≤ 50000\n\n1 ≤ length of namei ≤ 10\n\n1 ≤ Sum of timei ≤ 1000000\n\nSample Input 1\n\n5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n\nSample Output 1\n\np2 180\np5 400\np1 450\np3 550\np4 800\n\nNotes\n\nTemplate in C", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 381, "cpu_time_ms": 430, "memory_kb": 29668}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s673799490", "group_id": "codeNet:p02264", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar lines = input.split('\\n');\n\nvar line = lines.shift();\nvar tmp = line.split(' ');\nvar n = tmp[0];\nvar q = tmp[1] - 0;\n\nvar queue = [];\nlines.forEach(function(l) {\n\ttmp = l.split(' ');\n\tqueue.push({name: tmp[0], time: tmp[1] - 0});\n});\n\nvar passed = 0;\nwhile (queue.length > 0) {\n\tvar process = queue.shift();\n\n\tif (process.time <= q) {\n\t\tpassed += process.time;\n\t\tconsole.log(process.name + ' ' + passed);\n\t} else {\n\t\tpassed += q;\n\t\tprocess.time -= q;\n\t\tqueue.push(process);\n\t}\n}", "language": "JavaScript", "metadata": {"date": 1399011847, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02264.html", "problem_id": "p02264", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02264/input.txt", "sample_output_relpath": "derived/input_output/data/p02264/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02264/JavaScript/s673799490.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s673799490", "user_id": "u845053458"}, "prompt_components": {"gold_output": "p2 180\np5 400\np1 450\np3 550\np4 800\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar lines = input.split('\\n');\n\nvar line = lines.shift();\nvar tmp = line.split(' ');\nvar n = tmp[0];\nvar q = tmp[1] - 0;\n\nvar queue = [];\nlines.forEach(function(l) {\n\ttmp = l.split(' ');\n\tqueue.push({name: tmp[0], time: tmp[1] - 0});\n});\n\nvar passed = 0;\nwhile (queue.length > 0) {\n\tvar process = queue.shift();\n\n\tif (process.time <= q) {\n\t\tpassed += process.time;\n\t\tconsole.log(process.name + ' ' + passed);\n\t} else {\n\t\tpassed += q;\n\t\tprocess.time -= q;\n\t\tqueue.push(process);\n\t}\n}", "problem_context": "There are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then the scheduler handles the next process in the queue.\n\nFor example, we have the following queue with the quantum of 100ms.\n\nA(150) - B(80) - C(200) - D(200)\n\nFirst, process A is handled for 100ms, then the process is moved to the end of the queue with the remaining time (50ms).\n\nB(80) - C(200) - D(200) - A(50)\n\nNext, process B is handled for 80ms. The process is completed with the time stamp of 180ms and removed from the queue.\n\nC(200) - D(200) - A(50)\n\nYour task is to write a program which simulates the round-robin scheduling.\n\nInput\n\nn q\n\nname1 time1\n\nname2 time2\n\n...\n\nnamen timen\n\nIn the first line the number of processes n and the quantum q are given separated by a single space.\n\nIn the following n lines, names and times for the n processes are given. namei and timei are separated by a single space.\n\nOutput\n\nFor each process, prints its name and the time the process finished in order.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n1 ≤ q ≤ 1000\n\n1 ≤ timei ≤ 50000\n\n1 ≤ length of namei ≤ 10\n\n1 ≤ Sum of timei ≤ 1000000\n\nSample Input 1\n\n5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n\nSample Output 1\n\np2 180\np5 400\np1 450\np3 550\np4 800\n\nNotes\n\nTemplate in C", "sample_input": "5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n"}, "reference_outputs": ["p2 180\np5 400\np1 450\np3 550\np4 800\n"], "source_document_id": "p02264", "source_text": "There are n processes in a queue. Each process has namei and timei. The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then the scheduler handles the next process in the queue.\n\nFor example, we have the following queue with the quantum of 100ms.\n\nA(150) - B(80) - C(200) - D(200)\n\nFirst, process A is handled for 100ms, then the process is moved to the end of the queue with the remaining time (50ms).\n\nB(80) - C(200) - D(200) - A(50)\n\nNext, process B is handled for 80ms. The process is completed with the time stamp of 180ms and removed from the queue.\n\nC(200) - D(200) - A(50)\n\nYour task is to write a program which simulates the round-robin scheduling.\n\nInput\n\nn q\n\nname1 time1\n\nname2 time2\n\n...\n\nnamen timen\n\nIn the first line the number of processes n and the quantum q are given separated by a single space.\n\nIn the following n lines, names and times for the n processes are given. namei and timei are separated by a single space.\n\nOutput\n\nFor each process, prints its name and the time the process finished in order.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n1 ≤ q ≤ 1000\n\n1 ≤ timei ≤ 50000\n\n1 ≤ length of namei ≤ 10\n\n1 ≤ Sum of timei ≤ 1000000\n\nSample Input 1\n\n5 100\np1 150\np2 80\np3 200\np4 350\np5 20\n\nSample Output 1\n\np2 180\np5 400\np1 450\np3 550\np4 800\n\nNotes\n\nTemplate in C", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 544, "cpu_time_ms": 40000, "memory_kb": 12712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s402544357", "group_id": "codeNet:p02265", "input_text": "function DoublyLinkedList() {\n this.length = 0;\n this.head = null;\n this.tail = null;\n}\nDoublyLinkedList.prototype={\n add: function(value){\n var node={value:value,next:null,previous:null,}\n if(this.length==0){this.head=node;this.tail=node;}\n else {this.tail.next=node;node.previous=this.tail;this.tail=node;}\n this.length++;\n },\n insert: function(value){\n var node={value:value,next:null,previous:null,}\n if(this.length==0){this.head=node;this.tail=node;}\n else{this.head.previous=node;node.next=this.head;this.head=node;}\n this.length++;\n },\n getNode: function(index){\n var node=this.head;\n var i=0;\n while(i++ {\n if (x === '\\\\') {\n acc.stack.push(i);\n } else if (x === '/' && acc.stack.length > 0) {\n const k = acc.stack.pop();\n const hd = acc.pond.filter(xs => xs[0] >= k);\n const tl = acc.pond.filter(xs => xs[0] < k);\n\n const sum = [k, hd.map(xs => xs[1]).reduce((acc, x) => acc + x, 0) + (i - k)]\n tl.push(sum);\n acc.pond = tl;\n }\n\n return acc;\n}, data);\n\nconsole.log(results.pond.reduce((acc, x) => acc + x[1], 0));\nconsole.log(`${results.pond.length} ${results.pond.map(x => x[1].toString()).join(' ')}`);\n", "language": "JavaScript", "metadata": {"date": 1527946736, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02266.html", "problem_id": "p02266", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02266/input.txt", "sample_output_relpath": "derived/input_output/data/p02266/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02266/JavaScript/s598116621.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "WA: Presentation Error", "submission_id": "s598116621", "user_id": "u215732964"}, "prompt_components": {"gold_output": "4\n1 4\n", "input_to_evaluate": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst data = {\n pond : [],\n stack : []\n};\n\nconst results = line[0].split('').reduce((acc, x, i) => {\n if (x === '\\\\') {\n acc.stack.push(i);\n } else if (x === '/' && acc.stack.length > 0) {\n const k = acc.stack.pop();\n const hd = acc.pond.filter(xs => xs[0] >= k);\n const tl = acc.pond.filter(xs => xs[0] < k);\n\n const sum = [k, hd.map(xs => xs[1]).reduce((acc, x) => acc + x, 0) + (i - k)]\n tl.push(sum);\n acc.pond = tl;\n }\n\n return acc;\n}, data);\n\nconsole.log(results.pond.reduce((acc, x) => acc + x[1], 0));\nconsole.log(`${results.pond.length} ${results.pond.map(x => x[1].toString()).join(' ')}`);\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section diagram, reports areas of flooded sections.\n\nAssume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides.\nFor example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.\n\nInput\n\nA string, which represents slopes and flatlands by '/', '\\' and '_' respectively, is given in a line. For example, the region of the above example is given by a string \"\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\".\n\noutput\n\nReport the areas of floods in the following format:\n\n$A$\n\n$k$ $L_1$ $L_2$ ... $L_k$\n\nIn the first line, print the total area $A$ of created floods.\n\nIn the second line, print the number of floods $k$ and areas $L_i (i = 1, 2, ..., k)$ for each flood from the left side of the cross-section diagram. Print a space character before $L_i$.\n\nConstraints\n\n$1 \\leq$ length of the string $\\leq 20,000$\n\nSample Input 1\n\n\\\\//\n\nSample Output 1\n\n4\n1 4\n\nSample Input 2\n\n\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\n\nSample Output 2\n\n35\n5 4 2 1 19 9", "sample_input": "\\\\//\n"}, "reference_outputs": ["4\n1 4\n"], "source_document_id": "p02266", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section diagram, reports areas of flooded sections.\n\nAssume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides.\nFor example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.\n\nInput\n\nA string, which represents slopes and flatlands by '/', '\\' and '_' respectively, is given in a line. For example, the region of the above example is given by a string \"\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\".\n\noutput\n\nReport the areas of floods in the following format:\n\n$A$\n\n$k$ $L_1$ $L_2$ ... $L_k$\n\nIn the first line, print the total area $A$ of created floods.\n\nIn the second line, print the number of floods $k$ and areas $L_i (i = 1, 2, ..., k)$ for each flood from the left side of the cross-section diagram. Print a space character before $L_i$.\n\nConstraints\n\n$1 \\leq$ length of the string $\\leq 20,000$\n\nSample Input 1\n\n\\\\//\n\nSample Output 1\n\n4\n1 4\n\nSample Input 2\n\n\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\n\nSample Output 2\n\n35\n5 4 2 1 19 9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 819, "cpu_time_ms": 80, "memory_kb": 15496}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s077197963", "group_id": "codeNet:p02266", "input_text": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst data = {\n pond : [],\n stack : []\n};\n\nconst results = line[0].split('').reduce((acc, x, i) => {\n if (x === '\\\\') {\n acc.stack.push(i);\n } else if (x === '/' && acc.stack.length > 0) {\n const k = acc.stack.pop();\n const hd = acc.pond.filter(xs => xs[0] >= k);\n const tl = acc.pond.filter(xs => xs[0] < k);\n\n const sum = [k, hd.map(xs => xs[1]).reduce((acc, x) => acc + x, 0) + (i - k)]\n tl.push(sum);\n acc.pond = tl;\n }\n\n return acc;\n}, data);\n\nconst sum = results.pond.reduce((acc, x) => acc + x[1], 0);\nconst l = results.pond.length;\n\nconsole.log(sum);\nconsole.log(`${l}${l > 0 ? ' ' + results.pond.map(x => x[1].toString()).join(' ') : ''}`);\n\n", "language": "JavaScript", "metadata": {"date": 1529498298, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02266.html", "problem_id": "p02266", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02266/input.txt", "sample_output_relpath": "derived/input_output/data/p02266/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02266/JavaScript/s077197963.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s077197963", "user_id": "u707214955"}, "prompt_components": {"gold_output": "4\n1 4\n", "input_to_evaluate": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst data = {\n pond : [],\n stack : []\n};\n\nconst results = line[0].split('').reduce((acc, x, i) => {\n if (x === '\\\\') {\n acc.stack.push(i);\n } else if (x === '/' && acc.stack.length > 0) {\n const k = acc.stack.pop();\n const hd = acc.pond.filter(xs => xs[0] >= k);\n const tl = acc.pond.filter(xs => xs[0] < k);\n\n const sum = [k, hd.map(xs => xs[1]).reduce((acc, x) => acc + x, 0) + (i - k)]\n tl.push(sum);\n acc.pond = tl;\n }\n\n return acc;\n}, data);\n\nconst sum = results.pond.reduce((acc, x) => acc + x[1], 0);\nconst l = results.pond.length;\n\nconsole.log(sum);\nconsole.log(`${l}${l > 0 ? ' ' + results.pond.map(x => x[1].toString()).join(' ') : ''}`);\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section diagram, reports areas of flooded sections.\n\nAssume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides.\nFor example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.\n\nInput\n\nA string, which represents slopes and flatlands by '/', '\\' and '_' respectively, is given in a line. For example, the region of the above example is given by a string \"\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\".\n\noutput\n\nReport the areas of floods in the following format:\n\n$A$\n\n$k$ $L_1$ $L_2$ ... $L_k$\n\nIn the first line, print the total area $A$ of created floods.\n\nIn the second line, print the number of floods $k$ and areas $L_i (i = 1, 2, ..., k)$ for each flood from the left side of the cross-section diagram. Print a space character before $L_i$.\n\nConstraints\n\n$1 \\leq$ length of the string $\\leq 20,000$\n\nSample Input 1\n\n\\\\//\n\nSample Output 1\n\n4\n1 4\n\nSample Input 2\n\n\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\n\nSample Output 2\n\n35\n5 4 2 1 19 9", "sample_input": "\\\\//\n"}, "reference_outputs": ["4\n1 4\n"], "source_document_id": "p02266", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section diagram, reports areas of flooded sections.\n\nAssume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides.\nFor example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.\n\nInput\n\nA string, which represents slopes and flatlands by '/', '\\' and '_' respectively, is given in a line. For example, the region of the above example is given by a string \"\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\".\n\noutput\n\nReport the areas of floods in the following format:\n\n$A$\n\n$k$ $L_1$ $L_2$ ... $L_k$\n\nIn the first line, print the total area $A$ of created floods.\n\nIn the second line, print the number of floods $k$ and areas $L_i (i = 1, 2, ..., k)$ for each flood from the left side of the cross-section diagram. Print a space character before $L_i$.\n\nConstraints\n\n$1 \\leq$ length of the string $\\leq 20,000$\n\nSample Input 1\n\n\\\\//\n\nSample Output 1\n\n4\n1 4\n\nSample Input 2\n\n\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\n\nSample Output 2\n\n35\n5 4 2 1 19 9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 869, "cpu_time_ms": 3540, "memory_kb": 25392}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s171844864", "group_id": "codeNet:p02266", "input_text": "\n\n(function main() {\n let line = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('');\n let height_list = [0];\n let current_height = 0;\n line.forEach(function(e, i){\n if (e == '\\\\') current_height -= 1\n else if (e == '_') current_height += 0\n else current_height += 1\n height_list.push(current_height);\n });\n\n // console.log(height_list.join(','));\n let sum = 0;\n let holes = [];\n for (;height_list.length > 1;) {\n let h = makeHole(height_list);\n if (h > 0) {\n sum += h;\n holes.push(h);\n // console.log(h, height_list.join(','));\n }\n }\n\n console.log(sum);\n console.log(holes.length && holes.length + ' ' + holes.join(' '));\n})();\n\nfunction makeHole(list) {\n begin = list.shift();\n if (begin <= list.reduce((a, b) => Math.max(a, b), -100000)) {\n area = 0;\n while (true) {\n if (list.length == 0 || begin <= list[0]) break;\n area += begin - list.shift();\n }\n return area;\n } else {\n return 0;\n }\n}\n\n", "language": "JavaScript", "metadata": {"date": 1530209456, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02266.html", "problem_id": "p02266", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02266/input.txt", "sample_output_relpath": "derived/input_output/data/p02266/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02266/JavaScript/s171844864.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s171844864", "user_id": "u298224238"}, "prompt_components": {"gold_output": "4\n1 4\n", "input_to_evaluate": "\n\n(function main() {\n let line = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('');\n let height_list = [0];\n let current_height = 0;\n line.forEach(function(e, i){\n if (e == '\\\\') current_height -= 1\n else if (e == '_') current_height += 0\n else current_height += 1\n height_list.push(current_height);\n });\n\n // console.log(height_list.join(','));\n let sum = 0;\n let holes = [];\n for (;height_list.length > 1;) {\n let h = makeHole(height_list);\n if (h > 0) {\n sum += h;\n holes.push(h);\n // console.log(h, height_list.join(','));\n }\n }\n\n console.log(sum);\n console.log(holes.length && holes.length + ' ' + holes.join(' '));\n})();\n\nfunction makeHole(list) {\n begin = list.shift();\n if (begin <= list.reduce((a, b) => Math.max(a, b), -100000)) {\n area = 0;\n while (true) {\n if (list.length == 0 || begin <= list[0]) break;\n area += begin - list.shift();\n }\n return area;\n } else {\n return 0;\n }\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section diagram, reports areas of flooded sections.\n\nAssume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides.\nFor example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.\n\nInput\n\nA string, which represents slopes and flatlands by '/', '\\' and '_' respectively, is given in a line. For example, the region of the above example is given by a string \"\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\".\n\noutput\n\nReport the areas of floods in the following format:\n\n$A$\n\n$k$ $L_1$ $L_2$ ... $L_k$\n\nIn the first line, print the total area $A$ of created floods.\n\nIn the second line, print the number of floods $k$ and areas $L_i (i = 1, 2, ..., k)$ for each flood from the left side of the cross-section diagram. Print a space character before $L_i$.\n\nConstraints\n\n$1 \\leq$ length of the string $\\leq 20,000$\n\nSample Input 1\n\n\\\\//\n\nSample Output 1\n\n4\n1 4\n\nSample Input 2\n\n\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\n\nSample Output 2\n\n35\n5 4 2 1 19 9", "sample_input": "\\\\//\n"}, "reference_outputs": ["4\n1 4\n"], "source_document_id": "p02266", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nAreas on the Cross-Section Diagram\n\nYour task is to simulate a flood damage.\n\nFor a given cross-section diagram, reports areas of flooded sections.\n\nAssume that rain is falling endlessly in the region and the water overflowing from the region is falling in the sea at the both sides.\nFor example, for the above cross-section diagram, the rain will create floods which have areas of 4, 2, 1, 19 and 9 respectively.\n\nInput\n\nA string, which represents slopes and flatlands by '/', '\\' and '_' respectively, is given in a line. For example, the region of the above example is given by a string \"\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\".\n\noutput\n\nReport the areas of floods in the following format:\n\n$A$\n\n$k$ $L_1$ $L_2$ ... $L_k$\n\nIn the first line, print the total area $A$ of created floods.\n\nIn the second line, print the number of floods $k$ and areas $L_i (i = 1, 2, ..., k)$ for each flood from the left side of the cross-section diagram. Print a space character before $L_i$.\n\nConstraints\n\n$1 \\leq$ length of the string $\\leq 20,000$\n\nSample Input 1\n\n\\\\//\n\nSample Output 1\n\n4\n1 4\n\nSample Input 2\n\n\\\\///\\_/\\/\\\\\\\\/_/\\\\///__\\\\\\_\\\\/_\\/_/\\\n\nSample Output 2\n\n35\n5 4 2 1 19 9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1014, "cpu_time_ms": 3020, "memory_kb": 21052}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s287548221", "group_id": "codeNet:p02267", "input_text": "(function() {\n 'use strict';\n\n var fs = require('fs');\n var contents = fs.readFileSync('/dev/stdin', 'utf-8');\n\n var search = function(contents) {\n var S = [];\n var n = 0;\n var q = 0;\n var C = 0;\n var t = 0;\n\n var lines = contents.trim().split(\"\\n\");\n n = parseInt(lines[0]);\n S.length = n;\n var a = lines[1].split(\" \");\n for (var i = 0; i < a.length; i++) {\n S[i] = parseInt(a[i]);\n }\n\n q = parseInt(lines[2]);\n var T = lines[3].split(\" \");\n for (var i = 0; i < q; i++) {\n t = parseInt(T[i]);\n for (var j = 0; j < n; j++) {\n if (t == S[j]) {\n C++;\n break;\n }\n }\n }\n console.log(C);\n }\n search(contents);\n})();", "language": "JavaScript", "metadata": {"date": 1445394472, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02267.html", "problem_id": "p02267", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02267/input.txt", "sample_output_relpath": "derived/input_output/data/p02267/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02267/JavaScript/s287548221.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s287548221", "user_id": "u967451256"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "(function() {\n 'use strict';\n\n var fs = require('fs');\n var contents = fs.readFileSync('/dev/stdin', 'utf-8');\n\n var search = function(contents) {\n var S = [];\n var n = 0;\n var q = 0;\n var C = 0;\n var t = 0;\n\n var lines = contents.trim().split(\"\\n\");\n n = parseInt(lines[0]);\n S.length = n;\n var a = lines[1].split(\" \");\n for (var i = 0; i < a.length; i++) {\n S[i] = parseInt(a[i]);\n }\n\n q = parseInt(lines[2]);\n var T = lines[3].split(\" \");\n for (var i = 0; i < q; i++) {\n t = parseInt(T[i]);\n for (var j = 0; j < n; j++) {\n if (t == S[j]) {\n C++;\n break;\n }\n }\n }\n console.log(C);\n }\n search(contents);\n})();", "problem_context": "Search I\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nn ≤ 10000\n\nq ≤ 500\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n3 1 2\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "sample_input": "5\n1 2 3 4 5\n3\n3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02267", "source_text": "Search I\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nn ≤ 10000\n\nq ≤ 500\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n3 1 2\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 852, "cpu_time_ms": 60, "memory_kb": 17428}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s587838310", "group_id": "codeNet:p02268", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.trim().split('\\n');\nconst n = Number(list[0]);\nconst S = list[1].split(' ').map(Number);\nconst q = Number(list[2]);\nconst T = list[3].split(' ').map(Number);\n\nconst search = (list, value) => {\n let l = 0;\n let r = list.length;\n while (l < r) {\n const target = Math.floor((l + r) / 2);\n if (list[target] < value) {\n l = target + 1;\n } else if (list[target] > value) {\n r = target;\n } else {\n return 1;\n }\n }\n return 0;\n}\n\nlet count = 0;\nT.forEach((t) => {\n count += search(list, t);\n});\nconsole.log(count);\n\n", "language": "JavaScript", "metadata": {"date": 1518693174, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02268.html", "problem_id": "p02268", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02268/input.txt", "sample_output_relpath": "derived/input_output/data/p02268/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02268/JavaScript/s587838310.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s587838310", "user_id": "u779137493"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.trim().split('\\n');\nconst n = Number(list[0]);\nconst S = list[1].split(' ').map(Number);\nconst q = Number(list[2]);\nconst T = list[3].split(' ').map(Number);\n\nconst search = (list, value) => {\n let l = 0;\n let r = list.length;\n while (l < r) {\n const target = Math.floor((l + r) / 2);\n if (list[target] < value) {\n l = target + 1;\n } else if (list[target] > value) {\n r = target;\n } else {\n return 1;\n }\n }\n return 0;\n}\n\nlet count = 0;\nT.forEach((t) => {\n count += search(list, t);\n});\nconsole.log(count);\n\n", "problem_context": "Search II\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nElements in S is sorted in ascending order\n\nn ≤ 100000\n\nq ≤ 50000\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1 2 3\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "sample_input": "5\n1 2 3 4 5\n3\n3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02268", "source_text": "Search II\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nElements in S is sorted in ascending order\n\nn ≤ 100000\n\nq ≤ 50000\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1 2 3\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 627, "cpu_time_ms": 80, "memory_kb": 15160}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s382836500", "group_id": "codeNet:p02268", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst Arr = (input.trim()).split(\"\\n\");\nconst N1 = Number(Arr[0]);\nconst arr1 = Arr[1].split(\" \").map(Number);\nconst arr2 = Arr[3].split(\" \").map(Number);\n\nconst summing = (a, b) => a + b;\nconsole.log(arr2.map(key => { \n let mid;\n let left = 0;\n let right = N1;\n if (key < arr1[0] || arr1[N1-1] < key) return 0;\n while (left < right) {\n mid = Math.floor((left + right) / 2);\n if (key < arr1[mid]) right = mid;\n else if (key > arr1[mid]) left = mid + 1;\n else return 1;\n }\n return 0;\n}).reduce((a, b) => a + b, 0));\n\n", "language": "JavaScript", "metadata": {"date": 1530100338, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02268.html", "problem_id": "p02268", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02268/input.txt", "sample_output_relpath": "derived/input_output/data/p02268/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02268/JavaScript/s382836500.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s382836500", "user_id": "u298224238"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst Arr = (input.trim()).split(\"\\n\");\nconst N1 = Number(Arr[0]);\nconst arr1 = Arr[1].split(\" \").map(Number);\nconst arr2 = Arr[3].split(\" \").map(Number);\n\nconst summing = (a, b) => a + b;\nconsole.log(arr2.map(key => { \n let mid;\n let left = 0;\n let right = N1;\n if (key < arr1[0] || arr1[N1-1] < key) return 0;\n while (left < right) {\n mid = Math.floor((left + right) / 2);\n if (key < arr1[mid]) right = mid;\n else if (key > arr1[mid]) left = mid + 1;\n else return 1;\n }\n return 0;\n}).reduce((a, b) => a + b, 0));\n\n", "problem_context": "Search II\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nElements in S is sorted in ascending order\n\nn ≤ 100000\n\nq ≤ 50000\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1 2 3\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "sample_input": "5\n1 2 3 4 5\n3\n3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02268", "source_text": "Search II\n\nYou are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers are given.\n\nOutput\n\nPrint C in a line.\n\nConstraints\n\nElements in S is sorted in ascending order\n\nn ≤ 100000\n\nq ≤ 50000\n\n0 ≤ an element in S ≤ 109\n\n0 ≤ an element in T ≤ 109\n\nSample Input 1\n\n5\n1 2 3 4 5\n3\n3 4 1\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1 2 3\n1\n5\n\nSample Output 2\n\n0\n\nSample Input 3\n\n5\n1 1 2 2 3\n2\n1 2\n\nSample Output 3\n\n2\n\nNotes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 601, "cpu_time_ms": 180, "memory_kb": 34940}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s862607792", "group_id": "codeNet:p02271", "input_text": "(function(input) {\n var p = input.split('\\n');\n var n = Number(p.shift());\n var A = p.shift().split(' ', n).map(Number);\n var q = Number(p.shift());\n var m = p.shift().split(' ', q).map(Number);\n\n for (var i = 0; i < m.length; i++) {\n //console.info(\"n = \" + i);\n console.log(check(A, 0, m[i]) ? 'yes' : 'no');\n //console.info('##########');\n }\n\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction check(A, i, m) {\n //console.info(\"i = \" + i);\n //console.info(\"m = \" + i);\n var a = A[i];\n if (m < a) {\n return false;\n }\n if (m == a) {\n return true;\n }\n if (i == A.length - 1) {\n return false;\n }\n i++;\n return check(A, i, m - a) || check(A, i, m);\n}", "language": "JavaScript", "metadata": {"date": 1428413722, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02271.html", "problem_id": "p02271", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02271/input.txt", "sample_output_relpath": "derived/input_output/data/p02271/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02271/JavaScript/s862607792.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s862607792", "user_id": "u759826653"}, "prompt_components": {"gold_output": "no\nno\nyes\nyes\nyes\nyes\nno\nno\n", "input_to_evaluate": "(function(input) {\n var p = input.split('\\n');\n var n = Number(p.shift());\n var A = p.shift().split(' ', n).map(Number);\n var q = Number(p.shift());\n var m = p.shift().split(' ', q).map(Number);\n\n for (var i = 0; i < m.length; i++) {\n //console.info(\"n = \" + i);\n console.log(check(A, 0, m[i]) ? 'yes' : 'no');\n //console.info('##########');\n }\n\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction check(A, i, m) {\n //console.info(\"i = \" + i);\n //console.info(\"m = \" + i);\n var a = A[i];\n if (m < a) {\n return false;\n }\n if (m == a) {\n return true;\n }\n if (i == A.length - 1) {\n return false;\n }\n i++;\n return check(A, i, m - a) || check(A, i, m);\n}", "problem_context": "Exhaustive Search\n\nWrite a program which reads a sequence A of n elements and an integer M, and outputs \"yes\" if you can make M by adding elements in A, otherwise \"no\". You can use an element only once.\n\nYou are given the sequence A and q questions where each question contains Mi.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers (Mi) are given.\n\nOutput\n\nFor each question Mi, print yes or no.\n\nConstraints\n\nn ≤ 20\n\nq ≤ 200\n\n1 ≤ elements in A ≤ 2000\n\n1 ≤ Mi ≤ 2000\n\nSample Input 1\n\n5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n\nSample Output 1\n\nno\nno\nyes\nyes\nyes\nyes\nno\nno\n\nNotes\n\nYou can solve this problem by a Burte Force approach. Suppose solve(p, t) is a function which checkes whether you can make t by selecting elements after p-th element (inclusive). Then you can recursively call the following functions:\n\nsolve(0, M)\n\nsolve(1, M-{sum created from elements before 1st element})\n\nsolve(2, M-{sum created from elements before 2nd element})\n\n...\n\nThe recursive function has two choices: you selected p-th element and not. So, you can check solve(p+1, t-A[p]) and solve(p+1, t) in solve(p, t) to check the all combinations.\n\nFor example, the following figure shows that 8 can be made by A[0] + A[2].", "sample_input": "5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n"}, "reference_outputs": ["no\nno\nyes\nyes\nyes\nyes\nno\nno\n"], "source_document_id": "p02271", "source_text": "Exhaustive Search\n\nWrite a program which reads a sequence A of n elements and an integer M, and outputs \"yes\" if you can make M by adding elements in A, otherwise \"no\". You can use an element only once.\n\nYou are given the sequence A and q questions where each question contains Mi.\n\nInput\n\nIn the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q integers (Mi) are given.\n\nOutput\n\nFor each question Mi, print yes or no.\n\nConstraints\n\nn ≤ 20\n\nq ≤ 200\n\n1 ≤ elements in A ≤ 2000\n\n1 ≤ Mi ≤ 2000\n\nSample Input 1\n\n5\n1 5 7 10 21\n8\n2 4 17 8 22 21 100 35\n\nSample Output 1\n\nno\nno\nyes\nyes\nyes\nyes\nno\nno\n\nNotes\n\nYou can solve this problem by a Burte Force approach. Suppose solve(p, t) is a function which checkes whether you can make t by selecting elements after p-th element (inclusive). Then you can recursively call the following functions:\n\nsolve(0, M)\n\nsolve(1, M-{sum created from elements before 1st element})\n\nsolve(2, M-{sum created from elements before 2nd element})\n\n...\n\nThe recursive function has two choices: you selected p-th element and not. So, you can check solve(p+1, t-A[p]) and solve(p+1, t) in solve(p, t) to check the all combinations.\n\nFor example, the following figure shows that 8 can be made by A[0] + A[2].", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 757, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s149829936", "group_id": "codeNet:p02273", "input_text": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst pos = (x, y) => {\n return { x : x, y : y};\n};\n\n// Pos -> Pos -> (Pos, Pos)\nconst div = (p1, p2, n) => {\n if (n === 0) return [];\n const th = pos((p1.x + p2.x) / 3, (p1.y + p2.y) / 3);\n const l = Math.sqrt(Math.pow(th.x, 2) + Math.pow(th.y, 2));\n const cos = Math.cos(Math.PI / 3.0);\n const sin = Math.sin(Math.PI / 3.0);\n\n const s = pos((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3);\n const t = pos((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3);\n const u = pos( (t.x - s.x) * cos - (t.y - s.y) * sin + s.x\n , (t.x - s.x) * sin - (t.y - s.y) * cos + s.y\n );\n \n return div(p1, s, n - 1)\n .concat(s)\n .concat(div(s, u, n - 1))\n .concat(u)\n .concat(div(u, t, n - 1))\n .concat(t)\n .concat(div(t, p2, n - 1));\n};\n\nconst solve = (n) => {\n if (n === 0) return [pos(0.0, 0.0), pos(100.0, 0.0)];\n return [pos(0.0, 0.0), ...div(pos(0.0, 0.0), pos(100.0, 0.0), n), pos(100.0, 0.0)];\n};\nsolve(parseInt(line[0]))\n .forEach(p => {\n console.log(p.x.toFixed(8), p.y.toFixed(8));\n });\n\n", "language": "JavaScript", "metadata": {"date": 1528080421, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02273.html", "problem_id": "p02273", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02273/input.txt", "sample_output_relpath": "derived/input_output/data/p02273/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02273/JavaScript/s149829936.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s149829936", "user_id": "u215732964"}, "prompt_components": {"gold_output": "0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n", "input_to_evaluate": "const config = {\n input: '/dev/stdin',\n newline: '\\n'\n};\n\nconst line = require('fs').readFileSync(config.input, 'utf-8').split(config.newline);\n\nconst pos = (x, y) => {\n return { x : x, y : y};\n};\n\n// Pos -> Pos -> (Pos, Pos)\nconst div = (p1, p2, n) => {\n if (n === 0) return [];\n const th = pos((p1.x + p2.x) / 3, (p1.y + p2.y) / 3);\n const l = Math.sqrt(Math.pow(th.x, 2) + Math.pow(th.y, 2));\n const cos = Math.cos(Math.PI / 3.0);\n const sin = Math.sin(Math.PI / 3.0);\n\n const s = pos((2 * p1.x + p2.x) / 3, (2 * p1.y + p2.y) / 3);\n const t = pos((p1.x + 2 * p2.x) / 3, (p1.y + 2 * p2.y) / 3);\n const u = pos( (t.x - s.x) * cos - (t.y - s.y) * sin + s.x\n , (t.x - s.x) * sin - (t.y - s.y) * cos + s.y\n );\n \n return div(p1, s, n - 1)\n .concat(s)\n .concat(div(s, u, n - 1))\n .concat(u)\n .concat(div(u, t, n - 1))\n .concat(t)\n .concat(div(t, p2, n - 1));\n};\n\nconst solve = (n) => {\n if (n === 0) return [pos(0.0, 0.0), pos(100.0, 0.0)];\n return [pos(0.0, 0.0), ...div(pos(0.0, 0.0), pos(100.0, 0.0), n), pos(100.0, 0.0)];\n};\nsolve(parseInt(line[0]))\n .forEach(p => {\n console.log(p.x.toFixed(8), p.y.toFixed(8));\n });\n\n", "problem_context": "Koch Curve\n\nWrite a program which reads an integer n and draws a Koch curve based on recursive calles of depth n.\n\nThe Koch curve is well known as a kind of fractals.\n\nYou can draw a Koch curve in the following algorithm:\n\nDivide a given segment (p1, p2) into three equal segments.\n\nReplace the middle segment by the two sides of an equilateral triangle (s, u, t) of the same length as the segment.\n\nRepeat this procedure recursively for new segments (p1, s), (s, u), (u, t), (t, p2).\n\nYou should start (0, 0), (100, 0) as the first segment.\n\nInput\n\nAn integer n is given.\n\nOutput\n\nPrint each point (x, y) of the Koch curve. Print a point in a line. You should start the point(0, 0), which is the endpoint of the first segment and end with the point (100, 0), the other endpoint so that you can draw the Koch curve as an unbroken line. Each solution should be given as a decimal with an arbitrary number of fractional digits, and with an absolute error of at most 10-4.\n\nConstraints\n\n0 ≤ n ≤ 6\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0.00000000 0.00000000\n11.11111111 0.00000000\n16.66666667 9.62250449\n22.22222222 0.00000000\n33.33333333 0.00000000\n38.88888889 9.62250449\n33.33333333 19.24500897\n44.44444444 19.24500897\n50.00000000 28.86751346\n55.55555556 19.24500897\n66.66666667 19.24500897\n61.11111111 9.62250449\n66.66666667 0.00000000\n77.77777778 0.00000000\n83.33333333 9.62250449\n88.88888889 0.00000000\n100.00000000 0.00000000\n\nNotes", "sample_input": "1\n"}, "reference_outputs": ["0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n"], "source_document_id": "p02273", "source_text": "Koch Curve\n\nWrite a program which reads an integer n and draws a Koch curve based on recursive calles of depth n.\n\nThe Koch curve is well known as a kind of fractals.\n\nYou can draw a Koch curve in the following algorithm:\n\nDivide a given segment (p1, p2) into three equal segments.\n\nReplace the middle segment by the two sides of an equilateral triangle (s, u, t) of the same length as the segment.\n\nRepeat this procedure recursively for new segments (p1, s), (s, u), (u, t), (t, p2).\n\nYou should start (0, 0), (100, 0) as the first segment.\n\nInput\n\nAn integer n is given.\n\nOutput\n\nPrint each point (x, y) of the Koch curve. Print a point in a line. You should start the point(0, 0), which is the endpoint of the first segment and end with the point (100, 0), the other endpoint so that you can draw the Koch curve as an unbroken line. Each solution should be given as a decimal with an arbitrary number of fractional digits, and with an absolute error of at most 10-4.\n\nConstraints\n\n0 ≤ n ≤ 6\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0.00000000 0.00000000\n33.33333333 0.00000000\n50.00000000 28.86751346\n66.66666667 0.00000000\n100.00000000 0.00000000\n\nSample Input 2\n\n2\n\nSample Output 2\n\n0.00000000 0.00000000\n11.11111111 0.00000000\n16.66666667 9.62250449\n22.22222222 0.00000000\n33.33333333 0.00000000\n38.88888889 9.62250449\n33.33333333 19.24500897\n44.44444444 19.24500897\n50.00000000 28.86751346\n55.55555556 19.24500897\n66.66666667 19.24500897\n61.11111111 9.62250449\n66.66666667 0.00000000\n77.77777778 0.00000000\n83.33333333 9.62250449\n88.88888889 0.00000000\n100.00000000 0.00000000\n\nNotes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1293, "cpu_time_ms": 80, "memory_kb": 15220}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s436340532", "group_id": "codeNet:p02275", "input_text": "const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\\n');\n\nconst csort = (arr) => {\n const k = arr.reduce((acc, x) => acc < x ? x : acc);\n const c = [...Array(k+1)].map(_ => 0);\n const result = [...Array(arr.length)];\n for (let i = 0; i < arr.length; i++) {\n c[arr[i]]++;\n }\n\n for (let i = 1; i <= k; i++) {\n c[i] += c[i-1];\n }\n \n for (let i = arr.length-1; i >= 0; i--) {\n result[c[arr[i]]-1] = arr[i];\n c[arr[i]]--;\n }\n\n return result;\n};\n\nconst data = line[1].split(' ').map(Number);\nconsole.log(csort(data).join(' '));\n\n", "language": "JavaScript", "metadata": {"date": 1530582659, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02275.html", "problem_id": "p02275", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02275/input.txt", "sample_output_relpath": "derived/input_output/data/p02275/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02275/JavaScript/s436340532.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s436340532", "user_id": "u707214955"}, "prompt_components": {"gold_output": "0 1 2 2 3 3 5\n", "input_to_evaluate": "const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\\n');\n\nconst csort = (arr) => {\n const k = arr.reduce((acc, x) => acc < x ? x : acc);\n const c = [...Array(k+1)].map(_ => 0);\n const result = [...Array(arr.length)];\n for (let i = 0; i < arr.length; i++) {\n c[arr[i]]++;\n }\n\n for (let i = 1; i <= k; i++) {\n c[i] += c[i-1];\n }\n \n for (let i = arr.length-1; i >= 0; i--) {\n result[c[arr[i]]-1] = arr[i];\n c[arr[i]]--;\n }\n\n return result;\n};\n\nconst data = line[1].split(' ').map(Number);\nconsole.log(csort(data).join(' '));\n\n", "problem_context": "Counting Sort\n\nCounting sort can be used for sorting elements in an array which each of the n input elements is an integer in the range 0 to k. The idea of counting sort is to determine, for each input element x, the number of elements less than x as C[x]. This information can be used to place element x directly into its position in the output array B. This scheme must be modified to handle the situation in which several elements have the same value. Please see the following pseudocode for the detail:\n\nCounting-Sort(A, B, k)\n1 for i = 0 to k\n2 do C[i] = 0\n3 for j = 1 to length[A]\n4 do C[A[j]] = C[A[j]]+1\n5 /* C[i] now contains the number of elements equal to i */\n6 for i = 1 to k\n7 do C[i] = C[i] + C[i-1]\n8 /* C[i] now contains the number of elements less than or equal to i */\n9 for j = length[A] downto 1\n10 do B[C[A[j]]] = A[j]\n11 C[A[j]] = C[A[j]]-1\n\nWrite a program which sorts elements of given array ascending order based on the counting sort.\n\nInput\n\nThe first line of the input includes an integer n, the number of elements in the sequence.\n\nIn the second line, n elements of the sequence are given separated by spaces characters.\n\nOutput\n\nPrint the sorted sequence. Two contiguous elements of the sequence should be separated by a space character.\n\nConstraints\n\n1 ≤ n ≤ 2,000,000\n\n0 ≤ A[i] ≤ 10,000\n\nSample Input 1\n\n7\n2 5 1 3 2 3 0\n\nSample Output 1\n\n0 1 2 2 3 3 5", "sample_input": "7\n2 5 1 3 2 3 0\n"}, "reference_outputs": ["0 1 2 2 3 3 5\n"], "source_document_id": "p02275", "source_text": "Counting Sort\n\nCounting sort can be used for sorting elements in an array which each of the n input elements is an integer in the range 0 to k. The idea of counting sort is to determine, for each input element x, the number of elements less than x as C[x]. This information can be used to place element x directly into its position in the output array B. This scheme must be modified to handle the situation in which several elements have the same value. Please see the following pseudocode for the detail:\n\nCounting-Sort(A, B, k)\n1 for i = 0 to k\n2 do C[i] = 0\n3 for j = 1 to length[A]\n4 do C[A[j]] = C[A[j]]+1\n5 /* C[i] now contains the number of elements equal to i */\n6 for i = 1 to k\n7 do C[i] = C[i] + C[i-1]\n8 /* C[i] now contains the number of elements less than or equal to i */\n9 for j = length[A] downto 1\n10 do B[C[A[j]]] = A[j]\n11 C[A[j]] = C[A[j]]-1\n\nWrite a program which sorts elements of given array ascending order based on the counting sort.\n\nInput\n\nThe first line of the input includes an integer n, the number of elements in the sequence.\n\nIn the second line, n elements of the sequence are given separated by spaces characters.\n\nOutput\n\nPrint the sorted sequence. Two contiguous elements of the sequence should be separated by a space character.\n\nConstraints\n\n1 ≤ n ≤ 2,000,000\n\n0 ≤ A[i] ≤ 10,000\n\nSample Input 1\n\n7\n2 5 1 3 2 3 0\n\nSample Output 1\n\n0 1 2 2 3 3 5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 603, "cpu_time_ms": 1820, "memory_kb": 301584}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s340112211", "group_id": "codeNet:p02277", "input_text": "class Card {\n constructor(mark, value) {\n this.mark = String(mark);\n this.value = Number(value);\n }\n\n equals(other) { return this.value === other.value && this.mark === other.mark; }\n\n compareTo(other) {\n if (this.value === other.value) return 0;\n else if (this.value < other.value) return -1;\n else return 1;\n }\n\n toString() { return `${this.mark} ${this.value}` }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n let arr = lines.map(r => r.split(' ')).map(c => new Card(c[0], c[1]));\n const quick_arr = Array.from(arr);\n\n quickSort(quick_arr, 0, n - 1);\n arr.map((e, idx) => ({val: e, idx: idx}))\n .sort((a, b) => a.val.compareTo(b.val) || a.idx - b.idx)\n .map(e => e.val);\n\n console.log(arr.every((card, i) => card.equals(quick_arr[i]))\n ? 'Stable' : 'Not stable');\n console.log(quick_arr.join('\\n'));\n})();\n\nfunction quickSort(arr, p, r) {\n const partition = function(arr, p, r) {\n let x = arr[r];\n let i = p - 1;\n for (let j = p; j < r; j++) {\n if (arr[j].compareTo(x) <= 0) {\n i++;\n [arr[i], arr[j]] = [arr[j], arr[i]];\n }\n }\n [arr[i + 1], arr[r]] = [arr[r], arr[i + 1]];\n return i + 1;\n }\n\n quickSort = function(arr, p, r) {\n if (p < r) {\n let q = partition(arr, p, r);\n quickSort(arr, p, q - 1);\n quickSort(arr, q + 1, r);\n }\n }\n quickSort(arr, p, r);\n}\n\n", "language": "JavaScript", "metadata": {"date": 1530623166, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02277.html", "problem_id": "p02277", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02277/input.txt", "sample_output_relpath": "derived/input_output/data/p02277/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02277/JavaScript/s340112211.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s340112211", "user_id": "u298224238"}, "prompt_components": {"gold_output": "Not stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n", "input_to_evaluate": "class Card {\n constructor(mark, value) {\n this.mark = String(mark);\n this.value = Number(value);\n }\n\n equals(other) { return this.value === other.value && this.mark === other.mark; }\n\n compareTo(other) {\n if (this.value === other.value) return 0;\n else if (this.value < other.value) return -1;\n else return 1;\n }\n\n toString() { return `${this.mark} ${this.value}` }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n let arr = lines.map(r => r.split(' ')).map(c => new Card(c[0], c[1]));\n const quick_arr = Array.from(arr);\n\n quickSort(quick_arr, 0, n - 1);\n arr.map((e, idx) => ({val: e, idx: idx}))\n .sort((a, b) => a.val.compareTo(b.val) || a.idx - b.idx)\n .map(e => e.val);\n\n console.log(arr.every((card, i) => card.equals(quick_arr[i]))\n ? 'Stable' : 'Not stable');\n console.log(quick_arr.join('\\n'));\n})();\n\nfunction quickSort(arr, p, r) {\n const partition = function(arr, p, r) {\n let x = arr[r];\n let i = p - 1;\n for (let j = p; j < r; j++) {\n if (arr[j].compareTo(x) <= 0) {\n i++;\n [arr[i], arr[j]] = [arr[j], arr[i]];\n }\n }\n [arr[i + 1], arr[r]] = [arr[r], arr[i + 1]];\n return i + 1;\n }\n\n quickSort = function(arr, p, r) {\n if (p < r) {\n let q = partition(arr, p, r);\n quickSort(arr, p, q - 1);\n quickSort(arr, q + 1, r);\n }\n }\n quickSort(arr, p, r);\n}\n\n", "problem_context": "Quick Sort\n\nLet's arrange a deck of cards. Your task is to sort totally n cards. A card consists of a part of a suit (S, H, C or D) and an number. Write a program which sorts such cards based on the following pseudocode:\n\nPartition(A, p, r)\n1 x = A[r]\n2 i = p-1\n3 for j = p to r-1\n4 do if A[j] <= x\n5 then i = i+1\n6 exchange A[i] and A[j]\n7 exchange A[i+1] and A[r]\n8 return i+1\n\nQuicksort(A, p, r)\n1 if p < r\n2 then q = Partition(A, p, r)\n3 run Quicksort(A, p, q-1)\n4 run Quicksort(A, q+1, r)\n\nHere, A is an array which represents a deck of cards and comparison operations are performed based on the numbers.\n\nYour program should also report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).\n\nInput\n\nThe first line contains an integer n, the number of cards.\n\nn cards are given in the following lines. Each card is given in a line and represented by a pair of a character and an integer separated by a single space.\n\nOutput\n\nIn the first line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nIn the following lines, print the arranged cards in the same manner of that of the input.\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n1 ≤ the number of a card ≤ 109\n\nThere are no identical card in the input\n\nSample Input 1\n\n6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n\nSample Output 1\n\nNot stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n\nSample Input 2\n\n2\nS 1\nH 1\n\nSample Output 2\n\nStable\nS 1\nH 1", "sample_input": "6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n"}, "reference_outputs": ["Not stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n"], "source_document_id": "p02277", "source_text": "Quick Sort\n\nLet's arrange a deck of cards. Your task is to sort totally n cards. A card consists of a part of a suit (S, H, C or D) and an number. Write a program which sorts such cards based on the following pseudocode:\n\nPartition(A, p, r)\n1 x = A[r]\n2 i = p-1\n3 for j = p to r-1\n4 do if A[j] <= x\n5 then i = i+1\n6 exchange A[i] and A[j]\n7 exchange A[i+1] and A[r]\n8 return i+1\n\nQuicksort(A, p, r)\n1 if p < r\n2 then q = Partition(A, p, r)\n3 run Quicksort(A, p, q-1)\n4 run Quicksort(A, q+1, r)\n\nHere, A is an array which represents a deck of cards and comparison operations are performed based on the numbers.\n\nYour program should also report the stability of the output for the given input (instance). Here, 'stability of the output' means that: cards with the same value appear in the output in the same order as they do in the input (instance).\n\nInput\n\nThe first line contains an integer n, the number of cards.\n\nn cards are given in the following lines. Each card is given in a line and represented by a pair of a character and an integer separated by a single space.\n\nOutput\n\nIn the first line, print the stability (\"Stable\" or \"Not stable\") of this output.\n\nIn the following lines, print the arranged cards in the same manner of that of the input.\n\nConstraints\n\n1 ≤ n ≤ 100,000\n\n1 ≤ the number of a card ≤ 109\n\nThere are no identical card in the input\n\nSample Input 1\n\n6\nD 3\nH 2\nD 1\nS 3\nD 2\nC 1\n\nSample Output 1\n\nNot stable\nD 1\nC 1\nD 2\nH 2\nD 3\nS 3\n\nSample Input 2\n\n2\nS 1\nH 1\n\nSample Output 2\n\nStable\nS 1\nH 1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1477, "cpu_time_ms": 80, "memory_kb": 16144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s946362912", "group_id": "codeNet:p02279", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst inputs = input.trim().split('\\n');\nconst n = Number(inputs.shift());\nconst adj = inputs.map((s) => s.split(' ').map(Number));\n\nclass Node {\n constructor(id) {\n this.id = id;\n this.parentId = -1;\n this.children = [];\n }\n add(node) {\n node.parentId = this.id;\n this.children.push(node);\n }\n isRoot() {\n return this.parentId === -1;\n }\n getType() {\n return this.isRoot() ? 'root' : this.children.length ? 'internal node' : 'leaf';\n }\n calc(depth) {\n this.depth = depth++;\n this.children.forEach(child => child.calc(depth));\n }\n toString() {\n return 'node ' + this.id + ': ' + [\n 'parent = ' + this.parentId,\n 'depth = ' + this.depth,\n this.getType(),\n '[' + this.children.map(child => child.id).join(', ') + ']',\n ].join(', ');\n }\n}\n\nclass Tree {\n constructor() {\n this.map = new Map();\n }\n getNode(id) {\n this.map.has(id) || this.map.set(id, new Node(id));\n return this.map.get(id);\n }\n getRoot() {\n for (let i = 0; i < this.map.size; i++) {\n const node = this.map.get(i);\n if (node.isRoot()) {\n return node;\n }\n }\n }\n calc() {\n const root = this.getRoot();\n root.calc(0);\n }\n print() {\n for (let i = 0; i < this.map.size; i++) {\n const node = this.map.get(i);\n console.log(node.toString());\n }\n }\n}\n\nconst tree = new Tree();\nadj.forEach(([u, k, ...vk]) => {\n const parent = tree.getNode(u);\n vk.forEach(v => {\n const node = tree.getNode(v);\n parent.add(node);\n });\n});\n\ntree.calc();\ntree.print();\n\n", "language": "JavaScript", "metadata": {"date": 1519910763, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02279.html", "problem_id": "p02279", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02279/input.txt", "sample_output_relpath": "derived/input_output/data/p02279/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02279/JavaScript/s946362912.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s946362912", "user_id": "u779137493"}, "prompt_components": {"gold_output": "node 0: parent = -1, depth = 0, root, [1, 4, 10]\nnode 1: parent = 0, depth = 1, internal node, [2, 3]\nnode 2: parent = 1, depth = 2, leaf, []\nnode 3: parent = 1, depth = 2, leaf, []\nnode 4: parent = 0, depth = 1, internal node, [5, 6, 7]\nnode 5: parent = 4, depth = 2, leaf, []\nnode 6: parent = 4, depth = 2, leaf, []\nnode 7: parent = 4, depth = 2, internal node, [8, 9]\nnode 8: parent = 7, depth = 3, leaf, []\nnode 9: parent = 7, depth = 3, leaf, []\nnode 10: parent = 0, depth = 1, internal node, [11, 12]\nnode 11: parent = 10, depth = 2, leaf, []\nnode 12: parent = 10, depth = 2, leaf, []\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst inputs = input.trim().split('\\n');\nconst n = Number(inputs.shift());\nconst adj = inputs.map((s) => s.split(' ').map(Number));\n\nclass Node {\n constructor(id) {\n this.id = id;\n this.parentId = -1;\n this.children = [];\n }\n add(node) {\n node.parentId = this.id;\n this.children.push(node);\n }\n isRoot() {\n return this.parentId === -1;\n }\n getType() {\n return this.isRoot() ? 'root' : this.children.length ? 'internal node' : 'leaf';\n }\n calc(depth) {\n this.depth = depth++;\n this.children.forEach(child => child.calc(depth));\n }\n toString() {\n return 'node ' + this.id + ': ' + [\n 'parent = ' + this.parentId,\n 'depth = ' + this.depth,\n this.getType(),\n '[' + this.children.map(child => child.id).join(', ') + ']',\n ].join(', ');\n }\n}\n\nclass Tree {\n constructor() {\n this.map = new Map();\n }\n getNode(id) {\n this.map.has(id) || this.map.set(id, new Node(id));\n return this.map.get(id);\n }\n getRoot() {\n for (let i = 0; i < this.map.size; i++) {\n const node = this.map.get(i);\n if (node.isRoot()) {\n return node;\n }\n }\n }\n calc() {\n const root = this.getRoot();\n root.calc(0);\n }\n print() {\n for (let i = 0; i < this.map.size; i++) {\n const node = this.map.get(i);\n console.log(node.toString());\n }\n }\n}\n\nconst tree = new Tree();\nadj.forEach(([u, k, ...vk]) => {\n const parent = tree.getNode(u);\n vk.forEach(v => {\n const node = tree.getNode(v);\n parent.add(node);\n });\n});\n\ntree.calc();\ntree.print();\n\n", "problem_context": "Rooted Trees\n\nA graph G = (V, E) is a data structure where V is a finite set of vertices and E is a binary relation on V represented by a set of edges. Fig. 1 illustrates an example of a graph (or graphs).\n\nFig. 1\n\nA free tree is a connnected, acyclic, undirected graph. A rooted tree is a free tree in which one of the vertices is distinguished from the others. A vertex of a rooted tree is called \"node.\"\n\nYour task is to write a program which reports the following information for each node u of a given rooted tree T:\n\nnode ID of u\n\nparent of u\n\ndepth of u\n\nnode type (root, internal node or leaf)\n\na list of chidlren of u\n\nIf the last edge on the path from the root r of a tree T to a node x is (p, x), then p is the parent of x, and x is a child of p. The root is the only node in T with no parent.\n\nA node with no children is an external node or leaf. A nonleaf node is an internal node\n\nThe number of children of a node x in a rooted tree T is called the degree of x.\n\nThe length of the path from the root r to a node x is the depth of x in T.\n\nHere, the given tree consists of n nodes and evey node has a unique ID from 0 to n-1.\n\nFig. 2 shows an example of rooted trees where ID of each node is indicated by a number in a circle (node). The example corresponds to the first sample input.\n\nFig. 2\n\nInput\n\nThe first line of the input includes an integer n, the number of nodes of the tree.\n\nIn the next n lines, the information of each node u is given in the following format:\n\nid k c1 c2 ... ck\n\nwhere id is the node ID of u, k is the degree of u, c1 ... ck are node IDs of 1st, ... kth child of u. If the node does not have a child, the k is 0.\n\nOutput\n\nPrint the information of each node in the following format ordered by IDs:\n\nnode id: parent = p, depth = d, type, [c1...ck]\n\np is ID of its parent. If the node does not have a parent, print -1.\n\nd is depth of the node.\n\ntype is a type of nodes represented by a string (root, internal node or leaf). If the root can be considered as a leaf or an internal node, print root.\n\nc1...ck is the list of children as a ordered tree.\n\nPlease follow the format presented in a sample output below.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\nSample Input 1\n\n13\n0 3 1 4 10\n1 2 2 3\n2 0\n3 0\n4 3 5 6 7\n5 0\n6 0\n7 2 8 9\n8 0\n9 0\n10 2 11 12\n11 0\n12 0\n\nSample Output 1\n\nnode 0: parent = -1, depth = 0, root, [1, 4, 10]\nnode 1: parent = 0, depth = 1, internal node, [2, 3]\nnode 2: parent = 1, depth = 2, leaf, []\nnode 3: parent = 1, depth = 2, leaf, []\nnode 4: parent = 0, depth = 1, internal node, [5, 6, 7]\nnode 5: parent = 4, depth = 2, leaf, []\nnode 6: parent = 4, depth = 2, leaf, []\nnode 7: parent = 4, depth = 2, internal node, [8, 9]\nnode 8: parent = 7, depth = 3, leaf, []\nnode 9: parent = 7, depth = 3, leaf, []\nnode 10: parent = 0, depth = 1, internal node, [11, 12]\nnode 11: parent = 10, depth = 2, leaf, []\nnode 12: parent = 10, depth = 2, leaf, []\n\nSample Input 2\n\n4\n1 3 3 2 0\n0 0\n3 0\n2 0\n\nSample Output 2\n\nnode 0: parent = 1, depth = 1, leaf, []\nnode 1: parent = -1, depth = 0, root, [3, 2, 0]\nnode 2: parent = 1, depth = 1, leaf, []\nnode 3: parent = 1, depth = 1, leaf, []\n\nNote\n\nYou can use a left-child, right-sibling representation to implement a tree which has the following data:\n\nthe parent of u\n\nthe leftmost child of u\n\nthe immediate right sibling of u\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "13\n0 3 1 4 10\n1 2 2 3\n2 0\n3 0\n4 3 5 6 7\n5 0\n6 0\n7 2 8 9\n8 0\n9 0\n10 2 11 12\n11 0\n12 0\n"}, "reference_outputs": ["node 0: parent = -1, depth = 0, root, [1, 4, 10]\nnode 1: parent = 0, depth = 1, internal node, [2, 3]\nnode 2: parent = 1, depth = 2, leaf, []\nnode 3: parent = 1, depth = 2, leaf, []\nnode 4: parent = 0, depth = 1, internal node, [5, 6, 7]\nnode 5: parent = 4, depth = 2, leaf, []\nnode 6: parent = 4, depth = 2, leaf, []\nnode 7: parent = 4, depth = 2, internal node, [8, 9]\nnode 8: parent = 7, depth = 3, leaf, []\nnode 9: parent = 7, depth = 3, leaf, []\nnode 10: parent = 0, depth = 1, internal node, [11, 12]\nnode 11: parent = 10, depth = 2, leaf, []\nnode 12: parent = 10, depth = 2, leaf, []\n"], "source_document_id": "p02279", "source_text": "Rooted Trees\n\nA graph G = (V, E) is a data structure where V is a finite set of vertices and E is a binary relation on V represented by a set of edges. Fig. 1 illustrates an example of a graph (or graphs).\n\nFig. 1\n\nA free tree is a connnected, acyclic, undirected graph. A rooted tree is a free tree in which one of the vertices is distinguished from the others. A vertex of a rooted tree is called \"node.\"\n\nYour task is to write a program which reports the following information for each node u of a given rooted tree T:\n\nnode ID of u\n\nparent of u\n\ndepth of u\n\nnode type (root, internal node or leaf)\n\na list of chidlren of u\n\nIf the last edge on the path from the root r of a tree T to a node x is (p, x), then p is the parent of x, and x is a child of p. The root is the only node in T with no parent.\n\nA node with no children is an external node or leaf. A nonleaf node is an internal node\n\nThe number of children of a node x in a rooted tree T is called the degree of x.\n\nThe length of the path from the root r to a node x is the depth of x in T.\n\nHere, the given tree consists of n nodes and evey node has a unique ID from 0 to n-1.\n\nFig. 2 shows an example of rooted trees where ID of each node is indicated by a number in a circle (node). The example corresponds to the first sample input.\n\nFig. 2\n\nInput\n\nThe first line of the input includes an integer n, the number of nodes of the tree.\n\nIn the next n lines, the information of each node u is given in the following format:\n\nid k c1 c2 ... ck\n\nwhere id is the node ID of u, k is the degree of u, c1 ... ck are node IDs of 1st, ... kth child of u. If the node does not have a child, the k is 0.\n\nOutput\n\nPrint the information of each node in the following format ordered by IDs:\n\nnode id: parent = p, depth = d, type, [c1...ck]\n\np is ID of its parent. If the node does not have a parent, print -1.\n\nd is depth of the node.\n\ntype is a type of nodes represented by a string (root, internal node or leaf). If the root can be considered as a leaf or an internal node, print root.\n\nc1...ck is the list of children as a ordered tree.\n\nPlease follow the format presented in a sample output below.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\nSample Input 1\n\n13\n0 3 1 4 10\n1 2 2 3\n2 0\n3 0\n4 3 5 6 7\n5 0\n6 0\n7 2 8 9\n8 0\n9 0\n10 2 11 12\n11 0\n12 0\n\nSample Output 1\n\nnode 0: parent = -1, depth = 0, root, [1, 4, 10]\nnode 1: parent = 0, depth = 1, internal node, [2, 3]\nnode 2: parent = 1, depth = 2, leaf, []\nnode 3: parent = 1, depth = 2, leaf, []\nnode 4: parent = 0, depth = 1, internal node, [5, 6, 7]\nnode 5: parent = 4, depth = 2, leaf, []\nnode 6: parent = 4, depth = 2, leaf, []\nnode 7: parent = 4, depth = 2, internal node, [8, 9]\nnode 8: parent = 7, depth = 3, leaf, []\nnode 9: parent = 7, depth = 3, leaf, []\nnode 10: parent = 0, depth = 1, internal node, [11, 12]\nnode 11: parent = 10, depth = 2, leaf, []\nnode 12: parent = 10, depth = 2, leaf, []\n\nSample Input 2\n\n4\n1 3 3 2 0\n0 0\n3 0\n2 0\n\nSample Output 2\n\nnode 0: parent = 1, depth = 1, leaf, []\nnode 1: parent = -1, depth = 0, root, [3, 2, 0]\nnode 2: parent = 1, depth = 1, leaf, []\nnode 3: parent = 1, depth = 1, leaf, []\n\nNote\n\nYou can use a left-child, right-sibling representation to implement a tree which has the following data:\n\nthe parent of u\n\nthe leftmost child of u\n\nthe immediate right sibling of u\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1611, "cpu_time_ms": 1610, "memory_kb": 111572}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s176913021", "group_id": "codeNet:p02280", "input_text": "let inputString = '';\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\nprocess.stdin.on('end', function() {\n const input = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n printNodes(Number(input.shift()), input);\n});\n\n\n\nconst printNodes = (size, nodeInfoArr) => {\n const nodeArr = Array\n .from({ length: size }, generateInitialValue);\n const rootCandidates = {};\n for (let i=0; i Number(s));\n\n let type = 'leaf';\n\n if (leftChild !== -1) {\n type = 'internal node';\n nodeArr[id].degree++;\n nodeArr[leftChild].parent = id;\n nodeArr[leftChild].sibling = rightChild;\n delete rootCandidates[leftChild];\n }\n\n if (rightChild !== -1) {\n type = 'internal node';\n nodeArr[id].degree++;\n nodeArr[rightChild].parent = id;\n nodeArr[rightChild].sibling = leftChild;\n delete rootCandidates[rightChild];\n }\n\n nodeArr[id].leftChild = leftChild;\n nodeArr[id].rightChild = rightChild;\n nodeArr[id].type = type;\n\n if (nodeArr[id].parent === -1) {\n rootCandidates[id] = true;\n } else {\n delete rootCandidates[id];\n }\n\n // console.log(`i: ${i}, ${JSON.stringify(nodeArr[id])}`);\n }\n\n // console.log(Object.keys(rootCandidates));\n const rootId = Object.keys(rootCandidates)[0];\n nodeArr[rootId].type = 'root';\n\n fillDepth(rootId, nodeArr);\n\n fillHeight(nodeArr);\n\n nodeArr.forEach(printNode);\n};\n\nconst generateInitialValue = (_, index) => {\n return {\n id: index,\n leftChild: -1,\n rightChild: -1,\n parent: -1,\n sibling: -1,\n degree: 0,\n depth: 0,\n height: 0,\n type: 'leaf',\n };\n};\n\nconst fillDepth = (id, nodeArr, depth = 0) => {\n nodeArr[id].depth = depth;\n const {\n leftChild,\n rightChild,\n } = nodeArr[id];\n if (leftChild !== -1) {\n fillDepth(leftChild, nodeArr, depth + 1);\n }\n if (rightChild !== -1) {\n fillDepth(rightChild, nodeArr, depth + 1);\n }\n};\n\nconst fillHeight = (nodeArr) => {\n for (let i=0; i {\n const {\n leftChild,\n rightChild,\n } = nodeArr[id];\n\n let leftHeight = 0;\n if (leftChild !== -1) {\n leftHeight = getHeight(leftChild, nodeArr) + 1;\n }\n\n let rightHeight = 0;\n if (rightChild !== -1) {\n rightHeight = getHeight(rightChild, nodeArr) + 1;\n }\n\n return Math.max(leftHeight, rightHeight);\n};\n\nconst printNode = (node) => {\n console.log(`node ${node.id}: parent = ${node.parent}, sibling = ${node.sibling}, degree = ${node.degree}, depth = ${node.depth}, height = ${node.height}, ${node.type}`);\n};\n", "language": "JavaScript", "metadata": {"date": 1592543830, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02280.html", "problem_id": "p02280", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02280/input.txt", "sample_output_relpath": "derived/input_output/data/p02280/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02280/JavaScript/s176913021.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s176913021", "user_id": "u650092890"}, "prompt_components": {"gold_output": "node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n", "input_to_evaluate": "let inputString = '';\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\nprocess.stdin.on('end', function() {\n const input = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n printNodes(Number(input.shift()), input);\n});\n\n\n\nconst printNodes = (size, nodeInfoArr) => {\n const nodeArr = Array\n .from({ length: size }, generateInitialValue);\n const rootCandidates = {};\n for (let i=0; i Number(s));\n\n let type = 'leaf';\n\n if (leftChild !== -1) {\n type = 'internal node';\n nodeArr[id].degree++;\n nodeArr[leftChild].parent = id;\n nodeArr[leftChild].sibling = rightChild;\n delete rootCandidates[leftChild];\n }\n\n if (rightChild !== -1) {\n type = 'internal node';\n nodeArr[id].degree++;\n nodeArr[rightChild].parent = id;\n nodeArr[rightChild].sibling = leftChild;\n delete rootCandidates[rightChild];\n }\n\n nodeArr[id].leftChild = leftChild;\n nodeArr[id].rightChild = rightChild;\n nodeArr[id].type = type;\n\n if (nodeArr[id].parent === -1) {\n rootCandidates[id] = true;\n } else {\n delete rootCandidates[id];\n }\n\n // console.log(`i: ${i}, ${JSON.stringify(nodeArr[id])}`);\n }\n\n // console.log(Object.keys(rootCandidates));\n const rootId = Object.keys(rootCandidates)[0];\n nodeArr[rootId].type = 'root';\n\n fillDepth(rootId, nodeArr);\n\n fillHeight(nodeArr);\n\n nodeArr.forEach(printNode);\n};\n\nconst generateInitialValue = (_, index) => {\n return {\n id: index,\n leftChild: -1,\n rightChild: -1,\n parent: -1,\n sibling: -1,\n degree: 0,\n depth: 0,\n height: 0,\n type: 'leaf',\n };\n};\n\nconst fillDepth = (id, nodeArr, depth = 0) => {\n nodeArr[id].depth = depth;\n const {\n leftChild,\n rightChild,\n } = nodeArr[id];\n if (leftChild !== -1) {\n fillDepth(leftChild, nodeArr, depth + 1);\n }\n if (rightChild !== -1) {\n fillDepth(rightChild, nodeArr, depth + 1);\n }\n};\n\nconst fillHeight = (nodeArr) => {\n for (let i=0; i {\n const {\n leftChild,\n rightChild,\n } = nodeArr[id];\n\n let leftHeight = 0;\n if (leftChild !== -1) {\n leftHeight = getHeight(leftChild, nodeArr) + 1;\n }\n\n let rightHeight = 0;\n if (rightChild !== -1) {\n rightHeight = getHeight(rightChild, nodeArr) + 1;\n }\n\n return Math.max(leftHeight, rightHeight);\n};\n\nconst printNode = (node) => {\n console.log(`node ${node.id}: parent = ${node.parent}, sibling = ${node.sibling}, degree = ${node.degree}, depth = ${node.depth}, height = ${node.height}, ${node.type}`);\n};\n", "problem_context": "Binary Tree\n\nA rooted binary tree is a tree with a root node in which every node has at most two children.\n\nYour task is to write a program which reads a rooted binary tree T and prints the following information for each node u of T:\n\nnode ID of u\n\nparent of u\n\nsibling of u\n\nthe number of children of u\n\ndepth of u\n\nheight of u\n\nnode type (root, internal node or leaf)\n\nIf two nodes have the same parent, they are siblings. Here, if u and v have the same parent, we say u is a sibling of v (vice versa).\n\nThe height of a node in a tree is the number of edges on the longest simple downward path from the node to a leaf.\n\nHere, the given binary tree consists of n nodes and evey node has a unique ID from 0 to n-1.\n\nInput\n\nThe first line of the input includes an integer n, the number of nodes of the tree.\n\nIn the next n lines, the information of each node is given in the following format:\n\nid left right\n\nid is the node ID, left is ID of the left child and right is ID of the right child. If the node does not have the left (right) child, the left(right) is indicated by -1.\n\nOutput\n\nPrint the information of each node in the following format:\n\nnode id: parent = p, sibling = s, degree = deg, depth = dep, height = h, type\n\np is ID of its parent. If the node does not have a parent, print -1.\n\ns is ID of its sibling. If the node does not have a sibling, print -1.\n\ndeg, dep and h are the number of children, depth and height of the node respectively.\n\ntype is a type of nodes represented by a string (root, internal node or leaf. If the root can be considered as a leaf or an internal node, print root.\n\nPlease follow the format presented in a sample output below.\n\nConstraints\n\n1 ≤ n ≤ 25\n\nSample Input 1\n\n9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n\nSample Output 1\n\nnode 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n"}, "reference_outputs": ["node 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n"], "source_document_id": "p02280", "source_text": "Binary Tree\n\nA rooted binary tree is a tree with a root node in which every node has at most two children.\n\nYour task is to write a program which reads a rooted binary tree T and prints the following information for each node u of T:\n\nnode ID of u\n\nparent of u\n\nsibling of u\n\nthe number of children of u\n\ndepth of u\n\nheight of u\n\nnode type (root, internal node or leaf)\n\nIf two nodes have the same parent, they are siblings. Here, if u and v have the same parent, we say u is a sibling of v (vice versa).\n\nThe height of a node in a tree is the number of edges on the longest simple downward path from the node to a leaf.\n\nHere, the given binary tree consists of n nodes and evey node has a unique ID from 0 to n-1.\n\nInput\n\nThe first line of the input includes an integer n, the number of nodes of the tree.\n\nIn the next n lines, the information of each node is given in the following format:\n\nid left right\n\nid is the node ID, left is ID of the left child and right is ID of the right child. If the node does not have the left (right) child, the left(right) is indicated by -1.\n\nOutput\n\nPrint the information of each node in the following format:\n\nnode id: parent = p, sibling = s, degree = deg, depth = dep, height = h, type\n\np is ID of its parent. If the node does not have a parent, print -1.\n\ns is ID of its sibling. If the node does not have a sibling, print -1.\n\ndeg, dep and h are the number of children, depth and height of the node respectively.\n\ntype is a type of nodes represented by a string (root, internal node or leaf. If the root can be considered as a leaf or an internal node, print root.\n\nPlease follow the format presented in a sample output below.\n\nConstraints\n\n1 ≤ n ≤ 25\n\nSample Input 1\n\n9\n0 1 4\n1 2 3\n2 -1 -1\n3 -1 -1\n4 5 8\n5 6 7\n6 -1 -1\n7 -1 -1\n8 -1 -1\n\nSample Output 1\n\nnode 0: parent = -1, sibling = -1, degree = 2, depth = 0, height = 3, root\nnode 1: parent = 0, sibling = 4, degree = 2, depth = 1, height = 1, internal node\nnode 2: parent = 1, sibling = 3, degree = 0, depth = 2, height = 0, leaf\nnode 3: parent = 1, sibling = 2, degree = 0, depth = 2, height = 0, leaf\nnode 4: parent = 0, sibling = 1, degree = 2, depth = 1, height = 2, internal node\nnode 5: parent = 4, sibling = 8, degree = 2, depth = 2, height = 1, internal node\nnode 6: parent = 5, sibling = 7, degree = 0, depth = 3, height = 0, leaf\nnode 7: parent = 5, sibling = 6, degree = 0, depth = 3, height = 0, leaf\nnode 8: parent = 4, sibling = 5, degree = 0, depth = 2, height = 0, leaf\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2835, "cpu_time_ms": 80, "memory_kb": 16360}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s630103195", "group_id": "codeNet:p02283", "input_text": "class _Node {\n constructor(key, parent = null, left = null, right = null) {\n this.key = key;\n this.parent = parent;\n this.left = left;\n this.right = right;\n }\n}\n\nclass BinaryTree {\n constructor() {\n this.root = null;\n }\n\n static get Node() { return _Node; }\n\n insert(key) {\n this.root = new BinaryTree.Node(key, null, null, null);\n this.insert = (key) => {\n let x = this.root, y;\n let newNode = new BinaryTree.Node(key, null, null, null);\n while (x !== null) {\n y = x;\n x = x[key < x.key ? 'left' : 'right'];\n }\n newNode.parent = y;\n y[key < y.key ? 'left' : 'right'] = newNode;\n }\n }\n\n printByIneorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n innerFunc(n.left);\n str += ` ${n.key}`;\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n printByPreorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n str += ` ${n.key}`;\n innerFunc(n.left);\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n print() {\n this.printByIneorder();\n this.printByPreorder();\n }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const tree = new BinaryTree();\n lines.map((line) => line.split(' ')).forEach(function(cmd) {\n switch(cmd[0].charAt(0)) {\n case 'i': tree.insert(Number(cmd[1])); break;\n default: tree.print();\n }\n });\n})();\n\n", "language": "JavaScript", "metadata": {"date": 1531197623, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02283.html", "problem_id": "p02283", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02283/input.txt", "sample_output_relpath": "derived/input_output/data/p02283/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02283/JavaScript/s630103195.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s630103195", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n", "input_to_evaluate": "class _Node {\n constructor(key, parent = null, left = null, right = null) {\n this.key = key;\n this.parent = parent;\n this.left = left;\n this.right = right;\n }\n}\n\nclass BinaryTree {\n constructor() {\n this.root = null;\n }\n\n static get Node() { return _Node; }\n\n insert(key) {\n this.root = new BinaryTree.Node(key, null, null, null);\n this.insert = (key) => {\n let x = this.root, y;\n let newNode = new BinaryTree.Node(key, null, null, null);\n while (x !== null) {\n y = x;\n x = x[key < x.key ? 'left' : 'right'];\n }\n newNode.parent = y;\n y[key < y.key ? 'left' : 'right'] = newNode;\n }\n }\n\n printByIneorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n innerFunc(n.left);\n str += ` ${n.key}`;\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n printByPreorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n str += ` ${n.key}`;\n innerFunc(n.left);\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n print() {\n this.printByIneorder();\n this.printByPreorder();\n }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const tree = new BinaryTree();\n lines.map((line) => line.split(' ')).forEach(function(cmd) {\n switch(cmd[0].charAt(0)) {\n case 'i': tree.insert(Number(cmd[1])); break;\n default: tree.print();\n }\n });\n})();\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nBinary Search Tree I\n\nSearch trees are data structures that support dynamic set operations including insert, search, delete and so on. Thus a search tree can be used both as a dictionary and as a priority queue.\n\nBinary search tree is one of fundamental search trees. The keys in a binary search tree are always stored in such a way as to satisfy the following binary search tree property:\n\nLet $x$ be a node in a binary search tree. If $y$ is a node in the left subtree of $x$, then $y.key \\leq x.key$. If $y$ is a node in the right subtree of $x$, then $x.key \\leq y.key$.\n\nThe following figure shows an example of the binary search tree.\n\nFor example, keys of nodes which belong to the left sub-tree of the node containing 80 are less than or equal to 80, and keys of nodes which belong to the right sub-tree are more than or equal to 80. The binary search tree property allows us to print out all the keys in the tree in sorted order by an inorder tree walk.\n\nA binary search tree should be implemented in such a way that the binary search tree property continues to hold after modifications by insertions and deletions. A binary search tree can be represented by a linked data structure in which each node is an object. In addition to a key field and satellite data, each node contains fields left, right, and p that point to the nodes corresponding to its left child, its right child, and its parent, respectively.\n\nTo insert a new value $v$ into a binary search tree $T$, we can use the procedure insert as shown in the following pseudo code. The insert procedure is passed a node $z$ for which $z.key = v$, $z.left = NIL$, and $z.right = NIL$. The procedure modifies $T$ and some of the fields of $z$ in such a way that $z$ is inserted into an appropriate position in the tree.\n\n1 insert(T, z)\n2 y = NIL // parent of x\n3 x = 'the root of T'\n4 while x ≠ NIL\n5 y = x // set the parent\n6 if z.key < x.key\n7 x = x.left // move to the left child\n8 else\n9 x = x.right // move to the right child\n10 z.p = y\n11\n12 if y == NIL // T is empty\n13 'the root of T' = z\n14 else if z.key < y.key\n15 y.left = z // z is the left child of y\n16 else\n17 y.right = z // z is the right child of y\n\nWrite a program which performs the following operations to a binary search tree $T$.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nYou should use the above pseudo code to implement the insert operation. $T$ is empty at the initial state.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$ or print are given.\n\nOutput\n\nFor each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key.\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n\nSample Output 1\n\n1 12 17 20 25 30 88\n30 12 1 20 17 25 88\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n"}, "reference_outputs": [" 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n"], "source_document_id": "p02283", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nBinary Search Tree I\n\nSearch trees are data structures that support dynamic set operations including insert, search, delete and so on. Thus a search tree can be used both as a dictionary and as a priority queue.\n\nBinary search tree is one of fundamental search trees. The keys in a binary search tree are always stored in such a way as to satisfy the following binary search tree property:\n\nLet $x$ be a node in a binary search tree. If $y$ is a node in the left subtree of $x$, then $y.key \\leq x.key$. If $y$ is a node in the right subtree of $x$, then $x.key \\leq y.key$.\n\nThe following figure shows an example of the binary search tree.\n\nFor example, keys of nodes which belong to the left sub-tree of the node containing 80 are less than or equal to 80, and keys of nodes which belong to the right sub-tree are more than or equal to 80. The binary search tree property allows us to print out all the keys in the tree in sorted order by an inorder tree walk.\n\nA binary search tree should be implemented in such a way that the binary search tree property continues to hold after modifications by insertions and deletions. A binary search tree can be represented by a linked data structure in which each node is an object. In addition to a key field and satellite data, each node contains fields left, right, and p that point to the nodes corresponding to its left child, its right child, and its parent, respectively.\n\nTo insert a new value $v$ into a binary search tree $T$, we can use the procedure insert as shown in the following pseudo code. The insert procedure is passed a node $z$ for which $z.key = v$, $z.left = NIL$, and $z.right = NIL$. The procedure modifies $T$ and some of the fields of $z$ in such a way that $z$ is inserted into an appropriate position in the tree.\n\n1 insert(T, z)\n2 y = NIL // parent of x\n3 x = 'the root of T'\n4 while x ≠ NIL\n5 y = x // set the parent\n6 if z.key < x.key\n7 x = x.left // move to the left child\n8 else\n9 x = x.right // move to the right child\n10 z.p = y\n11\n12 if y == NIL // T is empty\n13 'the root of T' = z\n14 else if z.key < y.key\n15 y.left = z // z is the left child of y\n16 else\n17 y.right = z // z is the right child of y\n\nWrite a program which performs the following operations to a binary search tree $T$.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nYou should use the above pseudo code to implement the insert operation. $T$ is empty at the initial state.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$ or print are given.\n\nOutput\n\nFor each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key.\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n\nSample Output 1\n\n1 12 17 20 25 30 88\n30 12 1 20 17 25 88\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1572, "cpu_time_ms": 1600, "memory_kb": 270724}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s588733399", "group_id": "codeNet:p02283", "input_text": "class _Node {\n constructor(key, left = null, right = null) {\n this.key = key;\n this.left = left;\n this.right = right;\n }\n}\n\nclass BinaryTree {\n constructor() {\n this.root = null;\n }\n\n static get Node() { return _Node; }\n\n insert(key) {\n this.root = new BinaryTree.Node(key, null, null);\n this.insert = (key) => {\n let x = this.root, y;\n let newNode = new BinaryTree.Node(key, null, null);\n while (x !== null) {\n y = x;\n x = x[key < x.key ? 'left' : 'right'];\n }\n y[key < y.key ? 'left' : 'right'] = newNode;\n }\n }\n\n printByIneorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n innerFunc(n.left);\n str += ` ${n.key}`;\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n printByPreorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n str += ` ${n.key}`;\n innerFunc(n.left);\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n print() {\n this.printByIneorder();\n this.printByPreorder();\n }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const tree = new BinaryTree();\n lines.forEach(function(cmd) {\n switch(cmd.charAt(0)) {\n case 'i': tree.insert(Number(cmd.split(' ')[1])); break;\n default: tree.print();\n }\n });\n})();\n\n", "language": "JavaScript", "metadata": {"date": 1531197932, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02283.html", "problem_id": "p02283", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02283/input.txt", "sample_output_relpath": "derived/input_output/data/p02283/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02283/JavaScript/s588733399.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s588733399", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n", "input_to_evaluate": "class _Node {\n constructor(key, left = null, right = null) {\n this.key = key;\n this.left = left;\n this.right = right;\n }\n}\n\nclass BinaryTree {\n constructor() {\n this.root = null;\n }\n\n static get Node() { return _Node; }\n\n insert(key) {\n this.root = new BinaryTree.Node(key, null, null);\n this.insert = (key) => {\n let x = this.root, y;\n let newNode = new BinaryTree.Node(key, null, null);\n while (x !== null) {\n y = x;\n x = x[key < x.key ? 'left' : 'right'];\n }\n y[key < y.key ? 'left' : 'right'] = newNode;\n }\n }\n\n printByIneorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n innerFunc(n.left);\n str += ` ${n.key}`;\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n printByPreorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n str += ` ${n.key}`;\n innerFunc(n.left);\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n print() {\n this.printByIneorder();\n this.printByPreorder();\n }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const tree = new BinaryTree();\n lines.forEach(function(cmd) {\n switch(cmd.charAt(0)) {\n case 'i': tree.insert(Number(cmd.split(' ')[1])); break;\n default: tree.print();\n }\n });\n})();\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nBinary Search Tree I\n\nSearch trees are data structures that support dynamic set operations including insert, search, delete and so on. Thus a search tree can be used both as a dictionary and as a priority queue.\n\nBinary search tree is one of fundamental search trees. The keys in a binary search tree are always stored in such a way as to satisfy the following binary search tree property:\n\nLet $x$ be a node in a binary search tree. If $y$ is a node in the left subtree of $x$, then $y.key \\leq x.key$. If $y$ is a node in the right subtree of $x$, then $x.key \\leq y.key$.\n\nThe following figure shows an example of the binary search tree.\n\nFor example, keys of nodes which belong to the left sub-tree of the node containing 80 are less than or equal to 80, and keys of nodes which belong to the right sub-tree are more than or equal to 80. The binary search tree property allows us to print out all the keys in the tree in sorted order by an inorder tree walk.\n\nA binary search tree should be implemented in such a way that the binary search tree property continues to hold after modifications by insertions and deletions. A binary search tree can be represented by a linked data structure in which each node is an object. In addition to a key field and satellite data, each node contains fields left, right, and p that point to the nodes corresponding to its left child, its right child, and its parent, respectively.\n\nTo insert a new value $v$ into a binary search tree $T$, we can use the procedure insert as shown in the following pseudo code. The insert procedure is passed a node $z$ for which $z.key = v$, $z.left = NIL$, and $z.right = NIL$. The procedure modifies $T$ and some of the fields of $z$ in such a way that $z$ is inserted into an appropriate position in the tree.\n\n1 insert(T, z)\n2 y = NIL // parent of x\n3 x = 'the root of T'\n4 while x ≠ NIL\n5 y = x // set the parent\n6 if z.key < x.key\n7 x = x.left // move to the left child\n8 else\n9 x = x.right // move to the right child\n10 z.p = y\n11\n12 if y == NIL // T is empty\n13 'the root of T' = z\n14 else if z.key < y.key\n15 y.left = z // z is the left child of y\n16 else\n17 y.right = z // z is the right child of y\n\nWrite a program which performs the following operations to a binary search tree $T$.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nYou should use the above pseudo code to implement the insert operation. $T$ is empty at the initial state.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$ or print are given.\n\nOutput\n\nFor each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key.\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n\nSample Output 1\n\n1 12 17 20 25 30 88\n30 12 1 20 17 25 88\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n"}, "reference_outputs": [" 1 12 17 20 25 30 88\n 30 12 1 20 17 25 88\n"], "source_document_id": "p02283", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nBinary Search Tree I\n\nSearch trees are data structures that support dynamic set operations including insert, search, delete and so on. Thus a search tree can be used both as a dictionary and as a priority queue.\n\nBinary search tree is one of fundamental search trees. The keys in a binary search tree are always stored in such a way as to satisfy the following binary search tree property:\n\nLet $x$ be a node in a binary search tree. If $y$ is a node in the left subtree of $x$, then $y.key \\leq x.key$. If $y$ is a node in the right subtree of $x$, then $x.key \\leq y.key$.\n\nThe following figure shows an example of the binary search tree.\n\nFor example, keys of nodes which belong to the left sub-tree of the node containing 80 are less than or equal to 80, and keys of nodes which belong to the right sub-tree are more than or equal to 80. The binary search tree property allows us to print out all the keys in the tree in sorted order by an inorder tree walk.\n\nA binary search tree should be implemented in such a way that the binary search tree property continues to hold after modifications by insertions and deletions. A binary search tree can be represented by a linked data structure in which each node is an object. In addition to a key field and satellite data, each node contains fields left, right, and p that point to the nodes corresponding to its left child, its right child, and its parent, respectively.\n\nTo insert a new value $v$ into a binary search tree $T$, we can use the procedure insert as shown in the following pseudo code. The insert procedure is passed a node $z$ for which $z.key = v$, $z.left = NIL$, and $z.right = NIL$. The procedure modifies $T$ and some of the fields of $z$ in such a way that $z$ is inserted into an appropriate position in the tree.\n\n1 insert(T, z)\n2 y = NIL // parent of x\n3 x = 'the root of T'\n4 while x ≠ NIL\n5 y = x // set the parent\n6 if z.key < x.key\n7 x = x.left // move to the left child\n8 else\n9 x = x.right // move to the right child\n10 z.p = y\n11\n12 if y == NIL // T is empty\n13 'the root of T' = z\n14 else if z.key < y.key\n15 y.left = z // z is the left child of y\n16 else\n17 y.right = z // z is the right child of y\n\nWrite a program which performs the following operations to a binary search tree $T$.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nYou should use the above pseudo code to implement the insert operation. $T$ is empty at the initial state.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$ or print are given.\n\nOutput\n\nFor each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key.\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n8\ninsert 30\ninsert 88\ninsert 12\ninsert 1\ninsert 20\ninsert 17\ninsert 25\nprint\n\nSample Output 1\n\n1 12 17 20 25 30 88\n30 12 1 20 17 25 88\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1470, "cpu_time_ms": 1030, "memory_kb": 197584}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s749857629", "group_id": "codeNet:p02285", "input_text": "class _Node {\n constructor(key, parent = null, left = null, right = null) {\n this.key = key;\n this.parent = parent;\n this.left = left;\n this.right = right;\n }\n\n getChildrenNumber() {return Number(this.left !== null) + Number(this.right !== null);}\n\n isLeftChild() {\n if (this.parent === null) return null;\n return this.parent.left === this;\n }\n\n getLeftOrRight() {return this.isLeftChild() ? 'left' : 'right';}\n\n getSuccessor() {\n let n;\n if (this.right !== null) {\n n = this.right;\n while (n.left !== null) n = n.left;\n } else {\n n = this.parent;\n while (!n.isLeftChild && n.parent != null) n = n.parent;\n }\n return n;\n }\n}\n\nclass BinaryTree {\n constructor() {\n this.root = null;\n }\n\n static get Node() { return _Node; }\n\n // insert(key) {\n // if (this.root === null) {\n // this.root = new BinaryTree.Node(key);\n // return;\n // }\n // let x = this.root, y;\n // let newNode = new BinaryTree.Node(key);\n // while (x !== null) {\n // y = x;\n // x = x[key < x.key ? 'left' : 'right'];\n // }\n // newNode.parent = y;\n // y[key < y.key ? 'left' : 'right'] = newNode;\n // }\n insert(key) {\n this.root = new BinaryTree.Node(key);\n this.insert = (key) => {\n let x = this.root, y;\n let newNode = new BinaryTree.Node(key);\n while (x !== null) {\n y = x;\n x = x[key < x.key ? 'left' : 'right'];\n }\n newNode.parent = y;\n y[key < y.key ? 'left' : 'right'] = newNode;\n }\n }\n\n\n find(key, n = this.root) {\n if (n === null || n.key === key) return n;\n return this.find(key, n[key < n.key ? 'left' : 'right']);\n }\n\n delete(key) {\n const n = this.find(key);\n if (n === null) return;\n let leftOrRight = n.getLeftOrRight();\n switch (n.getChildrenNumber()) {\n case 0:\n n.parent[leftOrRight] = null;\n break;\n case 1:\n n.parent[leftOrRight] = n.left || n.right;\n n.parent[leftOrRight].parent = n.parent;\n break;\n default:\n let skey = n.getSuccessor().key;\n this.delete(skey);\n n.key = skey;\n }\n }\n\n printByIneorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n innerFunc(n.left);\n str += ` ${n.key}`;\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n printByPreorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n str += ` ${n.key}`;\n innerFunc(n.left);\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n print() {\n this.printByIneorder();\n this.printByPreorder();\n }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const tree = new BinaryTree();\n lines.forEach(function(cmd) {\n switch (cmd.charAt(0)) {\n case 'i': tree.insert(Number(cmd.split(' ')[1])); break;\n case 'f': console.log(tree.find(Number(cmd.split(' ')[1])) ? 'yes' : 'no'); break;\n case 'd': tree.delete(Number(cmd.split(' ')[1])); break;\n default: tree.print();\n }\n });\n})();\n\n", "language": "JavaScript", "metadata": {"date": 1531248078, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02285.html", "problem_id": "p02285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02285/input.txt", "sample_output_relpath": "derived/input_output/data/p02285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02285/JavaScript/s749857629.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s749857629", "user_id": "u298224238"}, "prompt_components": {"gold_output": "yes\nyes\nyes\nno\nno\nno\nyes\nyes\n 1 2 3 7 8 22\n 8 2 1 3 7 22\n 1 2 8 22\n 8 2 1 22\n", "input_to_evaluate": "class _Node {\n constructor(key, parent = null, left = null, right = null) {\n this.key = key;\n this.parent = parent;\n this.left = left;\n this.right = right;\n }\n\n getChildrenNumber() {return Number(this.left !== null) + Number(this.right !== null);}\n\n isLeftChild() {\n if (this.parent === null) return null;\n return this.parent.left === this;\n }\n\n getLeftOrRight() {return this.isLeftChild() ? 'left' : 'right';}\n\n getSuccessor() {\n let n;\n if (this.right !== null) {\n n = this.right;\n while (n.left !== null) n = n.left;\n } else {\n n = this.parent;\n while (!n.isLeftChild && n.parent != null) n = n.parent;\n }\n return n;\n }\n}\n\nclass BinaryTree {\n constructor() {\n this.root = null;\n }\n\n static get Node() { return _Node; }\n\n // insert(key) {\n // if (this.root === null) {\n // this.root = new BinaryTree.Node(key);\n // return;\n // }\n // let x = this.root, y;\n // let newNode = new BinaryTree.Node(key);\n // while (x !== null) {\n // y = x;\n // x = x[key < x.key ? 'left' : 'right'];\n // }\n // newNode.parent = y;\n // y[key < y.key ? 'left' : 'right'] = newNode;\n // }\n insert(key) {\n this.root = new BinaryTree.Node(key);\n this.insert = (key) => {\n let x = this.root, y;\n let newNode = new BinaryTree.Node(key);\n while (x !== null) {\n y = x;\n x = x[key < x.key ? 'left' : 'right'];\n }\n newNode.parent = y;\n y[key < y.key ? 'left' : 'right'] = newNode;\n }\n }\n\n\n find(key, n = this.root) {\n if (n === null || n.key === key) return n;\n return this.find(key, n[key < n.key ? 'left' : 'right']);\n }\n\n delete(key) {\n const n = this.find(key);\n if (n === null) return;\n let leftOrRight = n.getLeftOrRight();\n switch (n.getChildrenNumber()) {\n case 0:\n n.parent[leftOrRight] = null;\n break;\n case 1:\n n.parent[leftOrRight] = n.left || n.right;\n n.parent[leftOrRight].parent = n.parent;\n break;\n default:\n let skey = n.getSuccessor().key;\n this.delete(skey);\n n.key = skey;\n }\n }\n\n printByIneorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n innerFunc(n.left);\n str += ` ${n.key}`;\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n printByPreorder() {\n let str = '';\n const innerFunc = (n) => {\n if (n === null) return;\n str += ` ${n.key}`;\n innerFunc(n.left);\n innerFunc(n.right);\n }\n innerFunc(this.root);\n console.log(str);\n }\n\n print() {\n this.printByIneorder();\n this.printByPreorder();\n }\n}\n\n(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n\n const tree = new BinaryTree();\n lines.forEach(function(cmd) {\n switch (cmd.charAt(0)) {\n case 'i': tree.insert(Number(cmd.split(' ')[1])); break;\n case 'f': console.log(tree.find(Number(cmd.split(' ')[1])) ? 'yes' : 'no'); break;\n case 'd': tree.delete(Number(cmd.split(' ')[1])); break;\n default: tree.print();\n }\n });\n})();\n\n", "problem_context": "Binary Search Tree III\n\nWrite a program which performs the following operations to a binary search tree $T$ by adding delete operation to B: Binary Search Tree II.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nfind $k$: Report whether $T$ has a node containing $k$.\n\ndelete $k$: Delete a node containing $k$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nThe operation delete $k$ for deleting a given node $z$ containing key $k$ from $T$ can be implemented by an algorithm which considers the following cases:\n\nIf $z$ has no children, we modify its parent $z.p$ to replace $z$ with NIL as its child (delete $z$).\n\nIf $z$ has only a single child, we \"splice out\" $z$ by making a new link between its child and its parent.\n\nIf $z$ has two children, we splice out $z$'s successor $y$ and replace $z$'s key with $y$'s key.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$, find $k$, delete $k$ or print are given.\n\nOutput\n\nFor each find $k$ operation, print \"yes\" if $T$ has a node containing $k$, \"no\" if not.\n\nIn addition, for each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n\nSample Output 1\n\nyes\nyes\nyes\nno\nno\nno\nyes\nyes\n1 2 3 7 8 22\n8 2 1 3 7 22\n1 2 8 22\n8 2 1 22\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n"}, "reference_outputs": ["yes\nyes\nyes\nno\nno\nno\nyes\nyes\n 1 2 3 7 8 22\n 8 2 1 3 7 22\n 1 2 8 22\n 8 2 1 22\n"], "source_document_id": "p02285", "source_text": "Binary Search Tree III\n\nWrite a program which performs the following operations to a binary search tree $T$ by adding delete operation to B: Binary Search Tree II.\n\ninsert $k$: Insert a node containing $k$ as key into $T$.\n\nfind $k$: Report whether $T$ has a node containing $k$.\n\ndelete $k$: Delete a node containing $k$.\n\nprint: Print the keys of the binary search tree by inorder tree walk and preorder tree walk respectively.\n\nThe operation delete $k$ for deleting a given node $z$ containing key $k$ from $T$ can be implemented by an algorithm which considers the following cases:\n\nIf $z$ has no children, we modify its parent $z.p$ to replace $z$ with NIL as its child (delete $z$).\n\nIf $z$ has only a single child, we \"splice out\" $z$ by making a new link between its child and its parent.\n\nIf $z$ has two children, we splice out $z$'s successor $y$ and replace $z$'s key with $y$'s key.\n\nInput\n\nIn the first line, the number of operations $m$ is given. In the following $m$ lines, operations represented by insert $k$, find $k$, delete $k$ or print are given.\n\nOutput\n\nFor each find $k$ operation, print \"yes\" if $T$ has a node containing $k$, \"no\" if not.\n\nIn addition, for each print operation, print a list of keys obtained by inorder tree walk and preorder tree walk in a line respectively. Put a space character before each key\n\nConstraints\n\nThe number of operations $\\leq 500,000$\n\nThe number of print operations $\\leq 10$.\n\n$-2,000,000,000 \\leq key \\leq 2,000,000,000$\n\nThe height of the binary tree does not exceed 100 if you employ the above pseudo code.\n\nThe keys in the binary search tree are all different.\n\nSample Input 1\n\n18\ninsert 8\ninsert 2\ninsert 3\ninsert 7\ninsert 22\ninsert 1\nfind 1\nfind 2\nfind 3\nfind 4\nfind 5\nfind 6\nfind 7\nfind 8\nprint\ndelete 3\ndelete 7\nprint\n\nSample Output 1\n\nyes\nyes\nyes\nno\nno\nno\nyes\nyes\n1 2 3 7 8 22\n8 2 1 3 7 22\n1 2 8 22\n8 2 1 22\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3174, "cpu_time_ms": 1780, "memory_kb": 205412}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s405011713", "group_id": "codeNet:p02287", "input_text": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n lines.shift().split(' ').map(Number).forEach(function(key, i, a) {\n console.log(`node ${i+1}: key = ${a[i]}, `+(i?`parent key = ${a[Math.floor((i-1)/2)]}, `:'')+(2*i+1 s += ` ${e}`, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest;\n left = 2 * i + 1;\n right = 2 * i + 2;\n largest = left < n && arr[left] > arr[i] ? left : i;\n if (right < n && arr[right] > arr[largest]) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);\n}\n\n", "language": "JavaScript", "metadata": {"date": 1531409588, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/JavaScript/s320473926.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s320473926", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n lines.shift();\n const arr = lines.shift().split(' ').map(Number);\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ` ${e}`, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest;\n left = 2 * i + 1;\n right = 2 * i + 2;\n largest = left < n && arr[left] > arr[i] ? left : i;\n if (right < n && arr[right] > arr[largest]) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 729, "cpu_time_ms": 520, "memory_kb": 142192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s227359014", "group_id": "codeNet:p02288", "input_text": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n lines.shift();\n const arr = lines.shift().split(' ').map(Number);\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ` ${e}`, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest;\n left = 2 * i + 1;\n right = 2 * i + 2;\n largest = left < n && arr[left] > arr[i] ? left : i;\n if (right < n && arr[right] > arr[largest]) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n // [arr[i], arr[largest]] = [arr[largest], arr[i]];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);\n}\n\n", "language": "JavaScript", "metadata": {"date": 1531409661, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/JavaScript/s227359014.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s227359014", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n lines.shift();\n const arr = lines.shift().split(' ').map(Number);\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ` ${e}`, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest;\n left = 2 * i + 1;\n right = 2 * i + 2;\n largest = left < n && arr[left] > arr[i] ? left : i;\n if (right < n && arr[right] > arr[largest]) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n // [arr[i], arr[largest]] = [arr[largest], arr[i]];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 787, "cpu_time_ms": 510, "memory_kb": 140160}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s271210229", "group_id": "codeNet:p02288", "input_text": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n console.log(' ' + buildMaxHeap(lines.shift().split(' ').map(Number)).join(' '));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest;\n left = 2 * i + 1;\n right = 2 * i + 2;\n if (left < n && arr[left] > arr[i]) largest = left;\n else largest = i;\n if (right < n && arr[right] > arr[largest]) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);\n return arr;\n}\n\n", "language": "JavaScript", "metadata": {"date": 1531410377, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/JavaScript/s271210229.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s271210229", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n console.log(' ' + buildMaxHeap(lines.shift().split(' ').map(Number)).join(' '));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest;\n left = 2 * i + 1;\n right = 2 * i + 2;\n if (left < n && arr[left] > arr[i]) largest = left;\n else largest = i;\n if (right < n && arr[right] > arr[largest]) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2); i >= 0; i--) maxHeapify(i);\n return arr;\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 737, "cpu_time_ms": 400, "memory_kb": 110732}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s000920184", "group_id": "codeNet:p02288", "input_text": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n const arr = lines.shift().split(' ');\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ' ' + e, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n let left, right, largest;\n const maxHeapify = (i) => {\n left = 2 * i + 1;\n right = 2 * i + 2;\n if (left < n && Number(arr[left]) > Number(arr[i])) largest = left;\n else largest = i;\n if (right < n && Number(arr[right]) > Number(arr[largest])) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2 - 1); i >= 0; i--) maxHeapify(i);\n}\n\n", "language": "JavaScript", "metadata": {"date": 1531410889, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/JavaScript/s000920184.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s000920184", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n const arr = lines.shift().split(' ');\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ' ' + e, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n let left, right, largest;\n const maxHeapify = (i) => {\n left = 2 * i + 1;\n right = 2 * i + 2;\n if (left < n && Number(arr[left]) > Number(arr[i])) largest = left;\n else largest = i;\n if (right < n && Number(arr[right]) > Number(arr[largest])) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(arr.length / 2 - 1); i >= 0; i--) maxHeapify(i);\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 790, "cpu_time_ms": 200, "memory_kb": 110524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s451410373", "group_id": "codeNet:p02288", "input_text": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n const arr = lines.shift().split(' ').map(Number);\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ' ' + e, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest = i;\n left = 2 * i + 1;\n right = 2 * i + 2;\n if (left < n && Number(arr[left]) > Number(arr[i])) largest = left;\n if (right < n && Number(arr[right]) > Number(arr[largest])) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(n / 2 - 1); i >= 0; i--) maxHeapify(i);\n}\n\n", "language": "JavaScript", "metadata": {"date": 1531411006, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02288.html", "problem_id": "p02288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02288/input.txt", "sample_output_relpath": "derived/input_output/data/p02288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02288/JavaScript/s451410373.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s451410373", "user_id": "u298224238"}, "prompt_components": {"gold_output": " 16 14 10 8 7 9 3 2 4 1\n", "input_to_evaluate": "(function main(){\n const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n');\n const n = Number(lines.shift());\n const arr = lines.shift().split(' ').map(Number);\n buildMaxHeap(arr);\n console.log(arr.reduce((s, e) => s += ' ' + e, ''));\n})();\n\nfunction buildMaxHeap(arr) {\n const n = arr.length;\n const maxHeapify = (i) => {\n let left, right, largest = i;\n left = 2 * i + 1;\n right = 2 * i + 2;\n if (left < n && Number(arr[left]) > Number(arr[i])) largest = left;\n if (right < n && Number(arr[right]) > Number(arr[largest])) largest = right;\n if (largest != i) {\n arr[largest] = [arr[i], arr[i] = arr[largest]][0];\n maxHeapify(largest);\n }\n };\n\n for (let i = Math.floor(n / 2 - 1); i >= 0; i--) maxHeapify(i);\n}\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "sample_input": "10\n4 1 3 2 16 9 10 14 8 7\n"}, "reference_outputs": [" 16 14 10 8 7 9 3 2 4 1\n"], "source_document_id": "p02288", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nMaximum Heap\n\nA binary heap which satisfies max-heap property is called max-heap. In a max-heap, for every node $i$ other than the root, $A[i] \\leq A[parent(i)]$, that is, the value of a node is at most the value of its parent. The largest element in a max-heap is stored at the root, and the subtree rooted at a node contains values no larger than that contained at the node itself.\n\nHere is an example of a max-heap.\n\nWrite a program which reads an array and constructs a max-heap from the array based on the following pseudo code.\n\n$maxHeapify(A, i)$ move the value of $A[i]$ down to leaves to make a sub-tree of node $i$ a max-heap. Here, $H$ is the size of the heap.\n\n1 maxHeapify(A, i)\n2 l = left(i)\n3 r = right(i)\n4 // select the node which has the maximum value\n5 if l ≤ H and A[l] > A[i]\n6 largest = l\n7 else\n8 largest = i\n9 if r ≤ H and A[r] > A[largest]\n10 largest = r\n11\n12 if largest ≠ i // value of children is larger than that of i\n13 swap A[i] and A[largest]\n14 maxHeapify(A, largest) // call recursively\n\nThe following procedure buildMaxHeap(A) makes $A$ a max-heap by performing maxHeapify in a bottom-up manner.\n\n1 buildMaxHeap(A)\n2 for i = H/2 downto 1\n3 maxHeapify(A, i)\n\nInput\n\nIn the first line, an integer $H$ is given. In the second line, $H$ integers which represent elements in the binary heap are given in order of node id (from $1$ to $H$).\n\nOutput\n\nPrint values of nodes in the max-heap in order of their id (from $1$ to $H$). Print a single space character before each value.\n\nConstraint\n\n$1 \\leq H \\leq 500,000$\n\n$-2,000,000,000 \\leq$ value of a node $\\leq 2,000,000,000$\n\nSample Input 1\n\n10\n4 1 3 2 16 9 10 14 8 7\n\nSample Output 1\n\n16 14 10 8 7 9 3 2 4 1\n\nReference\n\nIntroduction to Algorithms, Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. The MIT Press.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 777, "cpu_time_ms": 510, "memory_kb": 140172}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s067618706", "group_id": "codeNet:p02289", "input_text": "const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\\n');\n\nconst maxHeapify = (arr, i) => {\n const l = i * 2;\n const r = l + 1;\n let max;\n\n if (l <= arr.length && arr[l-1] > arr[i-1]) {\n max = l;\n } else {\n max = i;\n }\n if (r <= arr.length && arr[r-1] > arr[max-1]) {\n max = r;\n }\n\n if (max !== i) {\n const tmp = arr[i-1];\n arr[i-1] = arr[max-1];\n arr[max-1] = tmp;\n maxHeapify(arr, max);\n }\n\n};\n\nconst insert = (arr, n) => {\n arr.push(n);\n const helper = (i) => {\n if (i <= 1) return;\n const parentIndex = Math.floor(i/2);\n if (arr[i-1] > arr[parentIndex-1]) {\n const tmp = arr[i-1];\n arr[i-1] = arr[parentIndex-1];\n arr[parentIndex-1] = tmp;\n helper(parentIndex);\n }\n };\n helper(arr.length);\n};\n\nconst extract = arr => {\n const n = arr.shift();\n arr.unshift(arr.pop());\n maxHeapify(arr, 1);\n return n;\n};\n\nconst data = line.reduce((acc, x) => {\n const cmd = x.split(' ');\n switch(cmd[0]) {\n case 'insert':\n insert(acc, Number(cmd[1]));\n break;\n case 'extract':\n console.log(extract(acc));\n break;\n }\n return acc;\n}, []);\n\n", "language": "JavaScript", "metadata": {"date": 1531472589, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02289.html", "problem_id": "p02289", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02289/input.txt", "sample_output_relpath": "derived/input_output/data/p02289/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02289/JavaScript/s067618706.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s067618706", "user_id": "u707214955"}, "prompt_components": {"gold_output": "8\n10\n11\n2\n", "input_to_evaluate": "const line = require('fs').readFileSync('/dev/stdin', 'utf-8').split('\\n');\n\nconst maxHeapify = (arr, i) => {\n const l = i * 2;\n const r = l + 1;\n let max;\n\n if (l <= arr.length && arr[l-1] > arr[i-1]) {\n max = l;\n } else {\n max = i;\n }\n if (r <= arr.length && arr[r-1] > arr[max-1]) {\n max = r;\n }\n\n if (max !== i) {\n const tmp = arr[i-1];\n arr[i-1] = arr[max-1];\n arr[max-1] = tmp;\n maxHeapify(arr, max);\n }\n\n};\n\nconst insert = (arr, n) => {\n arr.push(n);\n const helper = (i) => {\n if (i <= 1) return;\n const parentIndex = Math.floor(i/2);\n if (arr[i-1] > arr[parentIndex-1]) {\n const tmp = arr[i-1];\n arr[i-1] = arr[parentIndex-1];\n arr[parentIndex-1] = tmp;\n helper(parentIndex);\n }\n };\n helper(arr.length);\n};\n\nconst extract = arr => {\n const n = arr.shift();\n arr.unshift(arr.pop());\n maxHeapify(arr, 1);\n return n;\n};\n\nconst data = line.reduce((acc, x) => {\n const cmd = x.split(' ');\n switch(cmd[0]) {\n case 'insert':\n insert(acc, Number(cmd[1]));\n break;\n case 'extract':\n console.log(extract(acc));\n break;\n }\n return acc;\n}, []);\n\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nPriority Queue\n\nA priority queue is a data structure which maintains a set $S$ of elements, each of with an associated value (key), and supports the following operations:\n\n$insert(S, k)$: insert an element $k$ into the set $S$\n\n$extractMax(S)$: remove and return the element of $S$ with the largest key\n\nWrite a program which performs the $insert(S, k)$ and $extractMax(S)$ operations to a priority queue $S$.\nThe priority queue manages a set of integers, which are also keys for the priority.\n\nInput\n\nMultiple operations to the priority queue $S$ are given. Each operation is given by \"insert $k$\", \"extract\" or \"end\" in a line. Here, $k$ represents an integer element to be inserted to the priority queue.\n\nThe input ends with \"end\" operation.\n\nOutput\n\nFor each \"extract\" operation, print the element extracted from the priority queue $S$ in a line.\n\nConstraints\n\nThe number of operations $\\leq 2,000,000$\n\n$0 \\leq k \\leq 2,000,000,000$\n\nSample Input 1\n\ninsert 8\ninsert 2\nextract\ninsert 10\nextract\ninsert 11\nextract\nextract\nend\n\nSample Output 1\n\n8\n10\n11\n2", "sample_input": "insert 8\ninsert 2\nextract\ninsert 10\nextract\ninsert 11\nextract\nextract\nend\n"}, "reference_outputs": ["8\n10\n11\n2\n"], "source_document_id": "p02289", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nPriority Queue\n\nA priority queue is a data structure which maintains a set $S$ of elements, each of with an associated value (key), and supports the following operations:\n\n$insert(S, k)$: insert an element $k$ into the set $S$\n\n$extractMax(S)$: remove and return the element of $S$ with the largest key\n\nWrite a program which performs the $insert(S, k)$ and $extractMax(S)$ operations to a priority queue $S$.\nThe priority queue manages a set of integers, which are also keys for the priority.\n\nInput\n\nMultiple operations to the priority queue $S$ are given. Each operation is given by \"insert $k$\", \"extract\" or \"end\" in a line. Here, $k$ represents an integer element to be inserted to the priority queue.\n\nThe input ends with \"end\" operation.\n\nOutput\n\nFor each \"extract\" operation, print the element extracted from the priority queue $S$ in a line.\n\nConstraints\n\nThe number of operations $\\leq 2,000,000$\n\n$0 \\leq k \\leq 2,000,000,000$\n\nSample Input 1\n\ninsert 8\ninsert 2\nextract\ninsert 10\nextract\ninsert 11\nextract\nextract\nend\n\nSample Output 1\n\n8\n10\n11\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1287, "cpu_time_ms": 20000, "memory_kb": 167380}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s124283076", "group_id": "codeNet:p02314", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.trim().split('\\n');\nconst [ n, m ]= list[0].split(' ');\nconst cm = list[1].trim().split(' ');\n\nconst genKey = (...args) => {\n const key = args.join(':');\n return key;\n}\n\nconst dp = new Map();\nconst memo = (count, target) => {\n const key = genKey(count, target);\n let result = 0;\n if (dp.has(key)) {\n result = dp.get(key);\n } else if (target !== 0) {\n // 制約(1 ≤ n ≤ 50,000)よりベタ書きの初期化\n const nextCount = count + 1;\n let min = 50000;\n for (let i = 0; i < Number(m); i++) {\n const nextTarget = target - Number(cm[i]);\n if (nextTarget < 0) {\n continue;\n }\n const result = memo(nextCount, nextTarget);\n dp.set(genKey(nextCount, nextTarget), result);\n min = Math.min(min, result);\n }\n result = min + 1;\n }\n\n // 末尾再起\n return result;\n}\n\nconsole.log(memo(0, Number(n)));\n\n\n\n// const CALL_STACK_SIZE_LIMIT = 3000;\n// let callStackSize = 0;\n\n// const dp = new Map();\n// const memo = async (count, target) => {\n// if (++callStackSize > CALL_STACK_SIZE_LIMIT) {\n// console.log('call nextTick:', count);\n// await nextTick();\n// callStackSize = 0;\n// }\n// const key = genKey(count, target);\n// if (dp.has(key)) {\n// return dp.get(key);\n// } else if (target === 0) {\n// return 0;\n// }\n\n// // 制約(1 ≤ n ≤ 50,000)よりベタ書きの初期化\n// const nextCount = count + 1;\n// let min = 50000;\n// for (let i = 0; i < Number(m); i++) {\n// const nextTarget = target - Number(cm[i]);\n// if (nextTarget < 0) {\n// continue;\n// }\n// const result = await memo(nextCount, nextTarget);\n// dp.set(genKey(nextCount, nextTarget), result);\n// min = Math.min(min, result);\n// }\n\n// return min + 1;\n// }\n\n// (async () => {\n// console.log(await memo(0, Number(n)));\n// })()\n\n", "language": "JavaScript", "metadata": {"date": 1518616104, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02314.html", "problem_id": "p02314", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02314/input.txt", "sample_output_relpath": "derived/input_output/data/p02314/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02314/JavaScript/s124283076.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s124283076", "user_id": "u779137493"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.trim().split('\\n');\nconst [ n, m ]= list[0].split(' ');\nconst cm = list[1].trim().split(' ');\n\nconst genKey = (...args) => {\n const key = args.join(':');\n return key;\n}\n\nconst dp = new Map();\nconst memo = (count, target) => {\n const key = genKey(count, target);\n let result = 0;\n if (dp.has(key)) {\n result = dp.get(key);\n } else if (target !== 0) {\n // 制約(1 ≤ n ≤ 50,000)よりベタ書きの初期化\n const nextCount = count + 1;\n let min = 50000;\n for (let i = 0; i < Number(m); i++) {\n const nextTarget = target - Number(cm[i]);\n if (nextTarget < 0) {\n continue;\n }\n const result = memo(nextCount, nextTarget);\n dp.set(genKey(nextCount, nextTarget), result);\n min = Math.min(min, result);\n }\n result = min + 1;\n }\n\n // 末尾再起\n return result;\n}\n\nconsole.log(memo(0, Number(n)));\n\n\n\n// const CALL_STACK_SIZE_LIMIT = 3000;\n// let callStackSize = 0;\n\n// const dp = new Map();\n// const memo = async (count, target) => {\n// if (++callStackSize > CALL_STACK_SIZE_LIMIT) {\n// console.log('call nextTick:', count);\n// await nextTick();\n// callStackSize = 0;\n// }\n// const key = genKey(count, target);\n// if (dp.has(key)) {\n// return dp.get(key);\n// } else if (target === 0) {\n// return 0;\n// }\n\n// // 制約(1 ≤ n ≤ 50,000)よりベタ書きの初期化\n// const nextCount = count + 1;\n// let min = 50000;\n// for (let i = 0; i < Number(m); i++) {\n// const nextTarget = target - Number(cm[i]);\n// if (nextTarget < 0) {\n// continue;\n// }\n// const result = await memo(nextCount, nextTarget);\n// dp.set(genKey(nextCount, nextTarget), result);\n// min = Math.min(min, result);\n// }\n\n// return min + 1;\n// }\n\n// (async () => {\n// console.log(await memo(0, Number(n)));\n// })()\n\n", "problem_context": "Coin Changing Problem\n\nFind the minimum number of coins to make change for n cents using coins of denominations d1, d2,.., dm. The coins can be used any number of times.\n\nInput\n\nn m\nd1 d2 ... dm\n\nTwo integers n and m are given in the first line. The available denominations are given in the second line.\n\nOutput\n\nPrint the minimum number of coins in a line.\n\nConstraints\n\n1 ≤ n ≤ 50000\n\n1 ≤ m ≤ 20\n\n1 ≤ denomination ≤ 10000\n\nThe denominations are all different and contain 1.\n\nSample Input 1\n\n55 4\n1 5 10 50\n\nSample Output 1\n\n2\n\nSample Input 2\n\n15 6\n1 2 7 8 12 50\n\nSample Output 2\n\n2\n\nSample Input 3\n\n65 6\n1 2 7 8 12 50\n\nSample Output 3\n\n3", "sample_input": "55 4\n1 5 10 50\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02314", "source_text": "Coin Changing Problem\n\nFind the minimum number of coins to make change for n cents using coins of denominations d1, d2,.., dm. The coins can be used any number of times.\n\nInput\n\nn m\nd1 d2 ... dm\n\nTwo integers n and m are given in the first line. The available denominations are given in the second line.\n\nOutput\n\nPrint the minimum number of coins in a line.\n\nConstraints\n\n1 ≤ n ≤ 50000\n\n1 ≤ m ≤ 20\n\n1 ≤ denomination ≤ 10000\n\nThe denominations are all different and contain 1.\n\nSample Input 1\n\n55 4\n1 5 10 50\n\nSample Output 1\n\n2\n\nSample Input 2\n\n15 6\n1 2 7 8 12 50\n\nSample Output 2\n\n2\n\nSample Input 3\n\n65 6\n1 2 7 8 12 50\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1912, "cpu_time_ms": 100, "memory_kb": 20684}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s261257358", "group_id": "codeNet:p02314", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.trim().split('\\n');\nlet [ n, m ] = list[0].split(' ');\nn = Number(n);\nm = Number(m);\nlet cm = list[1].trim().split(' ');\ncm = cm.map(c => Number(c));\n\nconst dp = new Map();\ndp.set(n, 0);\nconst memo = (count, yen) => {\n let nextCount;\n let nextYen = yen - 1;\n let result;\n if (!dp.has(yen)) {\n nextCount = count;\n } else {\n const min = Math.min(dp.get(yen), count);\n dp.set(yen, min);\n if (yen === 0) {\n result = dp.get(yen);\n } else {\n nextMin = min + 1;\n for (let i = 0; i < m; i++) {\n const afterYen = yen - cm[i];\n if (afterYen < 0) {\n continue;\n } else if (dp.has(afterYen)) {\n dp.set(afterYen, Math.min(dp.get(afterYen), nextMin));\n } else {\n dp.set(afterYen, nextMin);\n }\n } \n }\n }\n\n return result || memo(nextMin, nextYen);\n}\n\nconsole.log(memo(1, n));\n", "language": "JavaScript", "metadata": {"date": 1518679295, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02314.html", "problem_id": "p02314", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02314/input.txt", "sample_output_relpath": "derived/input_output/data/p02314/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02314/JavaScript/s261257358.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s261257358", "user_id": "u779137493"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.trim().split('\\n');\nlet [ n, m ] = list[0].split(' ');\nn = Number(n);\nm = Number(m);\nlet cm = list[1].trim().split(' ');\ncm = cm.map(c => Number(c));\n\nconst dp = new Map();\ndp.set(n, 0);\nconst memo = (count, yen) => {\n let nextCount;\n let nextYen = yen - 1;\n let result;\n if (!dp.has(yen)) {\n nextCount = count;\n } else {\n const min = Math.min(dp.get(yen), count);\n dp.set(yen, min);\n if (yen === 0) {\n result = dp.get(yen);\n } else {\n nextMin = min + 1;\n for (let i = 0; i < m; i++) {\n const afterYen = yen - cm[i];\n if (afterYen < 0) {\n continue;\n } else if (dp.has(afterYen)) {\n dp.set(afterYen, Math.min(dp.get(afterYen), nextMin));\n } else {\n dp.set(afterYen, nextMin);\n }\n } \n }\n }\n\n return result || memo(nextMin, nextYen);\n}\n\nconsole.log(memo(1, n));\n", "problem_context": "Coin Changing Problem\n\nFind the minimum number of coins to make change for n cents using coins of denominations d1, d2,.., dm. The coins can be used any number of times.\n\nInput\n\nn m\nd1 d2 ... dm\n\nTwo integers n and m are given in the first line. The available denominations are given in the second line.\n\nOutput\n\nPrint the minimum number of coins in a line.\n\nConstraints\n\n1 ≤ n ≤ 50000\n\n1 ≤ m ≤ 20\n\n1 ≤ denomination ≤ 10000\n\nThe denominations are all different and contain 1.\n\nSample Input 1\n\n55 4\n1 5 10 50\n\nSample Output 1\n\n2\n\nSample Input 2\n\n15 6\n1 2 7 8 12 50\n\nSample Output 2\n\n2\n\nSample Input 3\n\n65 6\n1 2 7 8 12 50\n\nSample Output 3\n\n3", "sample_input": "55 4\n1 5 10 50\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02314", "source_text": "Coin Changing Problem\n\nFind the minimum number of coins to make change for n cents using coins of denominations d1, d2,.., dm. The coins can be used any number of times.\n\nInput\n\nn m\nd1 d2 ... dm\n\nTwo integers n and m are given in the first line. The available denominations are given in the second line.\n\nOutput\n\nPrint the minimum number of coins in a line.\n\nConstraints\n\n1 ≤ n ≤ 50000\n\n1 ≤ m ≤ 20\n\n1 ≤ denomination ≤ 10000\n\nThe denominations are all different and contain 1.\n\nSample Input 1\n\n55 4\n1 5 10 50\n\nSample Output 1\n\n2\n\nSample Input 2\n\n15 6\n1 2 7 8 12 50\n\nSample Output 2\n\n2\n\nSample Input 3\n\n65 6\n1 2 7 8 12 50\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 951, "cpu_time_ms": 90, "memory_kb": 17456}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s966426362", "group_id": "codeNet:p02317", "input_text": "function Main(input) {\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n\n const lowerBound = (arr, n) => {\n let first = 0, last = arr.length - 1, middle;\n while (first <= last) {\n middle = Math.floor((first + last) / 2);\n if (arr[middle] < n) first = middle + 1;\n else last = middle - 1;\n }\n return first;\n }\n\n\n let n = parseInt(input[0][0], 10);\n let v_a = [];\n for (let i = 0; i < n; i++){\n v_a.push(parseInt(input[i + 1][0], 10));\n }\n let dp = Array.from({length: n}, () => Infinity);\n\n dp[0] = v_a[0];\n let index;\n for (let i = 1; i < n; i++){\n index = lowerBound(dp, v_a[i]);\n dp[index] = v_a[i];\n }\n\n console.log(lowerBound(dp,1e9+1));\n\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n", "language": "JavaScript", "metadata": {"date": 1597731821, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02317.html", "problem_id": "p02317", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02317/input.txt", "sample_output_relpath": "derived/input_output/data/p02317/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02317/JavaScript/s966426362.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s966426362", "user_id": "u136459078"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function Main(input) {\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n\n const lowerBound = (arr, n) => {\n let first = 0, last = arr.length - 1, middle;\n while (first <= last) {\n middle = Math.floor((first + last) / 2);\n if (arr[middle] < n) first = middle + 1;\n else last = middle - 1;\n }\n return first;\n }\n\n\n let n = parseInt(input[0][0], 10);\n let v_a = [];\n for (let i = 0; i < n; i++){\n v_a.push(parseInt(input[i + 1][0], 10));\n }\n let dp = Array.from({length: n}, () => Infinity);\n\n dp[0] = v_a[0];\n let index;\n for (let i = 1; i < n; i++){\n index = lowerBound(dp, v_a[i]);\n dp[index] = v_a[i];\n }\n\n console.log(lowerBound(dp,1e9+1));\n\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n", "problem_context": "Longest Increasing Subsequence\n\nFor a given sequence A = {a0, a1, ... , an-1}, find the length of the longest increasing subsequnece (LIS) in A.\n\nAn increasing subsequence of A is defined by a subsequence {ai0, ai1, ... , aik} where 0 ≤ i0 < i1 < ... < ik < n and ai0 < ai1 < ... < aik.\n\nInput\n\nn\na0\na1\n:\nan-1\n\nIn the first line, an integer n is given. In the next n lines, elements of A are given.\n\nOutput\n\nThe length of the longest increasing subsequence of A.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n0 ≤ ai ≤ 109\n\nSample Input 1\n\n5\n5\n1\n3\n2\n4\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1\n1\n1\n\nSample Output 2\n\n1", "sample_input": "5\n5\n1\n3\n2\n4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02317", "source_text": "Longest Increasing Subsequence\n\nFor a given sequence A = {a0, a1, ... , an-1}, find the length of the longest increasing subsequnece (LIS) in A.\n\nAn increasing subsequence of A is defined by a subsequence {ai0, ai1, ... , aik} where 0 ≤ i0 < i1 < ... < ik < n and ai0 < ai1 < ... < aik.\n\nInput\n\nn\na0\na1\n:\nan-1\n\nIn the first line, an integer n is given. In the next n lines, elements of A are given.\n\nOutput\n\nThe length of the longest increasing subsequence of A.\n\nConstraints\n\n1 ≤ n ≤ 100000\n\n0 ≤ ai ≤ 109\n\nSample Input 1\n\n5\n5\n1\n3\n2\n4\n\nSample Output 1\n\n3\n\nSample Input 2\n\n3\n1\n1\n1\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 850, "cpu_time_ms": 290, "memory_kb": 41312}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s473045585", "group_id": "codeNet:p02367", "input_text": "var log = console.log;\nif (typeof process != \"undefined\") {\n\tvar input = \"\";\n\tprocess.stdin.resume();\n\tprocess.stdin.setEncoding('utf8');\n\tprocess.stdin.on('data', function (chunk) {\n\t\tinput += chunk;\n\t});\n\tprocess.stdin.on('end', function () {\n\t\tvar lines = input.split(\"\\n\");\n\t\tmain(lines);\n\t});\n}\n\n\nfunction main(lines){\n\tif(lines.pop() != \"\"){\n\t\tlines.push();\n\t}\n\tlines = lines.map(function(line){\n\t\treturn line.split(\" \").map(function(e){\n\t\t\treturn Number(e);\n\t\t});\n\t});\n\tvar top_line = lines.shift();\n\tvar V = top_line[0];\n\tvar E = top_line[1];\n\tvar real_edge = [];\n\tvar virt_edge = [];\n\tvar mark = [];\n\tvar status = [];\n\tvar ord = [];\n\tvar lowlink = [];\n\tvar bridges = [];\n\tfor(var i = 0; i < V ; i++){\n\t\treal_edge[i] = [];\n\t\tmark[i] = false;\n\t\t//ord?????????\n\t\t//lowlink??????(dfs????????????????§????){0,}??¨(?????????){0,1}??§?????????ord???????°????\n\t\t//?????????????????????????????§???????°???????ord\n\t\tord[i] = 0;\n\t\tlowlink[i] = V;\n\t\tbridges[i] = [];\n\t}\n\tlines.forEach(function(edge){\n\t\tvar a = edge[0];\n\t\tvar b = edge[1];\n\t\treal_edge[a].push(b);\n\t\treal_edge[b].push(a);\n\t});\n\tvar no = 0;\n\tvar prev = 0;\n\tfunction dfs(now_point,prev){\n\t\t//now_point????????¨???????????????\n\t\t//now_ord????????¨???????????????\n\t\t//mark????¨???????????????????\n\t\tvar np = now_point;\n\t\tvar mk = mark;\n\t\tvar targets = real_edge[np];\n\t\tmk[np] = true;\n\t\tord[np] = no;\n\t\tlowlink[np] = no;\n\t\tno++;\n\t\ttargets.forEach(function(target){\n\t\t\tif(target == prev){\n\t\t\t\t//??´???????????????????????????????????§\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(mk[target]){\n\t\t\t\t//?????????\n\t\t\t\t//lowlink?????´??°\n\t\t\t\t//????°????????????????\n\t\t\t\tlowlink[np] = Math.min(lowlink[np],target);\n\t\t\t}else{\n\t\t\t\t//???????????£????????¨?????????\n\t\t\t\t//??¢?´¢?????????\n\t\t\t\tdfs(target,np);\n\t\t\t\t//?????\\????????????lowlink?????????\n\t\t\t\t//???????????????????±????lowlink???????°???????lowlink????????¨??????\n\t\t\t\tlowlink[np] = Math.min(lowlink[np],lowlink[target]);\n\t\t\t}\n\t\t});\n\t}\n\tdfs(0,V);\n\tlines.forEach(function(edge){\n\t\tvar u = edge[0];\n\t\tvar v = edge[1];\n\t\tif(ord[u] > ord[v]){\n\t\t\tvar k = u;\n\t\t\tu = v;\n\t\t\tv = k;\n\t\t}\n\t\tif(ord[u] < lowlink[v]){\n\t\t\t//????????????\n\t\t\tvar min = Math.min(u,v);\n\t\t\tvar max = Math.max(u,v);\n\t\t\tbridges[min].push(max);\n\t\t}\n\t});\n\tbridges = bridges.map(function(e){\n\t\treturn e.sort();\n\t});\n\tfor(var s = 0 ; s < V ; s++){\n\t\tvar len = bridges[s].length;\n\t\tfor(var td = 0 ; td < len ;td++){\n\t\t\tvar t = bridges[s][td];\n\t\t\tlog(s+\" \"+t);\n\t\t}\n\t}\n}", "language": "JavaScript", "metadata": {"date": 1497243193, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02367.html", "problem_id": "p02367", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02367/input.txt", "sample_output_relpath": "derived/input_output/data/p02367/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02367/JavaScript/s473045585.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s473045585", "user_id": "u059378405"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "var log = console.log;\nif (typeof process != \"undefined\") {\n\tvar input = \"\";\n\tprocess.stdin.resume();\n\tprocess.stdin.setEncoding('utf8');\n\tprocess.stdin.on('data', function (chunk) {\n\t\tinput += chunk;\n\t});\n\tprocess.stdin.on('end', function () {\n\t\tvar lines = input.split(\"\\n\");\n\t\tmain(lines);\n\t});\n}\n\n\nfunction main(lines){\n\tif(lines.pop() != \"\"){\n\t\tlines.push();\n\t}\n\tlines = lines.map(function(line){\n\t\treturn line.split(\" \").map(function(e){\n\t\t\treturn Number(e);\n\t\t});\n\t});\n\tvar top_line = lines.shift();\n\tvar V = top_line[0];\n\tvar E = top_line[1];\n\tvar real_edge = [];\n\tvar virt_edge = [];\n\tvar mark = [];\n\tvar status = [];\n\tvar ord = [];\n\tvar lowlink = [];\n\tvar bridges = [];\n\tfor(var i = 0; i < V ; i++){\n\t\treal_edge[i] = [];\n\t\tmark[i] = false;\n\t\t//ord?????????\n\t\t//lowlink??????(dfs????????????????§????){0,}??¨(?????????){0,1}??§?????????ord???????°????\n\t\t//?????????????????????????????§???????°???????ord\n\t\tord[i] = 0;\n\t\tlowlink[i] = V;\n\t\tbridges[i] = [];\n\t}\n\tlines.forEach(function(edge){\n\t\tvar a = edge[0];\n\t\tvar b = edge[1];\n\t\treal_edge[a].push(b);\n\t\treal_edge[b].push(a);\n\t});\n\tvar no = 0;\n\tvar prev = 0;\n\tfunction dfs(now_point,prev){\n\t\t//now_point????????¨???????????????\n\t\t//now_ord????????¨???????????????\n\t\t//mark????¨???????????????????\n\t\tvar np = now_point;\n\t\tvar mk = mark;\n\t\tvar targets = real_edge[np];\n\t\tmk[np] = true;\n\t\tord[np] = no;\n\t\tlowlink[np] = no;\n\t\tno++;\n\t\ttargets.forEach(function(target){\n\t\t\tif(target == prev){\n\t\t\t\t//??´???????????????????????????????????§\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(mk[target]){\n\t\t\t\t//?????????\n\t\t\t\t//lowlink?????´??°\n\t\t\t\t//????°????????????????\n\t\t\t\tlowlink[np] = Math.min(lowlink[np],target);\n\t\t\t}else{\n\t\t\t\t//???????????£????????¨?????????\n\t\t\t\t//??¢?´¢?????????\n\t\t\t\tdfs(target,np);\n\t\t\t\t//?????\\????????????lowlink?????????\n\t\t\t\t//???????????????????±????lowlink???????°???????lowlink????????¨??????\n\t\t\t\tlowlink[np] = Math.min(lowlink[np],lowlink[target]);\n\t\t\t}\n\t\t});\n\t}\n\tdfs(0,V);\n\tlines.forEach(function(edge){\n\t\tvar u = edge[0];\n\t\tvar v = edge[1];\n\t\tif(ord[u] > ord[v]){\n\t\t\tvar k = u;\n\t\t\tu = v;\n\t\t\tv = k;\n\t\t}\n\t\tif(ord[u] < lowlink[v]){\n\t\t\t//????????????\n\t\t\tvar min = Math.min(u,v);\n\t\t\tvar max = Math.max(u,v);\n\t\t\tbridges[min].push(max);\n\t\t}\n\t});\n\tbridges = bridges.map(function(e){\n\t\treturn e.sort();\n\t});\n\tfor(var s = 0 ; s < V ; s++){\n\t\tvar len = bridges[s].length;\n\t\tfor(var td = 0 ; td < len ;td++){\n\t\t\tvar t = bridges[s][td];\n\t\t\tlog(s+\" \"+t);\n\t\t}\n\t}\n}", "problem_context": "Bridges\n\nFind bridges of an undirected graph G(V, E).\n\nA bridge (also known as a cut-edge) is an edge whose deletion increase the number of connected components.\n\nInput\n\n|V| |E|\ns0 t0\ns1 t1\n:\ns|E|-1 t|E|-1\n\n, where |V| is the number of nodes and |E| is the number of edges in the graph. The graph nodes are named with the numbers 0, 1,..., |V|-1 respectively.\n\nsi and ti represent source and target nodes of i-th edge (undirected).\n\nOutput\n\nA list of bridges of the graph ordered by name. For each bridge, names of its end-ponints, source and target (source < target), should be printed separated by a space. The sources should be printed ascending order, then the target should also be printed ascending order for the same source.\n\nConstraints\n\n1 ≤ |V| ≤ 100,000\n\n0 ≤ |E| ≤ 100,000\n\nThe graph is connected\n\nThere are no parallel edges\n\nThere are no self-loops\n\nSample Input 1\n\n4 4\n0 1\n0 2\n1 2\n2 3\n\nSample Output 1\n\n2 3\n\nSample Input 2\n\n5 4\n0 1\n1 2\n2 3\n3 4\n\nSample Output 2\n\n0 1\n1 2\n2 3\n3 4", "sample_input": "4 4\n0 1\n0 2\n1 2\n2 3\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02367", "source_text": "Bridges\n\nFind bridges of an undirected graph G(V, E).\n\nA bridge (also known as a cut-edge) is an edge whose deletion increase the number of connected components.\n\nInput\n\n|V| |E|\ns0 t0\ns1 t1\n:\ns|E|-1 t|E|-1\n\n, where |V| is the number of nodes and |E| is the number of edges in the graph. The graph nodes are named with the numbers 0, 1,..., |V|-1 respectively.\n\nsi and ti represent source and target nodes of i-th edge (undirected).\n\nOutput\n\nA list of bridges of the graph ordered by name. For each bridge, names of its end-ponints, source and target (source < target), should be printed separated by a space. The sources should be printed ascending order, then the target should also be printed ascending order for the same source.\n\nConstraints\n\n1 ≤ |V| ≤ 100,000\n\n0 ≤ |E| ≤ 100,000\n\nThe graph is connected\n\nThere are no parallel edges\n\nThere are no self-loops\n\nSample Input 1\n\n4 4\n0 1\n0 2\n1 2\n2 3\n\nSample Output 1\n\n2 3\n\nSample Input 2\n\n5 4\n0 1\n1 2\n2 3\n3 4\n\nSample Output 2\n\n0 1\n1 2\n2 3\n3 4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2429, "cpu_time_ms": 60, "memory_kb": 15796}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s986607383", "group_id": "codeNet:p02379", "input_text": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nvar re = /\\s+|$/;\nreader.on('close', () => {\n var f = lines[0].trim().split(' ').map(Number);\n console.log(aux(f[0],f[1],f[2],f[3]));\n});\n\nfunction aux(x0,y0,x1,y1)\n{\n return Math.sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));\n}\n", "language": "JavaScript", "metadata": {"date": 1585547138, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02379.html", "problem_id": "p02379", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02379/input.txt", "sample_output_relpath": "derived/input_output/data/p02379/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02379/JavaScript/s986607383.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s986607383", "user_id": "u032662562"}, "prompt_components": {"gold_output": "1.41421356\n", "input_to_evaluate": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nvar re = /\\s+|$/;\nreader.on('close', () => {\n var f = lines[0].trim().split(' ').map(Number);\n console.log(aux(f[0],f[1],f[2],f[3]));\n});\n\nfunction aux(x0,y0,x1,y1)\n{\n return Math.sqrt((x1-x0)*(x1-x0)+(y1-y0)*(y1-y0));\n}\n", "problem_context": "Distance\n\nWrite a program which calculates the distance between two points P1(x1, y1) and P2(x2, y2).\n\nInput\n\nFour real numbers x1, y1, x2 and y2 are given in a line.\n\nOutput\n\nPrint the distance in real number. The output should not contain an absolute error greater than 10-4.\n\nSample Input\n\n0 0 1 1\n\nSample Output\n\n1.41421356", "sample_input": "0 0 1 1\n"}, "reference_outputs": ["1.41421356\n"], "source_document_id": "p02379", "source_text": "Distance\n\nWrite a program which calculates the distance between two points P1(x1, y1) and P2(x2, y2).\n\nInput\n\nFour real numbers x1, y1, x2 and y2 are given in a line.\n\nOutput\n\nPrint the distance in real number. The output should not contain an absolute error greater than 10-4.\n\nSample Input\n\n0 0 1 1\n\nSample Output\n\n1.41421356", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 479, "cpu_time_ms": 90, "memory_kb": 16564}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s073906010", "group_id": "codeNet:p02385", "input_text": "function Dice(num) {\n this.top = num[0];\n this.front = num[1];\n this.right = num[2];\n this.left = num[3];\n this.back = num[4];\n this.bottom = num[5]\n\n this.roll = function(direction) {\n var tmp;\n switch (direction) {\n case 'E':\n tmp = this.top;\n this.top = this.left;\n this.left = this.bottom;\n this.bottom = this.right;\n this.right = tmp;\n break;\n case 'N':\n tmp = this.top;\n this.top = this.front;\n this.front = this.bottom;\n this.bottom = this.back;\n this.back = tmp;\n break;\n case 'S':\n tmp = this.top;\n this.top = this.back;\n this.back = this.bottom;\n this.bottom = this.front;\n this.front = tmp;\n break;\n case 'W':\n tmp = this.top;\n this.top = this.right;\n this.right = this.bottom;\n this.bottom = this.left;\n this.left = tmp\n break;\n }\n }\n\n this.turn = function(direction) {\n switch (direction) {\n case 'R':\n tmp = this.front;\n this.front = this.right;\n this.right = this.back;\n this.back = this.left;\n this.left = tmp;\n break;\n case 'L':\n tmp = this.front;\n this.front = this.left;\n this.left = this.back;\n this.back = this.right;\n this.right = tmp\n break;\n }\n }\n\n this.setTop = function(topNum) {\n switch (topNum) {\n case this.top:\n break;\n case this.front:\n this.roll('N');\n break;\n case this.right:\n this.roll('W');\n break;\n case this.left:\n this.roll('E');\n break;\n case this.back:\n this.roll('S');\n break;\n case this.bottom:\n this.roll('N');\n this.roll('N');\n break;\n }\n }\n\n this.setFront = function(frontNum) {\n switch (frontNum) {\n case this.top:\n break;\n case this.front:\n break;\n case this.right:\n this.turn('R');\n break;\n case this.left:\n this.turn('L');\n break;\n case this.back:\n this.turn('R');\n this.turn('R');\n break;\n case this.bottom:\n break;\n }\n }\n}\n\n\nvar input = \"\"\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\n \nprocess.stdin.on('end', function() {\n input = input.split(\"\\n\");\n\n var origin_dice = new Dice(input[0].split(' ').map(Number));\n var target_dice = new Dice(input[1].split(' ').map(Number));\n var result = 'No'\n\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 4; j++) {\n target_dice.turn('R');\n if (origin_dice.top == target_dice.top &&\n origin_dice.front == target_dice.front &&\n origin_dice.right == target_dice.right &&\n origin_dice.left == target_dice.left &&\n origin_dice.back == target_dice.back &&\n origin_dice.bottom == target_dice.bottom) {\n result = 'Yes'\n }\n }\n if (i < 4) {\n target_dice.roll('N');\n } else {\n target_dice.roll('W');\n }\n }\n console.log(result);\n});", "language": "JavaScript", "metadata": {"date": 1441186398, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02385.html", "problem_id": "p02385", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02385/input.txt", "sample_output_relpath": "derived/input_output/data/p02385/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02385/JavaScript/s073906010.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s073906010", "user_id": "u209022771"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Dice(num) {\n this.top = num[0];\n this.front = num[1];\n this.right = num[2];\n this.left = num[3];\n this.back = num[4];\n this.bottom = num[5]\n\n this.roll = function(direction) {\n var tmp;\n switch (direction) {\n case 'E':\n tmp = this.top;\n this.top = this.left;\n this.left = this.bottom;\n this.bottom = this.right;\n this.right = tmp;\n break;\n case 'N':\n tmp = this.top;\n this.top = this.front;\n this.front = this.bottom;\n this.bottom = this.back;\n this.back = tmp;\n break;\n case 'S':\n tmp = this.top;\n this.top = this.back;\n this.back = this.bottom;\n this.bottom = this.front;\n this.front = tmp;\n break;\n case 'W':\n tmp = this.top;\n this.top = this.right;\n this.right = this.bottom;\n this.bottom = this.left;\n this.left = tmp\n break;\n }\n }\n\n this.turn = function(direction) {\n switch (direction) {\n case 'R':\n tmp = this.front;\n this.front = this.right;\n this.right = this.back;\n this.back = this.left;\n this.left = tmp;\n break;\n case 'L':\n tmp = this.front;\n this.front = this.left;\n this.left = this.back;\n this.back = this.right;\n this.right = tmp\n break;\n }\n }\n\n this.setTop = function(topNum) {\n switch (topNum) {\n case this.top:\n break;\n case this.front:\n this.roll('N');\n break;\n case this.right:\n this.roll('W');\n break;\n case this.left:\n this.roll('E');\n break;\n case this.back:\n this.roll('S');\n break;\n case this.bottom:\n this.roll('N');\n this.roll('N');\n break;\n }\n }\n\n this.setFront = function(frontNum) {\n switch (frontNum) {\n case this.top:\n break;\n case this.front:\n break;\n case this.right:\n this.turn('R');\n break;\n case this.left:\n this.turn('L');\n break;\n case this.back:\n this.turn('R');\n this.turn('R');\n break;\n case this.bottom:\n break;\n }\n }\n}\n\n\nvar input = \"\"\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\n \nprocess.stdin.on('end', function() {\n input = input.split(\"\\n\");\n\n var origin_dice = new Dice(input[0].split(' ').map(Number));\n var target_dice = new Dice(input[1].split(' ').map(Number));\n var result = 'No'\n\n for (var i = 0; i < 8; i++) {\n for (var j = 0; j < 4; j++) {\n target_dice.turn('R');\n if (origin_dice.top == target_dice.top &&\n origin_dice.front == target_dice.front &&\n origin_dice.right == target_dice.right &&\n origin_dice.left == target_dice.left &&\n origin_dice.back == target_dice.back &&\n origin_dice.bottom == target_dice.bottom) {\n result = 'Yes'\n }\n }\n if (i < 4) {\n target_dice.roll('N');\n } else {\n target_dice.roll('W');\n }\n }\n console.log(result);\n});", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDice III\n\nWrite a program which reads the two dices constructed in the same way as Dice I, and determines whether these two dices are identical. You can roll a dice in the same way as Dice I, and if all integers observed from the six directions are the same as that of another dice, these dices can be considered as identical.\n\nInput\n\nIn the first line, six integers assigned to faces of a dice are given in ascending order of their corresponding labels.\n\nIn the second line, six integers assigned to faces of another dice are given in ascending order of their corresponding labels.\n\nOutput\n\nPrint \"Yes\" if two dices are identical, otherwise \"No\" in a line.\n\nConstraints\n\n$0 \\leq $ the integer assigned to a face $ \\leq 100$\n\nSample Input 1\n\n1 2 3 4 5 6\n6 2 4 3 5 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n1 2 3 4 5 6\n6 5 4 3 2 1\n\nSample Output 2\n\nNo", "sample_input": "1 2 3 4 5 6\n6 2 4 3 5 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02385", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDice III\n\nWrite a program which reads the two dices constructed in the same way as Dice I, and determines whether these two dices are identical. You can roll a dice in the same way as Dice I, and if all integers observed from the six directions are the same as that of another dice, these dices can be considered as identical.\n\nInput\n\nIn the first line, six integers assigned to faces of a dice are given in ascending order of their corresponding labels.\n\nIn the second line, six integers assigned to faces of another dice are given in ascending order of their corresponding labels.\n\nOutput\n\nPrint \"Yes\" if two dices are identical, otherwise \"No\" in a line.\n\nConstraints\n\n$0 \\leq $ the integer assigned to a face $ \\leq 100$\n\nSample Input 1\n\n1 2 3 4 5 6\n6 2 4 3 5 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n1 2 3 4 5 6\n6 5 4 3 2 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3233, "cpu_time_ms": 110, "memory_kb": 15672}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s196855674", "group_id": "codeNet:p02386", "input_text": "function Dice(num) {\n this.top = num[0];\n this.front = num[1];\n this.right = num[2];\n this.left = num[3];\n this.back = num[4];\n this.bottom = num[5]\n\n this.roll = function(direction) {\n var tmp;\n switch (direction) {\n case 'E':\n tmp = this.top;\n this.top = this.left;\n this.left = this.bottom;\n this.bottom = this.right;\n this.right = tmp;\n break;\n case 'N':\n tmp = this.top;\n this.top = this.front;\n this.front = this.bottom;\n this.bottom = this.back;\n this.back = tmp;\n break;\n case 'S':\n tmp = this.top;\n this.top = this.back;\n this.back = this.bottom;\n this.bottom = this.front;\n this.front = tmp;\n break;\n case 'W':\n tmp = this.top;\n this.top = this.right;\n this.right = this.bottom;\n this.bottom = this.left;\n this.left = tmp\n break;\n }\n }\n\n this.turn = function(direction) {\n switch (direction) {\n case 'R':\n tmp = this.front;\n this.front = this.right;\n this.right = this.back;\n this.back = this.left;\n this.left = tmp;\n break;\n case 'L':\n tmp = this.front;\n this.front = this.left;\n this.left = this.back;\n this.back = this.right;\n this.right = tmp\n break;\n }\n }\n\n this.setTop = function(topNum) {\n switch (topNum) {\n case this.top:\n break;\n case this.front:\n this.roll('N');\n break;\n case this.right:\n this.roll('W');\n break;\n case this.left:\n this.roll('E');\n break;\n case this.back:\n this.roll('S');\n break;\n case this.bottom:\n this.roll('N');\n this.roll('N');\n break;\n }\n }\n\n this.setFront = function(frontNum) {\n switch (frontNum) {\n case this.top:\n break;\n case this.front:\n break;\n case this.right:\n this.turn('R');\n break;\n case this.left:\n this.turn('L');\n break;\n case this.back:\n this.turn('R');\n this.turn('R');\n break;\n case this.bottom:\n break;\n }\n }\n}\n\n\nvar input = \"\"\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\n \nprocess.stdin.on('end', function() {\n input = input.split(\"\\n\");\n\n var n = Number(input[0]);\n var origin_dice = new Dice(input[1].split(' ').map(Number));\n var result = 'Yes'\n\n for (i = 2; i < 1 + n; i++) {\n var target_dice = new Dice(input[i].split(' ').map(Number));\n for (j = 0; j < 8; j++) {\n for (k = 0; k < 4; k++) {\n if (origin_dice.top == target_dice.top &&\n origin_dice.front == target_dice.front &&\n origin_dice.right == target_dice.right &&\n origin_dice.left == target_dice.left &&\n origin_dice.back == target_dice.back &&\n origin_dice.bottom == target_dice.bottom) {\n result = 'No';\n }\n target_dice.turn('R');\n }\n if (j < 4) {\n target_dice.roll('N');\n } else {\n target_dice.roll('W');\n }\n }\n }\n console.log(result);\n});", "language": "JavaScript", "metadata": {"date": 1441239736, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02386.html", "problem_id": "p02386", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02386/input.txt", "sample_output_relpath": "derived/input_output/data/p02386/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02386/JavaScript/s196855674.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s196855674", "user_id": "u209022771"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "function Dice(num) {\n this.top = num[0];\n this.front = num[1];\n this.right = num[2];\n this.left = num[3];\n this.back = num[4];\n this.bottom = num[5]\n\n this.roll = function(direction) {\n var tmp;\n switch (direction) {\n case 'E':\n tmp = this.top;\n this.top = this.left;\n this.left = this.bottom;\n this.bottom = this.right;\n this.right = tmp;\n break;\n case 'N':\n tmp = this.top;\n this.top = this.front;\n this.front = this.bottom;\n this.bottom = this.back;\n this.back = tmp;\n break;\n case 'S':\n tmp = this.top;\n this.top = this.back;\n this.back = this.bottom;\n this.bottom = this.front;\n this.front = tmp;\n break;\n case 'W':\n tmp = this.top;\n this.top = this.right;\n this.right = this.bottom;\n this.bottom = this.left;\n this.left = tmp\n break;\n }\n }\n\n this.turn = function(direction) {\n switch (direction) {\n case 'R':\n tmp = this.front;\n this.front = this.right;\n this.right = this.back;\n this.back = this.left;\n this.left = tmp;\n break;\n case 'L':\n tmp = this.front;\n this.front = this.left;\n this.left = this.back;\n this.back = this.right;\n this.right = tmp\n break;\n }\n }\n\n this.setTop = function(topNum) {\n switch (topNum) {\n case this.top:\n break;\n case this.front:\n this.roll('N');\n break;\n case this.right:\n this.roll('W');\n break;\n case this.left:\n this.roll('E');\n break;\n case this.back:\n this.roll('S');\n break;\n case this.bottom:\n this.roll('N');\n this.roll('N');\n break;\n }\n }\n\n this.setFront = function(frontNum) {\n switch (frontNum) {\n case this.top:\n break;\n case this.front:\n break;\n case this.right:\n this.turn('R');\n break;\n case this.left:\n this.turn('L');\n break;\n case this.back:\n this.turn('R');\n this.turn('R');\n break;\n case this.bottom:\n break;\n }\n }\n}\n\n\nvar input = \"\"\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\n \nprocess.stdin.on('end', function() {\n input = input.split(\"\\n\");\n\n var n = Number(input[0]);\n var origin_dice = new Dice(input[1].split(' ').map(Number));\n var result = 'Yes'\n\n for (i = 2; i < 1 + n; i++) {\n var target_dice = new Dice(input[i].split(' ').map(Number));\n for (j = 0; j < 8; j++) {\n for (k = 0; k < 4; k++) {\n if (origin_dice.top == target_dice.top &&\n origin_dice.front == target_dice.front &&\n origin_dice.right == target_dice.right &&\n origin_dice.left == target_dice.left &&\n origin_dice.back == target_dice.back &&\n origin_dice.bottom == target_dice.bottom) {\n result = 'No';\n }\n target_dice.turn('R');\n }\n if (j < 4) {\n target_dice.roll('N');\n } else {\n target_dice.roll('W');\n }\n }\n }\n console.log(result);\n});", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDice IV\n\nWrite a program which reads $n$ dices constructed in the same way as Dice I, and determines whether they are all different. For the determination, use the same way as Dice III.\n\nInput\n\nIn the first line, the number of dices $n$ is given. In the following $n$ lines, six integers assigned to the dice faces are given respectively in the same way as Dice III.\n\nOutput\n\nPrint \"Yes\" if given dices are all different, otherwise \"No\" in a line.\n\nConstraints\n\n$2 \\leq n \\leq 100$\n\n$0 \\leq $ the integer assigned to a face $ \\leq 100$\n\nSample Input 1\n\n3\n1 2 3 4 5 6\n6 2 4 3 5 1\n6 5 4 3 2 1\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n3\n1 2 3 4 5 6\n6 5 4 3 2 1\n5 4 3 2 1 6\n\nSample Output 2\n\nYes", "sample_input": "3\n1 2 3 4 5 6\n6 2 4 3 5 1\n6 5 4 3 2 1\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02386", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nDice IV\n\nWrite a program which reads $n$ dices constructed in the same way as Dice I, and determines whether they are all different. For the determination, use the same way as Dice III.\n\nInput\n\nIn the first line, the number of dices $n$ is given. In the following $n$ lines, six integers assigned to the dice faces are given respectively in the same way as Dice III.\n\nOutput\n\nPrint \"Yes\" if given dices are all different, otherwise \"No\" in a line.\n\nConstraints\n\n$2 \\leq n \\leq 100$\n\n$0 \\leq $ the integer assigned to a face $ \\leq 100$\n\nSample Input 1\n\n3\n1 2 3 4 5 6\n6 2 4 3 5 1\n6 5 4 3 2 1\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n3\n1 2 3 4 5 6\n6 5 4 3 2 1\n5 4 3 2 1 6\n\nSample Output 2\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3328, "cpu_time_ms": 80, "memory_kb": 16264}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s661049007", "group_id": "codeNet:p02388", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function (chunk)\n{\n\tvar x = parseInt(chunk.trim(), 10);\n\tconsole.log(x * x * x);\n});", "language": "JavaScript", "metadata": {"date": 1430065488, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s661049007.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s661049007", "user_id": "u330842660"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function (chunk)\n{\n\tvar x = parseInt(chunk.trim(), 10);\n\tconsole.log(x * x * x);\n});", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 168, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s339500748", "group_id": "codeNet:p02388", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar lines = input;\n\nvar x = parseInt(lines, 10);\nvar kotae = x*x*x;\nconsole.log(kotae);", "language": "JavaScript", "metadata": {"date": 1430746197, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s339500748.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s339500748", "user_id": "u578350999"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar lines = input;\n\nvar x = parseInt(lines, 10);\nvar kotae = x*x*x;\nconsole.log(kotae);", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 149, "cpu_time_ms": 20, "memory_kb": 7380}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s979793913", "group_id": "codeNet:p02388", "input_text": "process.stdin.setEncoding('utf8');\nprocess.stdin.on('readable', function() {\n var c = process.stdin.read();\n console.log(c * c * c);\n});", "language": "JavaScript", "metadata": {"date": 1437531222, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s979793913.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s979793913", "user_id": "u330842660"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "process.stdin.setEncoding('utf8');\nprocess.stdin.on('readable', function() {\n var c = process.stdin.read();\n console.log(c * c * c);\n});", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 138, "cpu_time_ms": 20, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s958279010", "group_id": "codeNet:p02388", "input_text": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString();\n var x = inputs.trim().split('\\n').map(Number)[0];\n console.log(Math.pow(x,3));\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1439288048, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s958279010.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s958279010", "user_id": "u941151808"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString();\n var x = inputs.trim().split('\\n').map(Number)[0];\n console.log(Math.pow(x,3));\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 207, "cpu_time_ms": 20, "memory_kb": 7640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s809665291", "group_id": "codeNet:p02388", "input_text": "console.log(Math.pow(2,3));", "language": "JavaScript", "metadata": {"date": 1450421137, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s809665291.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s809665291", "user_id": "u922892514"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "console.log(Math.pow(2,3));", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 27, "cpu_time_ms": 50, "memory_kb": 15856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s206631622", "group_id": "codeNet:p02388", "input_text": "function a (x){\n console.log(x * x * x)\n}", "language": "JavaScript", "metadata": {"date": 1494306062, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s206631622.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s206631622", "user_id": "u158338651"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "function a (x){\n console.log(x * x * x)\n}", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 42, "cpu_time_ms": 60, "memory_kb": 14988}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s798546611", "group_id": "codeNet:p02388", "input_text": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n\n (function(x) {\n // ????????????????????????\n console.log(Math.pow(x,3))\n\n })(parseInt(inputs[0], 10)); // ??°?????????\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1497520920, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s798546611.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s798546611", "user_id": "u478273701"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n\n (function(x) {\n // ????????????????????????\n console.log(Math.pow(x,3))\n\n })(parseInt(inputs[0], 10)); // ??°?????????\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 268, "cpu_time_ms": 50, "memory_kb": 15760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s590390703", "group_id": "codeNet:p02388", "input_text": "x = 3;\nconsole.log(x*x*x);", "language": "JavaScript", "metadata": {"date": 1504863387, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s590390703.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s590390703", "user_id": "u616468142"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "x = 3;\nconsole.log(x*x*x);", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 26, "cpu_time_ms": 50, "memory_kb": 15612}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s785704506", "group_id": "codeNet:p02388", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\\n').map(Number);\nconsole.log(Math.pow(input[0], 3));", "language": "JavaScript", "metadata": {"date": 1509263793, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s785704506.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s785704506", "user_id": "u717529639"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8').split('\\n').map(Number);\nconsole.log(Math.pow(input[0], 3));", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 123, "cpu_time_ms": 60, "memory_kb": 15932}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s904149839", "group_id": "codeNet:p02388", "input_text": "function main(input) {\n console.log(Math.pow(Number(input), 3));\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1581427882, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02388.html", "problem_id": "p02388", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02388/input.txt", "sample_output_relpath": "derived/input_output/data/p02388/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02388/JavaScript/s904149839.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s904149839", "user_id": "u674778431"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "function main(input) {\n console.log(Math.pow(Number(input), 3));\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02388", "source_text": "X Cubic\n\nWrite a program which calculates the cube of a given integer x.\n\nInput\n\nAn integer x is given in a line.\n\nOutput\n\nPrint the cube of x in a line.\n\nConstraints\n\n1 ≤ x ≤ 100\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nSample Input 2\n\n3\n\nSample Output 2\n\n27", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 127, "cpu_time_ms": 80, "memory_kb": 15424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s469275803", "group_id": "codeNet:p02389", "input_text": "'use strict';\n(function(stdin) { \n var inputs = stdin.toString();\n var params = inputs.split('\\n')[0].split(' ').map(Number);\n (function(a,b) {\n //???????????????\n function f1 (a,b){\n return a*b;\n }\n function f2 (a,b){\n return (a+b)*2;\n }\n console.log(f1(a,b), f2(a,b));\n \n \n }(params[0],params[1])); \n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1437567961, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s469275803.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s469275803", "user_id": "u264218752"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "'use strict';\n(function(stdin) { \n var inputs = stdin.toString();\n var params = inputs.split('\\n')[0].split(' ').map(Number);\n (function(a,b) {\n //???????????????\n function f1 (a,b){\n return a*b;\n }\n function f2 (a,b){\n return (a+b)*2;\n }\n console.log(f1(a,b), f2(a,b));\n \n \n }(params[0],params[1])); \n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 20, "memory_kb": 7380}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s496172665", "group_id": "codeNet:p02389", "input_text": "'use strict';\n(function(stdin) { \n var inputs = stdin.toString();\n (function(array) {\n console.log(array.sort(function(a,b){\n return a - b;\n }).join(' '));\n }(inputs.split('\\n')[0].split(' ').map(Number))); \n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1438600498, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s496172665.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s496172665", "user_id": "u149005580"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "'use strict';\n(function(stdin) { \n var inputs = stdin.toString();\n (function(array) {\n console.log(array.sort(function(a,b){\n return a - b;\n }).join(' '));\n }(inputs.split('\\n')[0].split(' ').map(Number))); \n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 277, "cpu_time_ms": 20, "memory_kb": 7636}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s868386801", "group_id": "codeNet:p02389", "input_text": "process.stdin.resume()\nprocess.stdin.setEncoding('utf8')\nprocess.stdin.on('data', function (chunk) {\n const input = chunk.split(' ').map(Number)\n const area = input[0] * input[1]\n const outer = input[0] * 2 + input[1] * 2\n console.log(area + ' ' + outer)\n})", "language": "JavaScript", "metadata": {"date": 1481881510, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s868386801.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s868386801", "user_id": "u814468429"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "process.stdin.resume()\nprocess.stdin.setEncoding('utf8')\nprocess.stdin.on('data', function (chunk) {\n const input = chunk.split(' ').map(Number)\n const area = input[0] * input[1]\n const outer = input[0] * 2 + input[1] * 2\n console.log(area + ' ' + outer)\n})", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 262, "cpu_time_ms": 60, "memory_kb": 15508}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s053728275", "group_id": "codeNet:p02389", "input_text": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n var params = inputs[0].split(' ').map(Number);\n\n (function(a, b) {\n // ????????????????????????\n console.log((a + b)*2, a * b);\n\n })(params[0], params[1]);\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1497521302, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s053728275.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s053728275", "user_id": "u561206076"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n var params = inputs[0].split(' ').map(Number);\n\n (function(a, b) {\n // ????????????????????????\n console.log((a + b)*2, a * b);\n\n })(params[0], params[1]);\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 305, "cpu_time_ms": 50, "memory_kb": 15380}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s328227185", "group_id": "codeNet:p02389", "input_text": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n var params = inputs[0].split(' ').map(Number);\n\n (function(a, b) {\n // ????????????????????????\n console.log(a * b, (a + b) * 2);\n\n\n })(params[0], params[1]);\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1497528233, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s328227185.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s328227185", "user_id": "u135613465"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n var params = inputs[0].split(' ').map(Number);\n\n (function(a, b) {\n // ????????????????????????\n console.log(a * b, (a + b) * 2);\n\n\n })(params[0], params[1]);\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 308, "cpu_time_ms": 70, "memory_kb": 15428}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s291875208", "group_id": "codeNet:p02389", "input_text": "//??????????????¨?????????\nprocess.stdin.resume();\n\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function (chunk) {\n const chunks = chunk.split(' ');\n var hight = parseInt(chunks[0]);\n var width = parseInt(chunks[1]);\n var areaOfRectanglar = hight * width;\n var lengthOfRectanglar = (hight + width) * 2;\n console.log(areaOfRectanglar, lengthOfRectanglar);\n})", "language": "JavaScript", "metadata": {"date": 1507815710, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s291875208.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s291875208", "user_id": "u376918823"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "//??????????????¨?????????\nprocess.stdin.resume();\n\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function (chunk) {\n const chunks = chunk.split(' ');\n var hight = parseInt(chunks[0]);\n var width = parseInt(chunks[1]);\n var areaOfRectanglar = hight * width;\n var lengthOfRectanglar = (hight + width) * 2;\n console.log(areaOfRectanglar, lengthOfRectanglar);\n})", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 60, "memory_kb": 15672}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s377463845", "group_id": "codeNet:p02389", "input_text": "x = require('fs').readFileSync('/dev/stdin', 'utf8');\narr = x.split(\" \");\n[a, b] = arr.map(e => parseInt(e));\nconsole.log(a*b+' '+2*(a+b));\n\n", "language": "JavaScript", "metadata": {"date": 1526813449, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s377463845.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s377463845", "user_id": "u306884857"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "x = require('fs').readFileSync('/dev/stdin', 'utf8');\narr = x.split(\" \");\n[a, b] = arr.map(e => parseInt(e));\nconsole.log(a*b+' '+2*(a+b));\n\n", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 142, "cpu_time_ms": 70, "memory_kb": 15160}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s008369987", "group_id": "codeNet:p02389", "input_text": "const print2elm = (a,b) => f => console.log(f(a,b));\n\nconst input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst [a,b] = input.split(\" \").map(Number);\nconst calc = print2elm(a,b);\n\ncalc((a,b) => a*b);\ncalc((a,b) => (a+b)*2);\n", "language": "JavaScript", "metadata": {"date": 1529058890, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s008369987.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s008369987", "user_id": "u641702731"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "const print2elm = (a,b) => f => console.log(f(a,b));\n\nconst input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst [a,b] = input.split(\" \").map(Number);\nconst calc = print2elm(a,b);\n\ncalc((a,b) => a*b);\ncalc((a,b) => (a+b)*2);\n", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 236, "cpu_time_ms": 90, "memory_kb": 15172}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s563608249", "group_id": "codeNet:p02389", "input_text": "var inputs = require('fs').readFileSync('/dev/stdin', 'utf8').split(\" \");\nh = inputs[0];\nw = inputs[1];\nw = parseInt(w, 10);\nh = parseInt(h, 10);\n\nconsole.log(h*w, 2*(h+w));\n\n", "language": "JavaScript", "metadata": {"date": 1594447583, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02389.html", "problem_id": "p02389", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02389/input.txt", "sample_output_relpath": "derived/input_output/data/p02389/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02389/JavaScript/s563608249.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s563608249", "user_id": "u041233760"}, "prompt_components": {"gold_output": "15 16\n", "input_to_evaluate": "var inputs = require('fs').readFileSync('/dev/stdin', 'utf8').split(\" \");\nh = inputs[0];\nw = inputs[1];\nw = parseInt(w, 10);\nh = parseInt(h, 10);\n\nconsole.log(h*w, 2*(h+w));\n\n", "problem_context": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "sample_input": "3 5\n"}, "reference_outputs": ["15 16\n"], "source_document_id": "p02389", "source_text": "Rectangle\n\nWrite a program which calculates the area and perimeter of a given rectangle.\n\nInput\n\nThe length a and breadth b of the rectangle are given in a line separated by a single space.\n\nOutput\n\nPrint the area and perimeter of the rectangle in a line. The two integers should be separated by a single space.\n\nConstraints\n\n1 ≤ a, b ≤ 100\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n15 16", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 175, "cpu_time_ms": 70, "memory_kb": 15120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s289271292", "group_id": "codeNet:p02390", "input_text": "function main() {\n var d = new Date(input[0]);\n console.log(d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds())\n}\n\nvar\ninput = '';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "language": "JavaScript", "metadata": {"date": 1431932147, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/JavaScript/s289271292.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s289271292", "user_id": "u410345010"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "function main() {\n var d = new Date(input[0]);\n console.log(d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds())\n}\n\nvar\ninput = '';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n main();\n});", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345, "cpu_time_ms": 20, "memory_kb": 7744}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s527624021", "group_id": "codeNet:p02390", "input_text": "\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk){\nvar line = chunk.toString().split('\\n');\nvar seconds = Number(line[0]);\nvar hour_sec = 60*60;\nvar minute_sec = 60;\n\nvar hour = Math.floor(seconds / hour_sec);\nvar minute = Math.floor((seconds % hour_sec) / minute_sec);\nvar sec = seconds % hour_sec % minute_sec;\n\nconsole.log(hour + ':'+minute+':'+sec);\n});", "language": "JavaScript", "metadata": {"date": 1450451560, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/JavaScript/s527624021.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s527624021", "user_id": "u922892514"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function(chunk){\nvar line = chunk.toString().split('\\n');\nvar seconds = Number(line[0]);\nvar hour_sec = 60*60;\nvar minute_sec = 60;\n\nvar hour = Math.floor(seconds / hour_sec);\nvar minute = Math.floor((seconds % hour_sec) / minute_sec);\nvar sec = seconds % hour_sec % minute_sec;\n\nconsole.log(hour + ':'+minute+':'+sec);\n});", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 409, "cpu_time_ms": 60, "memory_kb": 15548}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s071777716", "group_id": "codeNet:p02390", "input_text": "var stdin = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar input = stdin.toString().trim().split('\\n');\n\nvar S = parseInt(input[0], 10);\nvar h = Math.floor(S / (60 * 60));\nvar m = Math.floor(S % (60 * 60) / 60);\nvar s = Math.floor(S % 60);\n\n\nconsole.log([h,m,s].join(':'));", "language": "JavaScript", "metadata": {"date": 1471865913, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/JavaScript/s071777716.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s071777716", "user_id": "u607628589"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "var stdin = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar input = stdin.toString().trim().split('\\n');\n\nvar S = parseInt(input[0], 10);\nvar h = Math.floor(S / (60 * 60));\nvar m = Math.floor(S % (60 * 60) / 60);\nvar s = Math.floor(S % 60);\n\n\nconsole.log([h,m,s].join(':'));", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 280, "cpu_time_ms": 60, "memory_kb": 15600}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s625769535", "group_id": "codeNet:p02390", "input_text": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n\n (function(S) {\n // ????????????????????????\n \n\n\n })(parseInt(inputs[0], 10)); // ??°?????????\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1498357974, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02390.html", "problem_id": "p02390", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02390/input.txt", "sample_output_relpath": "derived/input_output/data/p02390/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02390/JavaScript/s625769535.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s625769535", "user_id": "u775942576"}, "prompt_components": {"gold_output": "13:2:59\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString().trim().split('\\n');\n\n (function(S) {\n // ????????????????????????\n \n\n\n })(parseInt(inputs[0], 10)); // ??°?????????\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "sample_input": "46979\n"}, "reference_outputs": ["13:2:59\n"], "source_document_id": "p02390", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nWatch\n\nWrite a program which reads an integer $S$ [second] and converts it to $h:m:s$ where $h$, $m$, $s$ denote hours, minutes (less than 60) and seconds (less than 60) respectively.\n\nInput\n\nAn integer $S$ is given in a line.\n\nOutput\n\nPrint $h$, $m$ and $s$ separated by ':'. You do not need to put '0' for a value, which consists of a digit.\n\nConstraints\n\n$0 \\leq S \\leq 86400$\n\nSample Input 1\n\n46979\n\nSample Output 1\n\n13:2:59", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 244, "cpu_time_ms": 50, "memory_kb": 15188}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s459438811", "group_id": "codeNet:p02391", "input_text": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString();\n var params = inputs.split('\\n')[0].split(' ').map(Number);\n (function(a, b) {\n if (a < b) {\n console.log('a < b');\n } else if (a > b) {\n console.log('a > b');\n } else {\n console.log('a = b');\n } //????????????????????????\n }(params[0], params[1]));\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1438082345, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/JavaScript/s459438811.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s459438811", "user_id": "u434064811"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var inputs = stdin.toString();\n var params = inputs.split('\\n')[0].split(' ').map(Number);\n (function(a, b) {\n if (a < b) {\n console.log('a < b');\n } else if (a > b) {\n console.log('a > b');\n } else {\n console.log('a = b');\n } //????????????????????????\n }(params[0], params[1]));\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 441, "cpu_time_ms": 20, "memory_kb": 7376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s453765883", "group_id": "codeNet:p02391", "input_text": "'use strict';\n(function(stdin) {\n\n var inputs = stdin.toString().trim().split(' ');\n\n var a = Number(inputs[0]);\n var b = Number(inputs[1]);\n if (a < b) {\n console.log('a < b');\n } else if (a > b) {\n console.log('a > b');\n } else {\n console.log('a == b');\n }\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1471885693, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/JavaScript/s453765883.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s453765883", "user_id": "u317488783"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n\n var inputs = stdin.toString().trim().split(' ');\n\n var a = Number(inputs[0]);\n var b = Number(inputs[1]);\n if (a < b) {\n console.log('a < b');\n } else if (a > b) {\n console.log('a > b');\n } else {\n console.log('a == b');\n }\n\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 355, "cpu_time_ms": 60, "memory_kb": 15524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s479860162", "group_id": "codeNet:p02391", "input_text": "var arr = require('fs')\n\t.readFileSync('/dev/stdin', 'utf8')\n\t.split(\" \")\n\t.map(function(elem) { return elem|0; });\nif (arr[0] == arr[1]) console.log(\"a == b\");\nelse if (arr[0] > arr[1]) console.log(\"a > b\");\nelse console.log(\"a < b\");", "language": "JavaScript", "metadata": {"date": 1479036809, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02391.html", "problem_id": "p02391", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02391/input.txt", "sample_output_relpath": "derived/input_output/data/p02391/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02391/JavaScript/s479860162.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s479860162", "user_id": "u656368260"}, "prompt_components": {"gold_output": "a\n", "input_to_evaluate": "var arr = require('fs')\n\t.readFileSync('/dev/stdin', 'utf8')\n\t.split(\" \")\n\t.map(function(elem) { return elem|0; });\nif (arr[0] == arr[1]) console.log(\"a == b\");\nelse if (arr[0] > arr[1]) console.log(\"a > b\");\nelse console.log(\"a < b\");", "problem_context": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "sample_input": "1 2\n"}, "reference_outputs": ["a\n"], "source_document_id": "p02391", "source_text": "Small, Large, or Equal\n\nWrite a program which prints small/large/equal relation of given two integers a and b.\n\nInput\n\nTwo integers a and b separated by a single space are given in a line.\n\nOutput\n\nFor given two integers a and b, print\n\na < b\n\nif a is less than b,\n\na > b\n\nif a is greater than b, and\n\na == b\n\nif a equals to b.\n\nConstraints\n\n-1000 ≤ a, b ≤ 1000\n\nSample Input 1\n\n1 2\n\nSample Output 1\n\na < b\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\na > b\n\nSample Input 3\n\n5 5\n\nSample Output 3\n\na == b", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 235, "cpu_time_ms": 50, "memory_kb": 15512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s896847623", "group_id": "codeNet:p02392", "input_text": "'use strict';\n(function(stdin) { \n var inputs = stdin.toString();\n var params = inputs.split('\\n')[0].split(' ').map(Number);\n (function(a,b,c) {\n if(a a >c){\n console.log('1 3 8');\n }else{\n console.log('error');\n }\n //????????????????????????\n\n }(params[0],params[1],params[2])); \n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1438083208, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02393.html", "problem_id": "p02393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02393/input.txt", "sample_output_relpath": "derived/input_output/data/p02393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02393/JavaScript/s916302118.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s916302118", "user_id": "u149005580"}, "prompt_components": {"gold_output": "1 3 8\n", "input_to_evaluate": "'use strict';\n(function(stdin) { \n var inputs = stdin.toString();\n var params = inputs.split('\\n')[0].split(' ').map(Number);\n (function(a,b,c) {\n if(b > a >c){\n console.log('1 3 8');\n }else{\n console.log('error');\n }\n //????????????????????????\n\n }(params[0],params[1],params[2])); \n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "sample_input": "3 8 1\n"}, "reference_outputs": ["1 3 8\n"], "source_document_id": "p02393", "source_text": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 363, "cpu_time_ms": 20, "memory_kb": 7376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s156562495", "group_id": "codeNet:p02393", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function (input) {\n //??\\????????????????????????????????????\n var inputArray = input.split(' ');\n //??\\?????????????????°????????????\n var num = inputArray.map(function(x){\n return parseInt(x);\n });\n console.log(num.sort()[0],num.sort[1],num.sort[2]);\n});", "language": "JavaScript", "metadata": {"date": 1507903298, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02393.html", "problem_id": "p02393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02393/input.txt", "sample_output_relpath": "derived/input_output/data/p02393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02393/JavaScript/s156562495.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s156562495", "user_id": "u376918823"}, "prompt_components": {"gold_output": "1 3 8\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nprocess.stdin.on('data', function (input) {\n //??\\????????????????????????????????????\n var inputArray = input.split(' ');\n //??\\?????????????????°????????????\n var num = inputArray.map(function(x){\n return parseInt(x);\n });\n console.log(num.sort()[0],num.sort[1],num.sort[2]);\n});", "problem_context": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "sample_input": "3 8 1\n"}, "reference_outputs": ["1 3 8\n"], "source_document_id": "p02393", "source_text": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 366, "cpu_time_ms": 60, "memory_kb": 15420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s834332299", "group_id": "codeNet:p02393", "input_text": "var x = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar y = x.split(' ').map(Number);\nvar arr = y.sort();\nconsole.log(arr[0], arr[1], arr[2]);\n", "language": "JavaScript", "metadata": {"date": 1580871174, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02393.html", "problem_id": "p02393", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02393/input.txt", "sample_output_relpath": "derived/input_output/data/p02393/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02393/JavaScript/s834332299.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s834332299", "user_id": "u822711961"}, "prompt_components": {"gold_output": "1 3 8\n", "input_to_evaluate": "var x = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar y = x.split(' ').map(Number);\nvar arr = y.sort();\nconsole.log(arr[0], arr[1], arr[2]);\n", "problem_context": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "sample_input": "3 8 1\n"}, "reference_outputs": ["1 3 8\n"], "source_document_id": "p02393", "source_text": "Sorting Three Numbers\n\nWrite a program which reads three integers, and prints them in ascending order.\n\nInput\n\nThree integers separated by a single space are given in a line.\n\nOutput\n\nPrint the given integers in ascending order in a line. Put a single space between two integers.\n\nConstraints\n\n1 ≤ the three integers ≤ 10000\n\nSample Input 1\n\n3 8 1\n\nSample Output 1\n\n1 3 8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 149, "cpu_time_ms": 80, "memory_kb": 15412}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s609439178", "group_id": "codeNet:p02394", "input_text": "var v = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar n = v.split(\" \").map(Number);\nvar W = n[0], H = n[1], x = n[2], y = n[3], r = n[4];\nif (x-r >= 0 && y-r >= 0 && x-r < W && y-r < W && x < H && y < H && r >= 0 && r < W && r < H){\n console.log(\"Yes\");\n} else {\n console.log(\"No\")\n}\n", "language": "JavaScript", "metadata": {"date": 1580871832, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02394.html", "problem_id": "p02394", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02394/input.txt", "sample_output_relpath": "derived/input_output/data/p02394/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02394/JavaScript/s609439178.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s609439178", "user_id": "u013287069"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "var v = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar n = v.split(\" \").map(Number);\nvar W = n[0], H = n[1], x = n[2], y = n[3], r = n[4];\nif (x-r >= 0 && y-r >= 0 && x-r < W && y-r < W && x < H && y < H && r >= 0 && r < W && r < H){\n console.log(\"Yes\");\n} else {\n console.log(\"No\")\n}\n", "problem_context": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "sample_input": "5 4 2 2 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02394", "source_text": "MathJax.Hub.Config({ tex2jax: { inlineMath: [[\"$\",\"$\"], [\"\\\\(\",\"\\\\)\"]], processEscapes: true }});\n\nCircle in a Rectangle\n\nWrite a program which reads a rectangle and a circle, and determines whether the circle is arranged inside the rectangle. As shown in the following figures, the upper right coordinate $(W, H)$ of the rectangle and the central coordinate $(x, y)$ and radius $r$ of the circle are given.\n\nInput\n\nFive integers $W$, $H$, $x$, $y$ and $r$ separated by a single space are given in a line.\n\nOutput\n\nPrint \"Yes\" if the circle is placed inside the rectangle, otherwise \"No\" in a line.\n\nConstraints\n\n$ -100 \\leq x, y \\leq 100$\n\n$ 0 < W, H, r \\leq 100$\n\nSample Input 1\n\n5 4 2 2 1\n\nSample Output 1\n\nYes\n\nSample Input 2\n\n5 4 2 4 1\n\nSample Output 2\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 298, "cpu_time_ms": 80, "memory_kb": 15364}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s041310498", "group_id": "codeNet:p02396", "input_text": "'use strict';\nprocess.stdin.on('data', function(chunk) {\n // ????????????????????????\n var inputs = chunk.toString().trim();\n var cols = inputs.split(' ').map(Number);\n var a = cols[0];\n var b = cols[1];\n\n console.log(Math.floor(a / b)\n , a % b\n , (a / b).toFixed(10)\n );\n\n\n});\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');", "language": "JavaScript", "metadata": {"date": 1447993635, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/JavaScript/s041310498.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s041310498", "user_id": "u261533743"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "'use strict';\nprocess.stdin.on('data', function(chunk) {\n // ????????????????????????\n var inputs = chunk.toString().trim();\n var cols = inputs.split(' ').map(Number);\n var a = cols[0];\n var b = cols[1];\n\n console.log(Math.floor(a / b)\n , a % b\n , (a / b).toFixed(10)\n );\n\n\n});\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 344, "cpu_time_ms": 60, "memory_kb": 15924}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s311878966", "group_id": "codeNet:p02396", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n\nvar inputs = chunk.toString().trim().split('\\n').map(Number);\n\n for (var i = 0; i < inputs.length; i++) {\n if (inputs[i] === 0) {\n break;\n }\n console.log('Case ' + (i + 1) + ': ' + inputs[i]);\n }\n\n});", "language": "JavaScript", "metadata": {"date": 1450626532, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/JavaScript/s311878966.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s311878966", "user_id": "u922892514"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n\nvar inputs = chunk.toString().trim().split('\\n').map(Number);\n\n for (var i = 0; i < inputs.length; i++) {\n if (inputs[i] === 0) {\n break;\n }\n console.log('Case ' + (i + 1) + ': ' + inputs[i]);\n }\n\n});", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 342, "cpu_time_ms": 180, "memory_kb": 20712}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s106742097", "group_id": "codeNet:p02396", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n \nvar inputs = chunk.toString().trim().split('\\n');\nfor (var i = 0; i < inputs .length; i++) {\n if (inputs [i] === 0) {\n break;\n }\n console.log('Case ' + (i + 1) + ': ' + inputs[i]);\n}\n \n \n});", "language": "JavaScript", "metadata": {"date": 1450670153, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/JavaScript/s106742097.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s106742097", "user_id": "u922892514"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n \nvar inputs = chunk.toString().trim().split('\\n');\nfor (var i = 0; i < inputs .length; i++) {\n if (inputs [i] === 0) {\n break;\n }\n console.log('Case ' + (i + 1) + ': ' + inputs[i]);\n}\n \n \n});", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 327, "cpu_time_ms": 180, "memory_kb": 20660}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s992098619", "group_id": "codeNet:p02396", "input_text": "function main(tmp) {\n var i=0;\n while(tmp[i]!=0){\n console.log(\"Case \" + (i+1) + \": \" + tmp[i]);\n i = i + 1;\n }\n}\nvar lines = [];\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nreader.on('line', function (line) {\n lines += line;\n if(line==0){\n \tmain(lines);\n \tlines='';\n }\n});\nprocess.stdin.on('end', function () {\n});", "language": "JavaScript", "metadata": {"date": 1479346610, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/JavaScript/s992098619.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s992098619", "user_id": "u588551436"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "function main(tmp) {\n var i=0;\n while(tmp[i]!=0){\n console.log(\"Case \" + (i+1) + \": \" + tmp[i]);\n i = i + 1;\n }\n}\nvar lines = [];\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nreader.on('line', function (line) {\n lines += line;\n if(line==0){\n \tmain(lines);\n \tlines='';\n }\n});\nprocess.stdin.on('end', function () {\n});", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 403, "cpu_time_ms": 80, "memory_kb": 18744}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s961297907", "group_id": "codeNet:p02396", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar sp = input.split(\"\\n\").map(Number);\nfor( var i = 0; sp[i] !== 0; i++ ) {\n console.log(\"Case \" + ( i + 1 ) + \": \" + sp[i] ); \n}", "language": "JavaScript", "metadata": {"date": 1512287085, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/JavaScript/s961297907.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s961297907", "user_id": "u852592538"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar sp = input.split(\"\\n\").map(Number);\nfor( var i = 0; sp[i] !== 0; i++ ) {\n console.log(\"Case \" + ( i + 1 ) + \": \" + sp[i] ); \n}", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 194, "cpu_time_ms": 190, "memory_kb": 23152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s837945220", "group_id": "codeNet:p02396", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nprocess.stdin.on('data', function (chunk) {\n const n = chunk.toString().split(\"\\n\");\n n.forEach((x, i) => {\n if (x != 0) {\n console.log(`Case ${i + 1}: ${x}`);\n }\n });\n});\n", "language": "JavaScript", "metadata": {"date": 1565158955, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02396.html", "problem_id": "p02396", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02396/input.txt", "sample_output_relpath": "derived/input_output/data/p02396/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02396/JavaScript/s837945220.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s837945220", "user_id": "u107785387"}, "prompt_components": {"gold_output": "Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nprocess.stdin.on('data', function (chunk) {\n const n = chunk.toString().split(\"\\n\");\n n.forEach((x, i) => {\n if (x != 0) {\n console.log(`Case ${i + 1}: ${x}`);\n }\n });\n});\n", "problem_context": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "sample_input": "3\n5\n11\n7\n8\n19\n0\n"}, "reference_outputs": ["Case 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19\n"], "source_document_id": "p02396", "source_text": "Print Test Cases\n\nIn the online judge system, a judge file may include multiple datasets to check whether the submitted program outputs a correct answer for each test case. This task is to practice solving a problem with multiple datasets.\n\nWrite a program which reads an integer x and print it as is. Note that multiple datasets are given for this problem.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of an integer x in a line.\n\nThe input ends with an integer 0. You program should not process (print) for this terminal symbol.\n\nOutput\n\nFor each dataset, print x in the following format:\n\nCase i: x\n\nwhere i is the case number which starts with 1. Put a single space between \"Case\" and i. Also, put a single space between ':' and x.\n\nConstraints\n\n1 ≤ x ≤ 10000\n\nThe number of datasets ≤ 10000\n\nSample Input\n\n3\n5\n11\n7\n8\n19\n0\n\nSample Output\n\nCase 1: 3\nCase 2: 5\nCase 3: 11\nCase 4: 7\nCase 5: 8\nCase 6: 19", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 266, "cpu_time_ms": 190, "memory_kb": 22724}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s484393610", "group_id": "codeNet:p02397", "input_text": "'use strict';\nprocess.stdin.on('data', function(chunk) {\n var inputs = chunk.toString().trim().split('\\n');\n for (var i = 0; i parseInt(nums[1])){\n put=nums[1]+\" \"+nums[0];\n }else{\n put=nums[0]+\" \"+nums[1];\n }\n console.log(put);\n i++;\n \n }\n \n \n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf-8\"));\n", "language": "JavaScript", "metadata": {"date": 1567745056, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02397.html", "problem_id": "p02397", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02397/input.txt", "sample_output_relpath": "derived/input_output/data/p02397/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02397/JavaScript/s509278773.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s509278773", "user_id": "u259258361"}, "prompt_components": {"gold_output": "2 3\n2 2\n3 5\n", "input_to_evaluate": "function main(input){\n let lines = input.split(\"\\n\");\n let i=0;\n while(lines[i]!==\"0 0\"){\n let nums = lines[i].split(\" \");\n let put=\"\";\n if(parseInt(nums[0])>parseInt(nums[1])){\n put=nums[1]+\" \"+nums[0];\n }else{\n put=nums[0]+\" \"+nums[1];\n }\n console.log(put);\n i++;\n \n }\n \n \n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf-8\"));\n", "problem_context": "Swapping Two Numbers\n\nWrite a program which reads two integers x and y, and prints them in ascending order.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers x and y separated by a single space.\n\nThe input ends with two 0 (when both x and y are zero). Your program should not process for these terminal symbols.\n\nOutput\n\nFor each dataset, print x and y in ascending order in a line. Put a single space between x and y.\n\nConstraints\n\n0 ≤ x, y ≤ 10000\n\nthe number of datasets ≤ 3000\n\nSample Input\n\n3 2\n2 2\n5 3\n0 0\n\nSample Output\n\n2 3\n2 2\n3 5", "sample_input": "3 2\n2 2\n5 3\n0 0\n"}, "reference_outputs": ["2 3\n2 2\n3 5\n"], "source_document_id": "p02397", "source_text": "Swapping Two Numbers\n\nWrite a program which reads two integers x and y, and prints them in ascending order.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers x and y separated by a single space.\n\nThe input ends with two 0 (when both x and y are zero). Your program should not process for these terminal symbols.\n\nOutput\n\nFor each dataset, print x and y in ascending order in a line. Put a single space between x and y.\n\nConstraints\n\n0 ≤ x, y ≤ 10000\n\nthe number of datasets ≤ 3000\n\nSample Input\n\n3 2\n2 2\n5 3\n0 0\n\nSample Output\n\n2 3\n2 2\n3 5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 431, "cpu_time_ms": 120, "memory_kb": 18492}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s562909329", "group_id": "codeNet:p02398", "input_text": "var input = \"\"\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\n\nprocess.stdin.on('end', function() {\n input = input.split(\"\\n\");\n i = 0\n while (input[i] != 0) {\n arr = input[i].split(\" \");\n sum = 0;\n arr[0] = Number(arr[0]);\n arr[1] = Number(arr[1]);\n arr[2] = Number(arr[2]);\n\n for (j = arr[0]; j < arr[1]; j++) {\n if (arr[2] % j == 0) {\n sum++\n }\n }\n console.log(sum);\n i++;\n }\n});", "language": "JavaScript", "metadata": {"date": 1436237250, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02398.html", "problem_id": "p02398", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02398/input.txt", "sample_output_relpath": "derived/input_output/data/p02398/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02398/JavaScript/s562909329.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s562909329", "user_id": "u209022771"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "var input = \"\"\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\n\nprocess.stdin.on('end', function() {\n input = input.split(\"\\n\");\n i = 0\n while (input[i] != 0) {\n arr = input[i].split(\" \");\n sum = 0;\n arr[0] = Number(arr[0]);\n arr[1] = Number(arr[1]);\n arr[2] = Number(arr[2]);\n\n for (j = arr[0]; j < arr[1]; j++) {\n if (arr[2] % j == 0) {\n sum++\n }\n }\n console.log(sum);\n i++;\n }\n});", "problem_context": "How Many Divisors?\n\nWrite a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.\n\nInput\n\nThree integers a, b and c are given in a line separated by a single space.\n\nOutput\n\nPrint the number of divisors in a line.\n\nConstraints\n\n1 ≤ a, b, c ≤ 10000\n\na ≤ b\n\nSample Input 1\n\n5 14 80\n\nSample Output 1\n\n3", "sample_input": "5 14 80\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02398", "source_text": "How Many Divisors?\n\nWrite a program which reads three integers a, b and c, and prints the number of divisors of c between a and b.\n\nInput\n\nThree integers a, b and c are given in a line separated by a single space.\n\nOutput\n\nPrint the number of divisors in a line.\n\nConstraints\n\n1 ≤ a, b, c ≤ 10000\n\na ≤ b\n\nSample Input 1\n\n5 14 80\n\nSample Output 1\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 508, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s337025383", "group_id": "codeNet:p02399", "input_text": "'use strict';\n(function(stdin) {\n //declare function\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var cols = inputs[0].split(' ').map(Number);\n var d = parseInt(cols[0] / cols[1]);\n var l = cols[0] % cols[1];\n var f = parseFloat((cols[0] / cols[1]).toFixed(6));\n //main\n\n //display\n console.log(d, l, f);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'))", "language": "JavaScript", "metadata": {"date": 1497531307, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/JavaScript/s337025383.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s337025383", "user_id": "u561206076"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n //declare function\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var cols = inputs[0].split(' ').map(Number);\n var d = parseInt(cols[0] / cols[1]);\n var l = cols[0] % cols[1];\n var f = parseFloat((cols[0] / cols[1]).toFixed(6));\n //main\n\n //display\n console.log(d, l, f);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'))", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 395, "cpu_time_ms": 50, "memory_kb": 15856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s017024700", "group_id": "codeNet:p02399", "input_text": "'use strict';\n(function(stdin) {\n //declare function\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var cols = inputs[0].split(' ').map(Number);\n var d = parseInt(cols[0] / cols[1]);\n var l = cols[0] % cols[1];\n var f = parseFloat((cols[0] / cols[1]).toFixed(4));\n //main\n\n //display\n console.log(d, l, f);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'))", "language": "JavaScript", "metadata": {"date": 1497531388, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/JavaScript/s017024700.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s017024700", "user_id": "u561206076"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n //declare function\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var cols = inputs[0].split(' ').map(Number);\n var d = parseInt(cols[0] / cols[1]);\n var l = cols[0] % cols[1];\n var f = parseFloat((cols[0] / cols[1]).toFixed(4));\n //main\n\n //display\n console.log(d, l, f);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'))", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 395, "cpu_time_ms": 60, "memory_kb": 15536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s178804410", "group_id": "codeNet:p02399", "input_text": "'use strict';\n(function(stdin) {\n //declare function\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var a = inputs[0].split(' ')[0];\n var b = inputs[0].split(' ')[1];\n var d = parseInt(a / b);\n var r = a % b;\n var f = a * 100000000 / b;\n //main\n console.log(d, r, f / 100000000);\n //display\n //console.log(inputs);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1499250088, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/JavaScript/s178804410.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s178804410", "user_id": "u561206076"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n //declare function\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var a = inputs[0].split(' ')[0];\n var b = inputs[0].split(' ')[1];\n var d = parseInt(a / b);\n var r = a % b;\n var f = a * 100000000 / b;\n //main\n console.log(d, r, f / 100000000);\n //display\n //console.log(inputs);\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 406, "cpu_time_ms": 50, "memory_kb": 15760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s955659765", "group_id": "codeNet:p02399", "input_text": "function main(input) {\n var data = input.split(' ');\n var a = parseInt(data[0]);\n var b = parseInt(data[1]);\n var d = Math.floor(a / b);\n var r = a % b;\n var f = (a / b).toFixed(5);\n var output = [d, r, ,f].join(' ');\n console.log(output);\n}\n\nprocess.stdin.resume();\nvar input = ''; \nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n main(input);\n});", "language": "JavaScript", "metadata": {"date": 1508241881, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/JavaScript/s955659765.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s955659765", "user_id": "u376918823"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "function main(input) {\n var data = input.split(' ');\n var a = parseInt(data[0]);\n var b = parseInt(data[1]);\n var d = Math.floor(a / b);\n var r = a % b;\n var f = (a / b).toFixed(5);\n var output = [d, r, ,f].join(' ');\n console.log(output);\n}\n\nprocess.stdin.resume();\nvar input = ''; \nprocess.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', function(chunk) {\n input += chunk;\n});\nprocess.stdin.on('end', function() {\n main(input);\n});", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 465, "cpu_time_ms": 60, "memory_kb": 15736}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s061548932", "group_id": "codeNet:p02399", "input_text": "var x = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nvar array = x.split(\" \").map(Number);\n\nvar a = array[0];\nvar b = array[1];\nvar d = Math.floor( a / b);\nvar r = a % b;\nvar f = ( a / b ).toFixed(5);\n\nconsole.log(d + \" \" + r + \" \" + f);\n\n", "language": "JavaScript", "metadata": {"date": 1550216370, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02399.html", "problem_id": "p02399", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02399/input.txt", "sample_output_relpath": "derived/input_output/data/p02399/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02399/JavaScript/s061548932.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s061548932", "user_id": "u648117624"}, "prompt_components": {"gold_output": "1 1 1.50000\n", "input_to_evaluate": "var x = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nvar array = x.split(\" \").map(Number);\n\nvar a = array[0];\nvar b = array[1];\nvar d = Math.floor( a / b);\nvar r = a % b;\nvar f = ( a / b ).toFixed(5);\n\nconsole.log(d + \" \" + r + \" \" + f);\n\n", "problem_context": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "sample_input": "3 2\n"}, "reference_outputs": ["1 1 1.50000\n"], "source_document_id": "p02399", "source_text": "A/B Problem\n\nWrite a program which reads two integers a and b, and calculates the following values:\n\na ÷ b: d (in integer)\n\nremainder of a ÷ b: r (in integer)\n\na ÷ b: f (in real number)\n\nInput\n\nTwo integers a and b are given in a line.\n\nOutput\n\nPrint d, r and f separated by a space in a line. For f, the output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n1 ≤ a, b ≤ 109\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1 1 1.50000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 245, "cpu_time_ms": 80, "memory_kb": 17180}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s302265386", "group_id": "codeNet:p02400", "input_text": "'use strict';\n(function(stdin) {\n var lines = stdin.toString().split('\\n');\n var result = (function(r) {\n \treturn [\n \t\tNumber(Math.PI * r * r).toFixed(6)\n \t\t,Number(Math.PI * 2 * r).toFixed(6)\n \t].join(' ');\n }(parseInt(lines[0].trim(),10)\n ));\n console.log(result);\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1423729742, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02400.html", "problem_id": "p02400", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02400/input.txt", "sample_output_relpath": "derived/input_output/data/p02400/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02400/JavaScript/s302265386.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s302265386", "user_id": "u261533743"}, "prompt_components": {"gold_output": "12.566371 12.566371\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n var lines = stdin.toString().split('\\n');\n var result = (function(r) {\n \treturn [\n \t\tNumber(Math.PI * r * r).toFixed(6)\n \t\t,Number(Math.PI * 2 * r).toFixed(6)\n \t].join(' ');\n }(parseInt(lines[0].trim(),10)\n ));\n console.log(result);\n}(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "sample_input": "2\n"}, "reference_outputs": ["12.566371 12.566371\n"], "source_document_id": "p02400", "source_text": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 330, "cpu_time_ms": 20, "memory_kb": 7640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s341194858", "group_id": "codeNet:p02400", "input_text": "process.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', (input) => {\n var arry = input.split(' ');\n var r = parseInt(arry[0]);\n var pi = Math.PI;\n var result = 2 * pi * r;\n\n console.log(result.toFixed(6));\n})\n", "language": "JavaScript", "metadata": {"date": 1525994843, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02400.html", "problem_id": "p02400", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02400/input.txt", "sample_output_relpath": "derived/input_output/data/p02400/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02400/JavaScript/s341194858.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s341194858", "user_id": "u792186048"}, "prompt_components": {"gold_output": "12.566371 12.566371\n", "input_to_evaluate": "process.stdin.setEncoding('utf-8');\nprocess.stdin.on('data', (input) => {\n var arry = input.split(' ');\n var r = parseInt(arry[0]);\n var pi = Math.PI;\n var result = 2 * pi * r;\n\n console.log(result.toFixed(6));\n})\n", "problem_context": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "sample_input": "2\n"}, "reference_outputs": ["12.566371 12.566371\n"], "source_document_id": "p02400", "source_text": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 80, "memory_kb": 15252}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s697035429", "group_id": "codeNet:p02400", "input_text": "function Main(input){\n const r = Number(input);\n let S, L;\n S = (r * r * Math.PI).toFixed(6);\n L = (r * 2 * Math.PI).toFixed(6);\n console.log(S + \" \" + L);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1597588811, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02400.html", "problem_id": "p02400", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02400/input.txt", "sample_output_relpath": "derived/input_output/data/p02400/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02400/JavaScript/s697035429.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s697035429", "user_id": "u869952286"}, "prompt_components": {"gold_output": "12.566371 12.566371\n", "input_to_evaluate": "function Main(input){\n const r = Number(input);\n let S, L;\n S = (r * r * Math.PI).toFixed(6);\n L = (r * 2 * Math.PI).toFixed(6);\n console.log(S + \" \" + L);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "sample_input": "2\n"}, "reference_outputs": ["12.566371 12.566371\n"], "source_document_id": "p02400", "source_text": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 80, "memory_kb": 15096}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s510483135", "group_id": "codeNet:p02400", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst r = Number(input);\nconst pi = 3.141;\nconst area = (Math.pow(r, 2) * Math.PI).toFixed(6);\nconst len = ((r*2) * Math.PI).toFixed(6);\n\nconsole.log(area + ' ' + len);\n", "language": "JavaScript", "metadata": {"date": 1554433142, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02400.html", "problem_id": "p02400", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02400/input.txt", "sample_output_relpath": "derived/input_output/data/p02400/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02400/JavaScript/s510483135.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s510483135", "user_id": "u505539110"}, "prompt_components": {"gold_output": "12.566371 12.566371\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconst r = Number(input);\nconst pi = 3.141;\nconst area = (Math.pow(r, 2) * Math.PI).toFixed(6);\nconst len = ((r*2) * Math.PI).toFixed(6);\n\nconsole.log(area + ' ' + len);\n", "problem_context": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "sample_input": "2\n"}, "reference_outputs": ["12.566371 12.566371\n"], "source_document_id": "p02400", "source_text": "Circle\n\nWrite a program which calculates the area and circumference of a circle for given radius r.\n\nInput\n\nA real number r is given.\n\nOutput\n\nPrint the area and circumference of the circle in a line. Put a single space between them. The output should not contain an absolute error greater than 10-5.\n\nConstraints\n\n0 < r < 10000\n\nSample Input 1\n\n2\n\nSample Output 1\n\n12.566371 12.566371\n\nSample Input 2\n\n3\n\nSample Output 2\n\n28.274334 18.849556", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 233, "cpu_time_ms": 80, "memory_kb": 15344}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s095744795", "group_id": "codeNet:p02401", "input_text": "(function(input) {\n var lines = input.split('\\n');\n for (var i = 0; i < lines.length; i++) {\n var l = lines[i];\n if (l.match(/\\?/)) {\n break;\n }\n var r = Math.round(eval(l));\n console.log(r);\n }\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1428018357, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02401.html", "problem_id": "p02401", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02401/input.txt", "sample_output_relpath": "derived/input_output/data/p02401/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02401/JavaScript/s095744795.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s095744795", "user_id": "u759826653"}, "prompt_components": {"gold_output": "3\n38\n26\n10\n108\n", "input_to_evaluate": "(function(input) {\n var lines = input.split('\\n');\n for (var i = 0; i < lines.length; i++) {\n var l = lines[i];\n if (l.match(/\\?/)) {\n break;\n }\n var r = Math.round(eval(l));\n console.log(r);\n }\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Simple Calculator\n\nWrite a program which reads two integers a, b and an operator op, and then prints the value of a op b.\n\nThe operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.\n\nInput\n\nThe input consists of multiple datasets. Each dataset is given in the following format.\n\na op b\n\nThe input ends with a dataset where op = '?'. Your program should not process for this dataset.\n\nOutput\n\nFor each dataset, print the value in a line.\n\nConstraints\n\n0 ≤ a, b ≤ 20000\n\nNo divisions by zero are given.\n\nSample Input 1\n\n1 + 2\n56 - 18\n13 * 2\n100 / 10\n27 + 81\n0 ? 0\n\nSample Output 1\n\n3\n38\n26\n10\n108", "sample_input": "1 + 2\n56 - 18\n13 * 2\n100 / 10\n27 + 81\n0 ? 0\n"}, "reference_outputs": ["3\n38\n26\n10\n108\n"], "source_document_id": "p02401", "source_text": "Simple Calculator\n\nWrite a program which reads two integers a, b and an operator op, and then prints the value of a op b.\n\nThe operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.\n\nInput\n\nThe input consists of multiple datasets. Each dataset is given in the following format.\n\na op b\n\nThe input ends with a dataset where op = '?'. Your program should not process for this dataset.\n\nOutput\n\nFor each dataset, print the value in a line.\n\nConstraints\n\n0 ≤ a, b ≤ 20000\n\nNo divisions by zero are given.\n\nSample Input 1\n\n1 + 2\n56 - 18\n13 * 2\n100 / 10\n27 + 81\n0 ? 0\n\nSample Output 1\n\n3\n38\n26\n10\n108", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 303, "cpu_time_ms": 20, "memory_kb": 7644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s213987523", "group_id": "codeNet:p02401", "input_text": "'use strict';\nprocess.stdin.on('data', function(chunk) {\n var inputs = chunk.toString().trim();\n var expressions = inputs.split('\\n');\n \n for (var i = 0; i < expressions.length; i++) {\n if (expressions[i] === '0 ? 0') {\n break;\n }\n var expression = expressions[i].split(' ');\n var left = parseFloat(expression[0]);\n var right = parseFloat(expression[2]);\n var op = expression[1];\n \n switch (op) {\n case '+':\n console.log(left + right);\n break;\n case '-':\n console.log(left - right);\n break;\n case '*':\n console.log(left * right);\n break;\n case '/':\n console.log(Math.floor(left / right));\n break;\n }\n \n }\n \n});\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');", "language": "JavaScript", "metadata": {"date": 1448328157, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02401.html", "problem_id": "p02401", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02401/input.txt", "sample_output_relpath": "derived/input_output/data/p02401/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02401/JavaScript/s213987523.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s213987523", "user_id": "u825070109"}, "prompt_components": {"gold_output": "3\n38\n26\n10\n108\n", "input_to_evaluate": "'use strict';\nprocess.stdin.on('data', function(chunk) {\n var inputs = chunk.toString().trim();\n var expressions = inputs.split('\\n');\n \n for (var i = 0; i < expressions.length; i++) {\n if (expressions[i] === '0 ? 0') {\n break;\n }\n var expression = expressions[i].split(' ');\n var left = parseFloat(expression[0]);\n var right = parseFloat(expression[2]);\n var op = expression[1];\n \n switch (op) {\n case '+':\n console.log(left + right);\n break;\n case '-':\n console.log(left - right);\n break;\n case '*':\n console.log(left * right);\n break;\n case '/':\n console.log(Math.floor(left / right));\n break;\n }\n \n }\n \n});\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');", "problem_context": "Simple Calculator\n\nWrite a program which reads two integers a, b and an operator op, and then prints the value of a op b.\n\nThe operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.\n\nInput\n\nThe input consists of multiple datasets. Each dataset is given in the following format.\n\na op b\n\nThe input ends with a dataset where op = '?'. Your program should not process for this dataset.\n\nOutput\n\nFor each dataset, print the value in a line.\n\nConstraints\n\n0 ≤ a, b ≤ 20000\n\nNo divisions by zero are given.\n\nSample Input 1\n\n1 + 2\n56 - 18\n13 * 2\n100 / 10\n27 + 81\n0 ? 0\n\nSample Output 1\n\n3\n38\n26\n10\n108", "sample_input": "1 + 2\n56 - 18\n13 * 2\n100 / 10\n27 + 81\n0 ? 0\n"}, "reference_outputs": ["3\n38\n26\n10\n108\n"], "source_document_id": "p02401", "source_text": "Simple Calculator\n\nWrite a program which reads two integers a, b and an operator op, and then prints the value of a op b.\n\nThe operator op is '+', '-', '*' or '/' (sum, difference, product or quotient). The division should truncate any fractional part.\n\nInput\n\nThe input consists of multiple datasets. Each dataset is given in the following format.\n\na op b\n\nThe input ends with a dataset where op = '?'. Your program should not process for this dataset.\n\nOutput\n\nFor each dataset, print the value in a line.\n\nConstraints\n\n0 ≤ a, b ≤ 20000\n\nNo divisions by zero are given.\n\nSample Input 1\n\n1 + 2\n56 - 18\n13 * 2\n100 / 10\n27 + 81\n0 ? 0\n\nSample Output 1\n\n3\n38\n26\n10\n108", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 912, "cpu_time_ms": 60, "memory_kb": 15924}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s201910261", "group_id": "codeNet:p02403", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=input.split(\"\\n\");\nvar str=\"\";\nfor(var i=0;ir.split(' ')\n .map(Number))\n .map(([H,W])=>[...Array(H).keys()]\n .map((val,i,a)=>((!i || i===Math.max(...a)) ?'#':'.')\n .repeat(W)\n .replace(/(^\\.|\\.$)/g,'#'))\n .join('\\n'))\n .join('\\n\\n')\n .concat('\\n');\nconsole.log(res)\n", "language": "JavaScript", "metadata": {"date": 1540957956, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02404.html", "problem_id": "p02404", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02404/input.txt", "sample_output_relpath": "derived/input_output/data/p02404/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02404/JavaScript/s004223217.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s004223217", "user_id": "u671828647"}, "prompt_components": {"gold_output": "####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n", "input_to_evaluate": "const res = require('fs').readFileSync('/dev/stdin','utf8')\n .match(/^[\\s\\S]*?(?=\\n0 0)/g)[0]\n .split('\\n')\n .map(r=>r.split(' ')\n .map(Number))\n .map(([H,W])=>[...Array(H).keys()]\n .map((val,i,a)=>((!i || i===Math.max(...a)) ?'#':'.')\n .repeat(W)\n .replace(/(^\\.|\\.$)/g,'#'))\n .join('\\n'))\n .join('\\n\\n')\n .concat('\\n');\nconsole.log(res)\n", "problem_context": "Print a Frame\n\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n##########\n#........#\n#........#\n#........#\n#........#\n##########\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the frame made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n3 ≤ H ≤ 300\n\n3 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n0 0\n\nSample Output\n\n####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###", "sample_input": "3 4\n5 6\n3 3\n0 0\n"}, "reference_outputs": ["####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n"], "source_document_id": "p02404", "source_text": "Print a Frame\n\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n##########\n#........#\n#........#\n#........#\n#........#\n##########\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the frame made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n3 ≤ H ≤ 300\n\n3 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n0 0\n\nSample Output\n\n####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 400, "cpu_time_ms": 70, "memory_kb": 19252}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s430618100", "group_id": "codeNet:p02404", "input_text": "'use strict';\n(function(stdin) {\n //declare function\n function square(array) {\n var h = array[0];\n var w = array[1];\n var outLine = [];\n for (var i = 0; i < w; i++) {\n outLine.push('#');\n }\n outLine = outLine.join('');\n var inLine = [];\n for (var j = 0; j < w - 2; j++) {\n inLine.push('.');\n }\n inLine.push('#');\n inLine.unshift('#');\n inLine = inLine.join('');\n var result = [];\n for (var k = 0; k < h - 2; k++) {\n result.push(inLine);\n }\n result.push(outLine);\n result.unshift(outLine);\n return result.join('\\n');\n }\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var line = inputs.slice(0, inputs.indexOf('0 0'));\n line = line.map(function(v) {\n return v.split(' ').map(Number);\n });\n //main\n var all = line.map(square).join('\\n\\n');\n //display\n console.log(all + '\\n');\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1499253737, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02404.html", "problem_id": "p02404", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02404/input.txt", "sample_output_relpath": "derived/input_output/data/p02404/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02404/JavaScript/s430618100.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s430618100", "user_id": "u561206076"}, "prompt_components": {"gold_output": "####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n", "input_to_evaluate": "'use strict';\n(function(stdin) {\n //declare function\n function square(array) {\n var h = array[0];\n var w = array[1];\n var outLine = [];\n for (var i = 0; i < w; i++) {\n outLine.push('#');\n }\n outLine = outLine.join('');\n var inLine = [];\n for (var j = 0; j < w - 2; j++) {\n inLine.push('.');\n }\n inLine.push('#');\n inLine.unshift('#');\n inLine = inLine.join('');\n var result = [];\n for (var k = 0; k < h - 2; k++) {\n result.push(inLine);\n }\n result.push(outLine);\n result.unshift(outLine);\n return result.join('\\n');\n }\n\n //declare variable\n var inputs = stdin.toString().trim().split('\\n');\n var line = inputs.slice(0, inputs.indexOf('0 0'));\n line = line.map(function(v) {\n return v.split(' ').map(Number);\n });\n //main\n var all = line.map(square).join('\\n\\n');\n //display\n console.log(all + '\\n');\n})(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Print a Frame\n\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n##########\n#........#\n#........#\n#........#\n#........#\n##########\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the frame made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n3 ≤ H ≤ 300\n\n3 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n0 0\n\nSample Output\n\n####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###", "sample_input": "3 4\n5 6\n3 3\n0 0\n"}, "reference_outputs": ["####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###\n"], "source_document_id": "p02404", "source_text": "Print a Frame\n\nDraw a frame which has a height of H cm and a width of W cm. For example, the following figure shows a frame which has a height of 6 cm and a width of 10 cm.\n\n##########\n#........#\n#........#\n#........#\n#........#\n##########\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the frame made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n3 ≤ H ≤ 300\n\n3 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n0 0\n\nSample Output\n\n####\n#..#\n####\n\n######\n#....#\n#....#\n#....#\n######\n\n###\n#.#\n###", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 937, "cpu_time_ms": 60, "memory_kb": 15532}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s497201769", "group_id": "codeNet:p02405", "input_text": "var line, even, odd, i, res, hw;\n\n// even : #.#.\n// odd : .#.#\n\neven = {1: '#', 2: '#.'};\nodd = {1: '.', 2: '.#'};\n\nline = require('fs').readFileSync('/dev/stdin', 'ascii').split(\"\\n\");\nline.length = line.lastIndexOf('0 0');\n\nres = [];\nfor (i in line) {\n\thw = line[i].split(' ').map(Number);\n\tres.push(get_area(hw[0], hw[1]));\n\tres.push(\"\");\n}\nconsole.log(res.join('\\n'));\n\nfunction get_area(h, w) {\n\tvar top, bottom;\n\tif (h >= 3) {\n\t\ttop = Math.floor(h / 2);\n\t\tif (top % 2 === 1) top++;\n\t\tbottom = h - top;\n\t\treturn get_area(top, w) + '\\n' + get_area(bottom, w);\n\t} else if (h == 1) {\n\t\treturn get_even(w);\n\t} else if (h == 2) {\n\t\treturn get_even(w) + '\\n' + get_odd(w);\n\t}\n}\n\nfunction get_even(n) {\n\tvar i, smaller;\n\tif (n in even) return even[n];\n\tif (n % 2 === 0) {\n\t\ti = n / 2;\n\t\tsmaller = get_even(i);\n\t\treturn smaller + ((i % 2 === 0) ? smaller : get_odd(i));\n\t}\n\treturn get_even(n - 1) + '#';\n}\n\nfunction get_odd(n) {\n\tvar i, smaller;\n\tif (n in odd) return odd[n];\n\tif (n % 2 === 0) {\n\t\ti = n / 2;\n\t\tsmaller = get_odd(i);\n\t\treturn smaller + ((i % 2 === 0) ? smaller : get_even(i));\n\t}\n\treturn get_odd(n - 1) + '.';\n}", "language": "JavaScript", "metadata": {"date": 1496490069, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02405.html", "problem_id": "p02405", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02405/input.txt", "sample_output_relpath": "derived/input_output/data/p02405/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02405/JavaScript/s497201769.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s497201769", "user_id": "u239637240"}, "prompt_components": {"gold_output": "#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n", "input_to_evaluate": "var line, even, odd, i, res, hw;\n\n// even : #.#.\n// odd : .#.#\n\neven = {1: '#', 2: '#.'};\nodd = {1: '.', 2: '.#'};\n\nline = require('fs').readFileSync('/dev/stdin', 'ascii').split(\"\\n\");\nline.length = line.lastIndexOf('0 0');\n\nres = [];\nfor (i in line) {\n\thw = line[i].split(' ').map(Number);\n\tres.push(get_area(hw[0], hw[1]));\n\tres.push(\"\");\n}\nconsole.log(res.join('\\n'));\n\nfunction get_area(h, w) {\n\tvar top, bottom;\n\tif (h >= 3) {\n\t\ttop = Math.floor(h / 2);\n\t\tif (top % 2 === 1) top++;\n\t\tbottom = h - top;\n\t\treturn get_area(top, w) + '\\n' + get_area(bottom, w);\n\t} else if (h == 1) {\n\t\treturn get_even(w);\n\t} else if (h == 2) {\n\t\treturn get_even(w) + '\\n' + get_odd(w);\n\t}\n}\n\nfunction get_even(n) {\n\tvar i, smaller;\n\tif (n in even) return even[n];\n\tif (n % 2 === 0) {\n\t\ti = n / 2;\n\t\tsmaller = get_even(i);\n\t\treturn smaller + ((i % 2 === 0) ? smaller : get_odd(i));\n\t}\n\treturn get_even(n - 1) + '#';\n}\n\nfunction get_odd(n) {\n\tvar i, smaller;\n\tif (n in odd) return odd[n];\n\tif (n % 2 === 0) {\n\t\ti = n / 2;\n\t\tsmaller = get_odd(i);\n\t\treturn smaller + ((i % 2 === 0) ? smaller : get_even(i));\n\t}\n\treturn get_odd(n - 1) + '.';\n}", "problem_context": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "sample_input": "3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n"}, "reference_outputs": ["#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n"], "source_document_id": "p02405", "source_text": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1125, "cpu_time_ms": 80, "memory_kb": 17896}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s208039386", "group_id": "codeNet:p02405", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nprocess.stdin.on('data', function (chunk) {\n const n = chunk.toString()\n .split(\"\\n\")\n .filter(x => x !== \"0 0\" && x !== \"\")\n .map(x => x.split(\" \")); // [[3, 4], [5, 6], [3, 3] ...]\n\n const ans = n.map(x => makeOneAns(Number(x[0]), Number(x[1])));\n ans.forEach(x => {\n x.forEach((y, i) => {\n console.log(y)\n\n });\n });\n});\n\n\nfunction makeOneAns(height, width) {\n let ans = []\n for (let i = 0; i < height; i++) {\n if (i % 2 === 0) {\n ans.push(makeEvenLine(width));\n } else {\n ans.push(makeOddLine(width));\n }\n }\n ans.push(\"\")\n return ans\n}\n\nfunction makeOddLine(num) {\n let ans = \"\";\n for (let i = 0; i < num; i++) {\n if (i % 2 === 0) {\n ans = ans + \".\"\n } else {\n ans = ans + \"#\"\n }\n }\n return ans;\n}\n\nfunction makeEvenLine(num) {\n let ans = \"\";\n for (let i = 0; i < num; i++) {\n if (i % 2 !== 0) {\n ans = ans + \".\"\n } else {\n ans = ans + \"#\"\n }\n }\n return ans;\n}\n", "language": "JavaScript", "metadata": {"date": 1566370010, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02405.html", "problem_id": "p02405", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02405/input.txt", "sample_output_relpath": "derived/input_output/data/p02405/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02405/JavaScript/s208039386.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s208039386", "user_id": "u107785387"}, "prompt_components": {"gold_output": "#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nprocess.stdin.on('data', function (chunk) {\n const n = chunk.toString()\n .split(\"\\n\")\n .filter(x => x !== \"0 0\" && x !== \"\")\n .map(x => x.split(\" \")); // [[3, 4], [5, 6], [3, 3] ...]\n\n const ans = n.map(x => makeOneAns(Number(x[0]), Number(x[1])));\n ans.forEach(x => {\n x.forEach((y, i) => {\n console.log(y)\n\n });\n });\n});\n\n\nfunction makeOneAns(height, width) {\n let ans = []\n for (let i = 0; i < height; i++) {\n if (i % 2 === 0) {\n ans.push(makeEvenLine(width));\n } else {\n ans.push(makeOddLine(width));\n }\n }\n ans.push(\"\")\n return ans\n}\n\nfunction makeOddLine(num) {\n let ans = \"\";\n for (let i = 0; i < num; i++) {\n if (i % 2 === 0) {\n ans = ans + \".\"\n } else {\n ans = ans + \"#\"\n }\n }\n return ans;\n}\n\nfunction makeEvenLine(num) {\n let ans = \"\";\n for (let i = 0; i < num; i++) {\n if (i % 2 !== 0) {\n ans = ans + \".\"\n } else {\n ans = ans + \"#\"\n }\n }\n return ans;\n}\n", "problem_context": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "sample_input": "3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n"}, "reference_outputs": ["#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#\n"], "source_document_id": "p02405", "source_text": "Print a Chessboard\n\nDraw a chessboard which has a height of H cm and a width of W cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm.\n\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n#.#.#.#.#.\n.#.#.#.#.#\n\nNote that the top left corner should be drawn by '#'.\n\nInput\n\nThe input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space.\n\nThe input ends with two 0 (when both H and W are zero).\n\nOutput\n\nFor each dataset, print the chessboard made of '#' and '.'.\n\nPrint a blank line after each dataset.\n\nConstraints\n\n1 ≤ H ≤ 300\n\n1 ≤ W ≤ 300\n\nSample Input\n\n3 4\n5 6\n3 3\n2 2\n1 1\n0 0\n\nSample Output\n\n#.#.\n.#.#\n#.#.\n\n#.#.#.\n.#.#.#\n#.#.#.\n.#.#.#\n#.#.#.\n\n#.#\n.#.\n#.#\n\n#.\n.#\n\n#", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1150, "cpu_time_ms": 90, "memory_kb": 21060}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s663132360", "group_id": "codeNet:p02407", "input_text": "function main(input){\n let lines = input.split(\"\\n\");\n let length = parseInt(lines[0]);\n let nums = lines[1].split(\" \").map(item=>parseInt(item));\n let answer = [];\n for(let i=0;iparseInt(item));\n let answer = [];\n for(let i=0;i9)bfr[b][f][r]=9;\n if(bfr[b][f][r]<0)bfr[b][f][r]=0;\n}\nfor(var i=0;i<4;i++){\nfor(var j=0;j<3;j++){\nconsole.log(\" \"+bfr[i][j].join(\" \"));\n}\nif(i!==3)console.log(\"####################\");\n}", "language": "JavaScript", "metadata": {"date": 1424011357, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02409.html", "problem_id": "p02409", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02409/input.txt", "sample_output_relpath": "derived/input_output/data/p02409/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02409/JavaScript/s388469225.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s388469225", "user_id": "u540218629"}, "prompt_components": {"gold_output": " 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar Arr=(input.trim()).split(\"\\n\");\nArr.shift();\n \nvar bfr=[];\nfor(var i=0;i<4;i++){\n bfr.push([]);\n for(var j=0;j<3;j++){\n bfr[i].push([]);\n for(var k=0;k<10;k++)bfr[i][j].push(0);\n }\n}\n \nfor(var i=0;i9)bfr[b][f][r]=9;\n if(bfr[b][f][r]<0)bfr[b][f][r]=0;\n}\nfor(var i=0;i<4;i++){\nfor(var j=0;j<3;j++){\nconsole.log(\" \"+bfr[i][j].join(\" \"));\n}\nif(i!==3)console.log(\"####################\");\n}", "problem_context": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "sample_input": "3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n"}, "reference_outputs": [" 0 0 8 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 7 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n####################\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 0 0 0\n 0 0 0 0 0 0 0 1 0 0\n"], "source_document_id": "p02409", "source_text": "Official House\n\nYou manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.\n\nFor each notice, you are given four integers b, f, r and v which represent that v persons entered to room r of fth floor at building b. If v is negative, it means that −v persons left.\n\nAssume that initially no person lives in the building.\n\nInput\n\nIn the first line, the number of notices n is given. In the following n lines, a set of four integers b, f, r and v which represents ith notice is given in a line.\n\nOutput\n\nFor each building, print the information of 1st, 2nd and 3rd floor in this order. For each floor information, print the number of tenants of 1st, 2nd, .. and 10th room in this order. Print a single space character before the number of tenants. Print \"####################\" (20 '#') between buildings.\n\nConstraints\n\nNo incorrect building, floor and room numbers are given.\n\n0 ≤ the number of tenants during the management ≤ 9\n\nSample Input\n\n3\n1 1 3 8\n3 2 2 7\n4 3 8 1\n\nSample Output\n\n0 0 8 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 7 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n####################\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 0 0 0\n0 0 0 0 0 0 0 1 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 655, "cpu_time_ms": 20, "memory_kb": 8684}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s811175930", "group_id": "codeNet:p02409", "input_text": "var input = '';\nvar readable = process.stdin;\nreadable.resume();\nreadable.setEncoding( 'utf-8' );\nreadable.on( 'data', function( chunk ) {\n input += chunk;\n});\n\nreadable.on( 'end', function() {\n var oh = new Array(4);\n for( var i=0; i<4; i++ ) {\n oh[i] = new Array(3);\n for( var j=0; j<3; j++ ) {\n oh[i][j] = new Array(10);\n for( var k=0; k<10; k++ ) {\n oh[i][j][k] = 0;\n }\n }\n }\n var data = input.replace( '\\n', '' ).split( '\\n' );\n for( var i=1; i {\n lines.push(line);\n});\n/* 入力は \n */\n\nconst ca = 'a'.charCodeAt(0);\nconst cz = 'z'.charCodeAt(0);\nconst chars = [...Array(cz - ca +1).keys()].map(x=>String.fromCharCode(x+ca));\n\nreader.on('close', () => {\n var txt = lines.join('\\n')\n\n var h = aux(txt)\n\n for (var c of chars) {\n\tconsole.log(c + ' : ' + h[c]);\n }\n});\n\n\nfunction aux(txt)\n{\n var re=/[a-z]/;\n var h={};\n for (var c of chars) {\n\th[c]=0;\n }\n\n for (var i=0; i {\n lines.push(line);\n});\n/* 入力は \n */\n\nconst ca = 'a'.charCodeAt(0);\nconst cz = 'z'.charCodeAt(0);\nconst chars = [...Array(cz - ca +1).keys()].map(x=>String.fromCharCode(x+ca));\n\nreader.on('close', () => {\n var txt = lines.join('\\n')\n\n var h = aux(txt)\n\n for (var c of chars) {\n\tconsole.log(c + ' : ' + h[c]);\n }\n});\n\n\nfunction aux(txt)\n{\n var re=/[a-z]/;\n var h={};\n for (var c of chars) {\n\th[c]=0;\n }\n\n for (var i=0; i {\n let lengthList = input.split(' ');\n let divide=[];\n let num= parseInt(lengthList[0]);\n for(let i=2;i {\n let lengthList = input.split(' ');\n let divide=[];\n let num= parseInt(lengthList[0]);\n for(let i=2;i 1; i++) {\n var low = i * 6 - 1;\n var high = i * 6 + 1;\n while (n % low == 0) {\n primes.push(low);\n n /= low;\n }\n while (n % high == 0) {\n primes.push(high);\n n /= high;\n }\n}\n \nprocess.stdout.write(primes.join(' ')+\"\\n\");\n", "language": "JavaScript", "metadata": {"date": 1546488782, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02467.html", "problem_id": "p02467", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02467/input.txt", "sample_output_relpath": "derived/input_output/data/p02467/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02467/JavaScript/s737084747.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s737084747", "user_id": "u009180196"}, "prompt_components": {"gold_output": "12: 2 2 3\n", "input_to_evaluate": "var input = require('fs').readFileSync('/dev/stdin', 'utf8').trim();\nvar n = +input;\n \nprocess.stdout.write(n + ': ');\n \nvar primes = [];\n \nwhile (n % 2 == 0) {\n primes.push(2);\n n /= 2;\n}\nwhile (n % 3 == 0) {\n primes.push(3);\n n /= 3;\n}\nfor (var i = 1; n > 1; i++) {\n var low = i * 6 - 1;\n var high = i * 6 + 1;\n while (n % low == 0) {\n primes.push(low);\n n /= low;\n }\n while (n % high == 0) {\n primes.push(high);\n n /= high;\n }\n}\n \nprocess.stdout.write(primes.join(' ')+\"\\n\");\n", "problem_context": "Prime Factorization\n\nFactorize a given integer n.\n\nInput\n\nn\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the given integer n and :. Then, print prime factors in ascending order. If n is divisible by a prime factor several times, the prime factor should be printed according to the number of times. Print a space before each prime factor.\n\nConstraints\n\n2 ≤ n ≤ 109\n\nSample Input 1\n\n12\n\nSample Output 1\n\n12: 2 2 3\n\nSample Input 2\n\n126\n\nSample Output 2\n\n126: 2 3 3 7", "sample_input": "12\n"}, "reference_outputs": ["12: 2 2 3\n"], "source_document_id": "p02467", "source_text": "Prime Factorization\n\nFactorize a given integer n.\n\nInput\n\nn\n\nAn integer n is given in a line.\n\nOutput\n\nPrint the given integer n and :. Then, print prime factors in ascending order. If n is divisible by a prime factor several times, the prime factor should be printed according to the number of times. Print a space before each prime factor.\n\nConstraints\n\n2 ≤ n ≤ 109\n\nSample Input 1\n\n12\n\nSample Output 1\n\n12: 2 2 3\n\nSample Input 2\n\n126\n\nSample Output 2\n\n126: 2 3 3 7", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 537, "cpu_time_ms": 1460, "memory_kb": 15304}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s668890238", "group_id": "codeNet:p02468", "input_text": "var log = console.log;\nif (typeof process != \"undefined\") {\n\tvar input = \"\";\n\tprocess.stdin.resume();\n\tprocess.stdin.setEncoding('utf8');\n\tprocess.stdin.on('data', function (chunk) {\n\t\tinput += chunk;\n\t});\n\tprocess.stdin.on('end', function () {\n\t\tvar lines = input.split(\"\\n\");\n\t\tmain(lines);\n\t});\n}\nvar mod = 1000000007;\nfunction rec(m,n){\n\tif(n <= 3){\n\t\treturn Math.pow(m,n) % mod;\n\t}\n\tif(n % 2 == 0){\n\t\treturn Math.pow(rec(m,n/2),2) % mod;\n\t}else{\n\t\treturn (Math.pow(rec(m,(n-1)/2),2) * m) % mod;\n\t}\n}\nfunction main(lines){\n var k = lines[0];\n var j = k.split(\" \").map(function(e){return Number(e);});\n log(rec(j[0],j[1]));\n}", "language": "JavaScript", "metadata": {"date": 1495982662, "filename_ext": "js", "original_language": "JavaScript", "problem_description_relpath": "problem_descriptions/p02468.html", "problem_id": "p02468", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02468/input.txt", "sample_output_relpath": "derived/input_output/data/p02468/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02468/JavaScript/s668890238.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s668890238", "user_id": "u059378405"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "var log = console.log;\nif (typeof process != \"undefined\") {\n\tvar input = \"\";\n\tprocess.stdin.resume();\n\tprocess.stdin.setEncoding('utf8');\n\tprocess.stdin.on('data', function (chunk) {\n\t\tinput += chunk;\n\t});\n\tprocess.stdin.on('end', function () {\n\t\tvar lines = input.split(\"\\n\");\n\t\tmain(lines);\n\t});\n}\nvar mod = 1000000007;\nfunction rec(m,n){\n\tif(n <= 3){\n\t\treturn Math.pow(m,n) % mod;\n\t}\n\tif(n % 2 == 0){\n\t\treturn Math.pow(rec(m,n/2),2) % mod;\n\t}else{\n\t\treturn (Math.pow(rec(m,(n-1)/2),2) * m) % mod;\n\t}\n}\nfunction main(lines){\n var k = lines[0];\n var j = k.split(\" \").map(function(e){return Number(e);});\n log(rec(j[0],j[1]));\n}", "problem_context": "Power\n\nFor given integers m and n, compute mn (mod 1,000,000,007). Here, A (mod M) is the remainder when A is divided by M.\n\nInput\n\nm n\n\nTwo integers m and n are given in a line.\n\nOutput\n\nPrint mn (mod 1,000,000,007) in a line.\n\nConstraints\n\n1 ≤ m ≤ 100\n\n1 ≤ n ≤ 109\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n8\n\nSample Input 2\n\n5 8\n\nSample Output 2\n\n390625", "sample_input": "2 3\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02468", "source_text": "Power\n\nFor given integers m and n, compute mn (mod 1,000,000,007). Here, A (mod M) is the remainder when A is divided by M.\n\nInput\n\nm n\n\nTwo integers m and n are given in a line.\n\nOutput\n\nPrint mn (mod 1,000,000,007) in a line.\n\nConstraints\n\n1 ≤ m ≤ 100\n\n1 ≤ n ≤ 109\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n8\n\nSample Input 2\n\n5 8\n\nSample Output 2\n\n390625", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 631, "cpu_time_ms": 60, "memory_kb": 15532}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s096476687", "group_id": "codeNet:p02534", "input_text": "(async () => {\n let input = '';\n for await (const chunk of process.stdin) input += chunk;\n const k = +input;\n console.log('ACL'.repeat(k));\n})()\n", "language": "JavaScript", "metadata": {"date": 1601168729, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02534.html", "problem_id": "p02534", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02534/input.txt", "sample_output_relpath": "derived/input_output/data/p02534/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02534/JavaScript/s096476687.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s096476687", "user_id": "u304747714"}, "prompt_components": {"gold_output": "ACLACLACL\n", "input_to_evaluate": "(async () => {\n let input = '';\n for await (const chunk of process.stdin) input += chunk;\n const k = +input;\n console.log('ACL'.repeat(k));\n})()\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer K.\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nFor example, if K = 3, print ACLACLACL.\n\nConstraints\n\n1 \\leq K \\leq 5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nACLACLACL", "sample_input": "3\n"}, "reference_outputs": ["ACLACLACL\n"], "source_document_id": "p02534", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given an integer K.\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nFor example, if K = 3, print ACLACLACL.\n\nConstraints\n\n1 \\leq K \\leq 5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the string obtained by repeating the string ACL K times and concatenating them.\n\nSample Input 1\n\n3\n\nSample Output 1\n\nACLACLACL", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 157, "cpu_time_ms": 68, "memory_kb": 29904}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s566227981", "group_id": "codeNet:p02536", "input_text": "class UnionFind {\n constructor(n) {\n this.p = new Array(n).fill(null).map((_, i) => i)\n this.height = new Array(n).fill(0)\n this.size = new Array(n).fill(1)\n }\n\n unite(a, b) {\n this.link(this.findSet(a), this.findSet(b))\n }\n\n link(a, b) {\n if (a === b) return null\n\n if (this.height[a] > this.height[b]) {\n this.p[b] = a\n this.size[a] += this.size[b]\n } else {\n this.p[a] = b\n this.size[b] += this.size[a]\n\n if (this.height[a] === this.height[b]) this.height[b]++\n }\n }\n\n findSet(x) {\n if (this.p[x] === x) return x\n return this.findSet(this.p[x])\n }\n}\n\n\nconst main = (input) => {\n const [t, ...q] = input.trim().split('\\n')\n const [n,] = t.split(' ').map(Number)\n\n const uf = new UnionFind(n)\n\n for (let i=0; i i)\n this.height = new Array(n).fill(0)\n this.size = new Array(n).fill(1)\n }\n\n unite(a, b) {\n this.link(this.findSet(a), this.findSet(b))\n }\n\n link(a, b) {\n if (a === b) return null\n\n if (this.height[a] > this.height[b]) {\n this.p[b] = a\n this.size[a] += this.size[b]\n } else {\n this.p[a] = b\n this.size[b] += this.size[a]\n\n if (this.height[a] === this.height[b]) this.height[b]++\n }\n }\n\n findSet(x) {\n if (this.p[x] === x) return x\n return this.findSet(this.p[x])\n }\n}\n\n\nconst main = (input) => {\n const [t, ...q] = input.trim().split('\\n')\n const [n,] = t.split(' ').map(Number)\n\n const uf = new UnionFind(n)\n\n for (let i=0; i 0)) {\n result[i] = 0;\n }\n result[i]++;\n break;\n }\n i++;\n }\n init = i;\n }\n return result;\n}\n\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1600546591, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/JavaScript/s776718128.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s776718128", "user_id": "u638741593"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\nfunction main(input) {\n var N= Number(input.trim());\n var count = 0 \n for (var C = 1; C 0)) {\n result[i] = 0;\n }\n result[i]++;\n break;\n }\n i++;\n }\n init = i;\n }\n return result;\n}\n\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 912, "cpu_time_ms": 2207, "memory_kb": 36336}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s092634692", "group_id": "codeNet:p02548", "input_text": "function Main(input) {\n input = input.trim();\n const n = parseInt(input, 10);\n\n // nからc引いた数の約数の数を調べればいいんじゃね!?\n\n let count = 0;\n for(let c = 1; c < n; c++) {\n const subNum = n - c;\n\n count += toDivisor(subNum);\n }\n\n console.log(count);\n}\n\n// 約数の数を求める関数\nfunction toDivisor(num) {\n let count = 0;\n let double = 0;\n for(let i = 1; i**2 <= num; i++) {\n if(num % i != 0) continue;\n if(i**2 === num) double++;\n count++;\n }\n\n return count * 2 - double;\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1600545068, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/JavaScript/s092634692.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s092634692", "user_id": "u765734095"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function Main(input) {\n input = input.trim();\n const n = parseInt(input, 10);\n\n // nからc引いた数の約数の数を調べればいいんじゃね!?\n\n let count = 0;\n for(let c = 1; c < n; c++) {\n const subNum = n - c;\n\n count += toDivisor(subNum);\n }\n\n console.log(count);\n}\n\n// 約数の数を求める関数\nfunction toDivisor(num) {\n let count = 0;\n let double = 0;\n for(let i = 1; i**2 <= num; i++) {\n if(num % i != 0) continue;\n if(i**2 === num) double++;\n count++;\n }\n\n return count * 2 - double;\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 637, "cpu_time_ms": 2206, "memory_kb": 32524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s567759035", "group_id": "codeNet:p02548", "input_text": "function main(lines) {\n const N = n();\n\n let cnt = 0;\n for (let c = 1; c < N; c++) {\n const _N = N-c;\n const max = Math.sqrt(_N);\n for (let a = 1; a <= max; a++) {\n if (_N % a == 0) {\n if (_N / a == a) cnt++;\n else cnt += 2;\n }\n }\n }\n \n return cnt;\n}\n\n\n\nconst lines = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n\nlet lineCount = 0;\nconst s = () => lines[lineCount++];\nconst n = () => Number(s());\nconst b = () => BigInt(s());\nconst sa = () => s().split(' ');\nconst na = () => sa().map(Number);\nconst ba = () => sa().map(BigInt);\nconst getLines = (n) => lines.slice(lineCount, lineCount += n);\n\nconst ans = main(lines);\nconsole.log( ans );", "language": "JavaScript", "metadata": {"date": 1600544898, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02548.html", "problem_id": "p02548", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02548/input.txt", "sample_output_relpath": "derived/input_output/data/p02548/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02548/JavaScript/s567759035.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s567759035", "user_id": "u686930335"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function main(lines) {\n const N = n();\n\n let cnt = 0;\n for (let c = 1; c < N; c++) {\n const _N = N-c;\n const max = Math.sqrt(_N);\n for (let a = 1; a <= max; a++) {\n if (_N % a == 0) {\n if (_N / a == a) cnt++;\n else cnt += 2;\n }\n }\n }\n \n return cnt;\n}\n\n\n\nconst lines = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n\nlet lineCount = 0;\nconst s = () => lines[lineCount++];\nconst n = () => Number(s());\nconst b = () => BigInt(s());\nconst sa = () => s().split(' ');\nconst na = () => sa().map(Number);\nconst ba = () => sa().map(BigInt);\nconst getLines = (n) => lines.slice(lineCount, lineCount += n);\n\nconst ans = main(lines);\nconsole.log( ans );", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "sample_input": "3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02548", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a positive integer N.\nHow many tuples (A,B,C) of positive integers satisfy A \\times B + C = N?\n\nConstraints\n\n2 \\leq N \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n3\n\nThere are 3 tuples of integers that satisfy A \\times B + C = 3: (A, B, C) = (1, 1, 2), (1, 2, 1), (2, 1, 1).\n\nSample Input 2\n\n100\n\nSample Output 2\n\n473\n\nSample Input 3\n\n1000000\n\nSample Output 3\n\n13969985", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 705, "cpu_time_ms": 2206, "memory_kb": 32524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s938157983", "group_id": "codeNet:p02549", "input_text": "const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")\n\nconst lines = input.split('\\n')\nconst [N, K] = lines[0].split(' ').map(Number)\nconst k = []\n\nfor (let i = 1; i <= K; i++) {\n const [L, R] = lines[i].split(' ').map(Number)\n k.push([L, R])\n}\nconst ksum = Array(K).fill(0)\n\nconst mod = 998244353\nconst map = Array(N).fill(0)\nmap[0] = 1\n\nfor (let i = 1; i < map.length; i++) {\n let c = 0\n for (let j = 0; j < k.length; j++) {\n ksum[j] = ksum[j] + (map[i - k[j][0]] || 0) - (map[i - k[j][1] -1 ] || 0)\n }\n map[i] = ksum.reduce((a, b) => a + b) % mod\n}\n\nconsole.log(map.pop())\n", "language": "JavaScript", "metadata": {"date": 1600569207, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02549.html", "problem_id": "p02549", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02549/input.txt", "sample_output_relpath": "derived/input_output/data/p02549/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02549/JavaScript/s938157983.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s938157983", "user_id": "u968011443"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")\n\nconst lines = input.split('\\n')\nconst [N, K] = lines[0].split(' ').map(Number)\nconst k = []\n\nfor (let i = 1; i <= K; i++) {\n const [L, R] = lines[i].split(' ').map(Number)\n k.push([L, R])\n}\nconst ksum = Array(K).fill(0)\n\nconst mod = 998244353\nconst map = Array(N).fill(0)\nmap[0] = 1\n\nfor (let i = 1; i < map.length; i++) {\n let c = 0\n for (let j = 0; j < k.length; j++) {\n ksum[j] = ksum[j] + (map[i - k[j][0]] || 0) - (map[i - k[j][1] -1 ] || 0)\n }\n map[i] = ksum.reduce((a, b) => a + b) % mod\n}\n\nconsole.log(map.pop())\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N cells arranged in a row, numbered 1, 2, \\ldots, N from left to right.\n\nTak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below.\n\nYou are given an integer K that is less than or equal to 10, and K non-intersecting segments [L_1, R_1], [L_2, R_2], \\ldots, [L_K, R_K].\nLet S be the union of these K segments.\nHere, the segment [l, r] denotes the set consisting of all integers i that satisfy l \\leq i \\leq r.\n\n\bWhen you are on Cell i, pick an integer d from S and move to Cell i + d. You cannot move out of the cells.\n\nTo help Tak, find the number of ways to go to Cell N, modulo 998244353.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\min(N, 10)\n\n1 \\leq L_i \\leq R_i \\leq N\n\n[L_i, R_i] and [L_j, R_j] do not intersect (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nL_1 R_1\nL_2 R_2\n:\nL_K R_K\n\nOutput\n\nPrint the number of ways for Tak to go from Cell 1 to Cell N, modulo 998244353.\n\nSample Input 1\n\n5 2\n1 1\n3 4\n\nSample Output 1\n\n4\n\nThe set S is the union of the segment [1, 1] and the segment [3, 4], therefore S = \\{ 1, 3, 4 \\} holds.\n\nThere are 4 possible ways to get to Cell 5:\n\n1 \\to 2 \\to 3 \\to 4 \\to 5,\n\n1 \\to 2 \\to 5,\n\n1 \\to 4 \\to 5 and\n\n1 \\to 5.\n\nSample Input 2\n\n5 2\n3 3\n5 5\n\nSample Output 2\n\n0\n\nBecause S = \\{ 3, 5 \\} holds, you cannot reach to Cell 5.\nPrint 0.\n\nSample Input 3\n\n5 1\n1 2\n\nSample Output 3\n\n5\n\nSample Input 4\n\n60 3\n5 8\n1 3\n10 15\n\nSample Output 4\n\n221823067\n\nNote that you have to print the answer modulo 998244353.", "sample_input": "5 2\n1 1\n3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02549", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N cells arranged in a row, numbered 1, 2, \\ldots, N from left to right.\n\nTak lives in these cells and is currently on Cell 1. He is trying to reach Cell N by using the procedure described below.\n\nYou are given an integer K that is less than or equal to 10, and K non-intersecting segments [L_1, R_1], [L_2, R_2], \\ldots, [L_K, R_K].\nLet S be the union of these K segments.\nHere, the segment [l, r] denotes the set consisting of all integers i that satisfy l \\leq i \\leq r.\n\n\bWhen you are on Cell i, pick an integer d from S and move to Cell i + d. You cannot move out of the cells.\n\nTo help Tak, find the number of ways to go to Cell N, modulo 998244353.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq \\min(N, 10)\n\n1 \\leq L_i \\leq R_i \\leq N\n\n[L_i, R_i] and [L_j, R_j] do not intersect (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nL_1 R_1\nL_2 R_2\n:\nL_K R_K\n\nOutput\n\nPrint the number of ways for Tak to go from Cell 1 to Cell N, modulo 998244353.\n\nSample Input 1\n\n5 2\n1 1\n3 4\n\nSample Output 1\n\n4\n\nThe set S is the union of the segment [1, 1] and the segment [3, 4], therefore S = \\{ 1, 3, 4 \\} holds.\n\nThere are 4 possible ways to get to Cell 5:\n\n1 \\to 2 \\to 3 \\to 4 \\to 5,\n\n1 \\to 2 \\to 5,\n\n1 \\to 4 \\to 5 and\n\n1 \\to 5.\n\nSample Input 2\n\n5 2\n3 3\n5 5\n\nSample Output 2\n\n0\n\nBecause S = \\{ 3, 5 \\} holds, you cannot reach to Cell 5.\nPrint 0.\n\nSample Input 3\n\n5 1\n1 2\n\nSample Output 3\n\n5\n\nSample Input 4\n\n60 3\n5 8\n1 3\n10 15\n\nSample Output 4\n\n221823067\n\nNote that you have to print the answer modulo 998244353.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 610, "cpu_time_ms": 642, "memory_kb": 67012}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s675802762", "group_id": "codeNet:p02552", "input_text": "function main(input) {\n const x = parseInt(input);\n // この下の行から\n if(x==0){console.log(\"1\");}else if(x==1){\n console.log(\"0\");}\n \n // この上の行まででプログラムを書く\n};\n// 標準入力\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "language": "JavaScript", "metadata": {"date": 1600512334, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02552/input.txt", "sample_output_relpath": "derived/input_output/data/p02552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02552/JavaScript/s675802762.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s675802762", "user_id": "u613427783"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "function main(input) {\n const x = parseInt(input);\n // この下の行から\n if(x==0){console.log(\"1\");}else if(x==1){\n console.log(\"0\");}\n \n // この上の行まででプログラムを書く\n};\n// 標準入力\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "sample_input": "1\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02552", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 275, "cpu_time_ms": 62, "memory_kb": 29568}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s348758211", "group_id": "codeNet:p02552", "input_text": "\"use strict\"\n \nconst main = arg => {\n const input = arg.trim().split(\"\\n\");\n var N = parseInt(input[0].split(\" \")[0]);\n if (N=0){\n console.log(\"1\");\n }else{\n console.log(\"0\");\n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "language": "JavaScript", "metadata": {"date": 1600033803, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02552.html", "problem_id": "p02552", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02552/input.txt", "sample_output_relpath": "derived/input_output/data/p02552/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02552/JavaScript/s348758211.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s348758211", "user_id": "u954904025"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "\"use strict\"\n \nconst main = arg => {\n const input = arg.trim().split(\"\\n\");\n var N = parseInt(input[0].split(\" \")[0]);\n if (N=0){\n console.log(\"1\");\n }else{\n console.log(\"0\");\n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "sample_input": "1\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02552", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer x that is greater than or equal to 0, and less than or equal to 1.\nOutput 1 if x is equal to 0, or 0 if x is equal to 1.\n\nConstraints\n\n0 \\leq x \\leq 1\n\nx is an integer\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx\n\nOutput\n\nPrint 1 if x is equal to 0, or 0 if x is equal to 1.\n\nSample Input 1\n\n1\n\nSample Output 1\n\n0\n\nSample Input 2\n\n0\n\nSample Output 2\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 249, "cpu_time_ms": 58, "memory_kb": 29672}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s236696333", "group_id": "codeNet:p02553", "input_text": "((input) => {\n let [a,b,c,d] = input.split(' ').map(BigInt);\n let arr = [a*c,a*d,b*c,b*d];\n let max = arr.reduce((acc, curr) => {\n return acc > curr ? acc : curr;\n });\n\n console.log(Number(max));\n})(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1600030574, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02553.html", "problem_id": "p02553", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02553/input.txt", "sample_output_relpath": "derived/input_output/data/p02553/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02553/JavaScript/s236696333.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s236696333", "user_id": "u827651214"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "((input) => {\n let [a,b,c,d] = input.split(' ').map(BigInt);\n let arr = [a*c,a*d,b*c,b*d];\n let max = arr.reduce((acc, curr) => {\n return acc > curr ? acc : curr;\n });\n\n console.log(Number(max));\n})(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are integers a,b,c and d.\nIf x and y are integers and a \\leq x \\leq b and c\\leq y \\leq d hold, what is the maximum possible value of x \\times y?\n\nConstraints\n\n-10^9 \\leq a \\leq b \\leq 10^9\n\n-10^9 \\leq c \\leq d \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 1 1\n\nSample Output 1\n\n2\n\nIf x = 1 and y = 1 then x \\times y = 1.\nIf x = 2 and y = 1 then x \\times y = 2.\nTherefore, the answer is 2.\n\nSample Input 2\n\n3 5 -4 -2\n\nSample Output 2\n\n-6\n\nThe answer can be negative.\n\nSample Input 3\n\n-1000000000 0 -1000000000 0\n\nSample Output 3\n\n1000000000000000000", "sample_input": "1 2 1 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02553", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are integers a,b,c and d.\nIf x and y are integers and a \\leq x \\leq b and c\\leq y \\leq d hold, what is the maximum possible value of x \\times y?\n\nConstraints\n\n-10^9 \\leq a \\leq b \\leq 10^9\n\n-10^9 \\leq c \\leq d \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 1 1\n\nSample Output 1\n\n2\n\nIf x = 1 and y = 1 then x \\times y = 1.\nIf x = 2 and y = 1 then x \\times y = 2.\nTherefore, the answer is 2.\n\nSample Input 2\n\n3 5 -4 -2\n\nSample Output 2\n\n-6\n\nThe answer can be negative.\n\nSample Input 3\n\n-1000000000 0 -1000000000 0\n\nSample Output 3\n\n1000000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 257, "cpu_time_ms": 65, "memory_kb": 29664}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s361015468", "group_id": "codeNet:p02553", "input_text": "\"use strict\"\n\nfunction Main(input) {\n let lines = input.split('\\n');\n const [a, b, c, d] = lines[0].split(' ').map(Number);\n\n let product_matrix = [];\n for ( let x = a; x <= b; x++ ) {\n for ( let y = c; y <= d; y++ ) {\n product_matrix.push(x * y);\n }\n }\n product_matrix.sort(function(a, b) {\n return b - a;\n });\n\n console.log(product_matrix[0]);\n\n return;\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1600027787, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02553.html", "problem_id": "p02553", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02553/input.txt", "sample_output_relpath": "derived/input_output/data/p02553/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02553/JavaScript/s361015468.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s361015468", "user_id": "u421936549"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\"\n\nfunction Main(input) {\n let lines = input.split('\\n');\n const [a, b, c, d] = lines[0].split(' ').map(Number);\n\n let product_matrix = [];\n for ( let x = a; x <= b; x++ ) {\n for ( let y = c; y <= d; y++ ) {\n product_matrix.push(x * y);\n }\n }\n product_matrix.sort(function(a, b) {\n return b - a;\n });\n\n console.log(product_matrix[0]);\n\n return;\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are integers a,b,c and d.\nIf x and y are integers and a \\leq x \\leq b and c\\leq y \\leq d hold, what is the maximum possible value of x \\times y?\n\nConstraints\n\n-10^9 \\leq a \\leq b \\leq 10^9\n\n-10^9 \\leq c \\leq d \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 1 1\n\nSample Output 1\n\n2\n\nIf x = 1 and y = 1 then x \\times y = 1.\nIf x = 2 and y = 1 then x \\times y = 2.\nTherefore, the answer is 2.\n\nSample Input 2\n\n3 5 -4 -2\n\nSample Output 2\n\n-6\n\nThe answer can be negative.\n\nSample Input 3\n\n-1000000000 0 -1000000000 0\n\nSample Output 3\n\n1000000000000000000", "sample_input": "1 2 1 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02553", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are integers a,b,c and d.\nIf x and y are integers and a \\leq x \\leq b and c\\leq y \\leq d hold, what is the maximum possible value of x \\times y?\n\nConstraints\n\n-10^9 \\leq a \\leq b \\leq 10^9\n\n-10^9 \\leq c \\leq d \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b c d\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 1 1\n\nSample Output 1\n\n2\n\nIf x = 1 and y = 1 then x \\times y = 1.\nIf x = 2 and y = 1 then x \\times y = 2.\nTherefore, the answer is 2.\n\nSample Input 2\n\n3 5 -4 -2\n\nSample Output 2\n\n-6\n\nThe answer can be negative.\n\nSample Input 3\n\n-1000000000 0 -1000000000 0\n\nSample Output 3\n\n1000000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 439, "cpu_time_ms": 2285, "memory_kb": 1504408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s478213660", "group_id": "codeNet:p02554", "input_text": "'use script';\n\n{\nfunction Main(input) {\n \tconst N = input;\n\tconst b = BigInt(1000000000+7);\n\n\tfunction x(m){\n\n\t\tlet d = BigInt(1);\n\n\t\tfor(i=0; i {\n input = input.split(\"\\n\")\n var N=Number(input[0]);\n let point=[];\n for (var i=1; i<=N;i++){\n point[i]=input[i].split(\" \").map(n=>Number(n));\n }\n\n let memo = 0;\n for (var i=1; i<=N;i++){\n for (var j=i+1; j<=N;j++){\n dist = Math.abs(point[i][0]-point[j][0])+Math.abs(point[i][1]-point[j][1]);\n if (dist>memo){memo = dist;}\n }\n }\n console.log(input);\n console.log(point);\n console.log(memo);\n };\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n", "language": "JavaScript", "metadata": {"date": 1600364003, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02556.html", "problem_id": "p02556", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02556/input.txt", "sample_output_relpath": "derived/input_output/data/p02556/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02556/JavaScript/s179727056.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s179727056", "user_id": "u638741593"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "const main = (input) => {\n input = input.split(\"\\n\")\n var N=Number(input[0]);\n let point=[];\n for (var i=1; i<=N;i++){\n point[i]=input[i].split(\" \").map(n=>Number(n));\n }\n\n let memo = 0;\n for (var i=1; i<=N;i++){\n for (var j=i+1; j<=N;j++){\n dist = Math.abs(point[i][0]-point[j][0])+Math.abs(point[i][1]-point[j][1]);\n if (dist>memo){memo = dist;}\n }\n }\n console.log(input);\n console.log(point);\n console.log(memo);\n };\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N points on the 2D plane, i-th of which is located on (x_i, y_i).\nThere can be multiple points that share the same coordinate.\nWhat is the maximum possible Manhattan distance between two distinct points?\n\nHere, the Manhattan distance between two points (x_i, y_i) and (x_j, y_j) is defined by |x_i-x_j| + |y_i-y_j|.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq x_i,y_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n:\nx_N y_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 1\n2 4\n3 2\n\nSample Output 1\n\n4\n\nThe Manhattan distance between the first point and the second point is |1-2|+|1-4|=4, which is maximum possible.\n\nSample Input 2\n\n2\n1 1\n1 1\n\nSample Output 2\n\n0", "sample_input": "3\n1 1\n2 4\n3 2\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02556", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N points on the 2D plane, i-th of which is located on (x_i, y_i).\nThere can be multiple points that share the same coordinate.\nWhat is the maximum possible Manhattan distance between two distinct points?\n\nHere, the Manhattan distance between two points (x_i, y_i) and (x_j, y_j) is defined by |x_i-x_j| + |y_i-y_j|.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq x_i,y_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n:\nx_N y_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 1\n2 4\n3 2\n\nSample Output 1\n\n4\n\nThe Manhattan distance between the first point and the second point is |1-2|+|1-4|=4, which is maximum possible.\n\nSample Input 2\n\n2\n1 1\n1 1\n\nSample Output 2\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 511, "cpu_time_ms": 2208, "memory_kb": 98840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s840693551", "group_id": "codeNet:p02570", "input_text": "const SieveOfEratosthenes = (n) => {\n let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */\n let primes = []/* list of prime numbers */\n for(let i=2; i*i<=n; i++) {\n if(!flg[i]) {\n primes.push(i)\n for(let j=i; j*j<=n; j+=i) {\n flg[j] = 1\n }\n }\n }\n return primes\n}\n\nconst factorizationBySoE = (n, primes) => {\n //const primes = SieveOfEratosthenes(n)\n let factors = {}\n primes.some(p => {\n if(n < p) return true\n while(n%p===0) {\n if(!factors[p])factors[p]=1\n else factors[p]++\n n/=p\n }\n })\n if(n>1)factors[n]=1\n return factors\n}\n\n\nconst getGCD = (a,b) => {\n if(b===0)return a\n else if(a===0)return b\n return getGCD(b, a%b)\n}\n\nconst main = (arg) => {\n const N = Number(arg.split(\"\\n\")[0])\n const a = arg.split(\"\\n\")[1].split(\" \").map(Number)\n \n const MAX_A = 10**6+1\n \n // check if p is in {a} (paircoprime)\n const primes = SieveOfEratosthenes(A)\n// return\n let set = [...new Array(MAX_A)].fill(0)\n isPairCoprime = true\n for(let i=0; i1) {\n isPairCoprime = false\n }\n }\n */\n if(isPairCoprime) {\n console.log(\"pairwise coprime\")\n return\n }\n // return\n // setcoprime\n // let gcd = getGCD(a[0], a[1])\n let gcd = 0\n for(let i=0; i {\n let flg = (new Array(n)).fill(0)/* set flg[i] to true when it is seived */\n let primes = []/* list of prime numbers */\n for(let i=2; i*i<=n; i++) {\n if(!flg[i]) {\n primes.push(i)\n for(let j=i; j*j<=n; j+=i) {\n flg[j] = 1\n }\n }\n }\n return primes\n}\n\nconst factorizationBySoE = (n, primes) => {\n //const primes = SieveOfEratosthenes(n)\n let factors = {}\n primes.some(p => {\n if(n < p) return true\n while(n%p===0) {\n if(!factors[p])factors[p]=1\n else factors[p]++\n n/=p\n }\n })\n if(n>1)factors[n]=1\n return factors\n}\n\n\nconst getGCD = (a,b) => {\n if(b===0)return a\n else if(a===0)return b\n return getGCD(b, a%b)\n}\n\nconst main = (arg) => {\n const N = Number(arg.split(\"\\n\")[0])\n const a = arg.split(\"\\n\")[1].split(\" \").map(Number)\n \n const MAX_A = 10**6+1\n \n // check if p is in {a} (paircoprime)\n const primes = SieveOfEratosthenes(A)\n// return\n let set = [...new Array(MAX_A)].fill(0)\n isPairCoprime = true\n for(let i=0; i1) {\n isPairCoprime = false\n }\n }\n */\n if(isPairCoprime) {\n console.log(\"pairwise coprime\")\n return\n }\n // return\n // setcoprime\n // let gcd = getGCD(a[0], a[1])\n let gcd = 0\n for(let i=0; i {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const [d, t, s] = readLine()\n .split(\" \")\n .map((n) => parseInt(n));\n\n if (s * t >= d) console.log(\"YES\");\n else console.log(\"NO\");\n}\n", "language": "JavaScript", "metadata": {"date": 1598727816, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02570.html", "problem_id": "p02570", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02570/input.txt", "sample_output_relpath": "derived/input_output/data/p02570/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02570/JavaScript/s817089739.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s817089739", "user_id": "u144997662"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "let inputString = \"\";\nlet currentLine = 0;\nprocess.stdin.on(\"data\", (data) => {\n inputString += data;\n});\nprocess.stdin.on(\"end\", function () {\n inputString = inputString\n .trim()\n .split(\"\\n\")\n .map((str) => str.trim());\n main();\n});\nfunction readLine() {\n return inputString[currentLine++];\n}\nfunction main() {\n const [d, t, s] = readLine()\n .split(\" \")\n .map((n) => parseInt(n));\n\n if (s * t >= d) console.log(\"YES\");\n else console.log(\"NO\");\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "sample_input": "1000 15 80\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02570", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is meeting up with Aoki.\n\nThey have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now.\n\nTakahashi will leave his house now and go straight to the place at a speed of S meters per minute.\n\nWill he arrive in time?\n\nConstraints\n\n1 \\leq D \\leq 10000\n\n1 \\leq T \\leq 10000\n\n1 \\leq S \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nD T S\n\nOutput\n\nIf Takahashi will reach the place in time, print Yes; otherwise, print No.\n\nSample Input 1\n\n1000 15 80\n\nSample Output 1\n\nYes\n\nIt takes 12.5 minutes to go 1000 meters to the place at a speed of 80 meters per minute. They have planned to meet in 15 minutes so he will arrive in time.\n\nSample Input 2\n\n2000 20 100\n\nSample Output 2\n\nYes\n\nIt takes 20 minutes to go 2000 meters to the place at a speed of 100 meters per minute. They have planned to meet in 20 minutes so he will arrive just on time.\n\nSample Input 3\n\n10000 1 1\n\nSample Output 3\n\nNo\n\nHe will be late.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 470, "cpu_time_ms": 68, "memory_kb": 29912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s896386959", "group_id": "codeNet:p02571", "input_text": "//let input = \"codeforces\\natcoder\";\n\nfunction main(input){\n input = input.trim();\n list = input.split(\"\\n\");\n let d = list[0];\n let s = list[1];\n console.log(d + \" \" + s);\n let answer = 1000;\n let temp = 0;\n for(let i=0; i {\n let count = 1\n visited.add(point)\n\n for (let p in graph[point]) {\n if (!visited.has(p)) {\n count += dfs(graph, visited, p)\n }\n }\n\n return count\n}\n\nconst processData = (lines) => {\n const [n, m] = lines[0].split(' ').map( x => +x)\n let friendships = {}\n for (let i=0; i +x)\n if (!friendships[f[0]]) {\n friendships[f[0]] = {}\n }\n if (!friendships[f[1]]) {\n friendships[f[1]] = {}\n }\n friendships[f[0]][f[1]] = true\n friendships[f[1]][f[0]] = true\n }\n\n let maxCount = 1\n let visited = new Set()\n for (let p in friendships) {\n if (!visited.has(p)) {\n maxCount = Math.max(maxCount, dfs(friendships, visited, p))\n }\n }\n\n console.log(maxCount)\n}\n\nlet i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n processData(lines)\n})\n", "language": "JavaScript", "metadata": {"date": 1598731432, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02573.html", "problem_id": "p02573", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02573/input.txt", "sample_output_relpath": "derived/input_output/data/p02573/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02573/JavaScript/s363614339.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s363614339", "user_id": "u268857806"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const dfs = (graph, visited, point) => {\n let count = 1\n visited.add(point)\n\n for (let p in graph[point]) {\n if (!visited.has(p)) {\n count += dfs(graph, visited, p)\n }\n }\n\n return count\n}\n\nconst processData = (lines) => {\n const [n, m] = lines[0].split(' ').map( x => +x)\n let friendships = {}\n for (let i=0; i +x)\n if (!friendships[f[0]]) {\n friendships[f[0]] = {}\n }\n if (!friendships[f[1]]) {\n friendships[f[1]] = {}\n }\n friendships[f[0]][f[1]] = true\n friendships[f[1]][f[0]] = true\n }\n\n let maxCount = 1\n let visited = new Set()\n for (let p in friendships) {\n if (!visited.has(p)) {\n maxCount = Math.max(maxCount, dfs(friendships, visited, p))\n }\n }\n\n console.log(maxCount)\n}\n\nlet i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n processData(lines)\n})\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "sample_input": "5 3\n1 2\n3 4\n5 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02573", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N persons called Person 1 through Person N.\n\nYou are given M facts that \"Person A_i and Person B_i are friends.\" The same fact may be given multiple times.\n\nIf X and Y are friends, and Y and Z are friends, then X and Z are also friends. There is no friendship that cannot be derived from the M given facts.\n\nTakahashi the evil wants to divide the N persons into some number of groups so that every person has no friend in his/her group.\n\nAt least how many groups does he need to make?\n\nConstraints\n\n2 \\leq N \\leq 2\\times 10^5\n\n0 \\leq M \\leq 2\\times 10^5\n\n1\\leq A_i,B_i\\leq N\n\nA_i \\neq B_i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n\\vdots\nA_M B_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5 3\n1 2\n3 4\n5 1\n\nSample Output 1\n\n3\n\nDividing them into three groups such as \\{1,3\\}, \\{2,4\\}, and \\{5\\} achieves the goal.\n\nSample Input 2\n\n4 10\n1 2\n2 1\n1 2\n2 1\n1 2\n1 3\n1 4\n2 3\n2 4\n3 4\n\nSample Output 2\n\n4\n\nSample Input 3\n\n10 4\n3 1\n4 1\n5 9\n2 6\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1103, "cpu_time_ms": 947, "memory_kb": 165564}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s373269563", "group_id": "codeNet:p02576", "input_text": "function Main(input) {\n const LINES = input.split(\"\\n\");\n const N = parseInt(LINES[0]);\n const X = parseInt(LINES[1]);\n const T = parseInt(LINES[2]);\n\n let answer = 0;\n answer = Math.floor(N / X) * T;\n if N % X != 0{\n answer += T;\n }\n\n console.log(answer);\n\n}\n// デバッグ用\nfunction debug(){\nvar input = document.getElementById(\"input\").value;\nMain(input);\n}\n\n//* この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1598867615, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02576.html", "problem_id": "p02576", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02576/input.txt", "sample_output_relpath": "derived/input_output/data/p02576/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02576/JavaScript/s373269563.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s373269563", "user_id": "u396391104"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "function Main(input) {\n const LINES = input.split(\"\\n\");\n const N = parseInt(LINES[0]);\n const X = parseInt(LINES[1]);\n const T = parseInt(LINES[2]);\n\n let answer = 0;\n answer = Math.floor(N / X) * T;\n if N % X != 0{\n answer += T;\n }\n\n console.log(answer);\n\n}\n// デバッグ用\nfunction debug(){\nvar input = document.getElementById(\"input\").value;\nMain(input);\n}\n\n//* この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "sample_input": "20 12 6\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02576", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi loves takoyaki - a ball-shaped snack.\n\nWith a takoyaki machine, he can make at most X pieces of takoyaki at a time, taking T minutes regardless of the number of pieces to make.\n\nHow long does it take to make N takoyaki?\n\nConstraints\n\n1 \\leq N,X,T \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X T\n\nOutput\n\nPrint an integer representing the minimum number of minutes needed to make N pieces of takoyaki.\n\nSample Input 1\n\n20 12 6\n\nSample Output 1\n\n12\n\nHe can make 12 pieces of takoyaki in the first 6 minutes and 8 more in the next 6 minutes, so he can make 20 in a total of 12 minutes.\n\nNote that being able to make 12 in 6 minutes does not mean he can make 2 in 1 minute.\n\nSample Input 2\n\n1000 1 1000\n\nSample Output 2\n\n1000000\n\nIt seems to take a long time to make this kind of takoyaki.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 561, "cpu_time_ms": 61, "memory_kb": 29864}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s323339237", "group_id": "codeNet:p02577", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tconst inputLines = input.split(\"\\n\");\n\tconst line0 = inputLines[0];\n\tvar mySum = 0;\n\tfor (var i = 0; i < line0.length; i++) {\n\t\tvar a = line0.substr(i, 1);\n\t\tmySum += parseInt(a, 10);\n\t}\n\n\tconsole.log(mySum%9 === 0 ? \"Yes\" : \"No\");\n\n\t// tmp = input[1].split(\" \");\n\t// //文字列から10進数に変換するときはparseIntを使います\n\t// var a = parseInt(input[0], 10);\n\t// var b = parseInt(tmp[0], 10);\n\t// var c = parseInt(tmp[1], 10);\n\t// var s = input[2];\n\n\t//出力\n\t// console.log('%d %s',a+b+c,s);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n// node index.js\n// 1\n// 2 3\n// test\n// (Ctrl + D)\n", "language": "JavaScript", "metadata": {"date": 1598123145, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02577.html", "problem_id": "p02577", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02577/input.txt", "sample_output_relpath": "derived/input_output/data/p02577/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02577/JavaScript/s323339237.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s323339237", "user_id": "u217165632"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tconst inputLines = input.split(\"\\n\");\n\tconst line0 = inputLines[0];\n\tvar mySum = 0;\n\tfor (var i = 0; i < line0.length; i++) {\n\t\tvar a = line0.substr(i, 1);\n\t\tmySum += parseInt(a, 10);\n\t}\n\n\tconsole.log(mySum%9 === 0 ? \"Yes\" : \"No\");\n\n\t// tmp = input[1].split(\" \");\n\t// //文字列から10進数に変換するときはparseIntを使います\n\t// var a = parseInt(input[0], 10);\n\t// var b = parseInt(tmp[0], 10);\n\t// var c = parseInt(tmp[1], 10);\n\t// var s = input[2];\n\n\t//出力\n\t// console.log('%d %s',a+b+c,s);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n// node index.js\n// 1\n// 2 3\n// test\n// (Ctrl + D)\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "sample_input": "123456789\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02577", "source_text": "Score : 200 points\n\nProblem Statement\n\nAn integer N is a multiple of 9 if and only if the sum of the digits in the decimal representation of N is a multiple of 9.\n\nDetermine whether N is a multiple of 9.\n\nConstraints\n\n0 \\leq N < 10^{200000}\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N is a multiple of 9, print Yes; otherwise, print No.\n\nSample Input 1\n\n123456789\n\nSample Output 1\n\nYes\n\nThe sum of these digits is 1+2+3+4+5+6+7+8+9=45, which is a multiple of 9, so 123456789 is a multiple of 9.\n\nSample Input 2\n\n0\n\nSample Output 2\n\nYes\n\nSample Input 3\n\n31415926535897932384626433832795028841971693993751058209749445923078164062862089986280\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 873, "cpu_time_ms": 76, "memory_kb": 32660}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s249364364", "group_id": "codeNet:p02579", "input_text": "function main(lines) {\n const [H, W] = na();\n const [Ch, Cw] = sa().map(v => v-1);\n const [Dh, Dw] = sa().map(v => v-1);\n const maze = getLines(H);\n \n const deque = [[Ch, Cw, 0]];\n const done = Array(H).fill(0).map(_ => Array(W).fill(false));\n while (deque.length) {\n const [h, w, cost] = deque.pop();\n if (h == Dh && w == Dw) return cost;\n done[h][w] = true;\n for (let _h = h-2; _h <= h+2; _h++) {\n if (!maze[_h]) continue;\n for (let _w = w-2; _w <= w+2; _w++) {\n if (maze[_h][_w] != '.' || done[_h][_w]) continue;\n if (Math.hypot(_h-h, _w-w) <= 1) {\n deque.push([_h, _w, cost]);\n } else {\n deque.unshift([_h, _w, cost+1]);\n }\n }\n }\n }\n return -1;\n}\n\n\n\nconst lines = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n\nlet lineCount = 0;\nconst s = () => lines[lineCount++];\nconst n = () => Number(s());\nconst b = () => BigInt(s());\nconst sa = () => s().split(' ');\nconst na = () => sa().map(Number);\nconst ba = () => sa().map(BigInt);\nconst getLines = (n) => lines.slice(lineCount, lineCount += n);\n\nconst ans = main(lines);\nconsole.log( ans );", "language": "JavaScript", "metadata": {"date": 1598536342, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02579.html", "problem_id": "p02579", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02579/input.txt", "sample_output_relpath": "derived/input_output/data/p02579/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02579/JavaScript/s249364364.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s249364364", "user_id": "u686930335"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function main(lines) {\n const [H, W] = na();\n const [Ch, Cw] = sa().map(v => v-1);\n const [Dh, Dw] = sa().map(v => v-1);\n const maze = getLines(H);\n \n const deque = [[Ch, Cw, 0]];\n const done = Array(H).fill(0).map(_ => Array(W).fill(false));\n while (deque.length) {\n const [h, w, cost] = deque.pop();\n if (h == Dh && w == Dw) return cost;\n done[h][w] = true;\n for (let _h = h-2; _h <= h+2; _h++) {\n if (!maze[_h]) continue;\n for (let _w = w-2; _w <= w+2; _w++) {\n if (maze[_h][_w] != '.' || done[_h][_w]) continue;\n if (Math.hypot(_h-h, _w-w) <= 1) {\n deque.push([_h, _w, cost]);\n } else {\n deque.unshift([_h, _w, cost+1]);\n }\n }\n }\n }\n return -1;\n}\n\n\n\nconst lines = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n\nlet lineCount = 0;\nconst s = () => lines[lineCount++];\nconst n = () => Number(s());\nconst b = () => BigInt(s());\nconst sa = () => s().split(' ');\nconst na = () => sa().map(Number);\nconst ba = () => sa().map(BigInt);\nconst getLines = (n) => lines.slice(lineCount, lineCount += n);\n\nconst ans = main(lines);\nconsole.log( ans );", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02579", "source_text": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1149, "cpu_time_ms": 2207, "memory_kb": 59196}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s792808939", "group_id": "codeNet:p02579", "input_text": "let magicCount=0\nfunction main(arg) {\n \n let [h,w] = arg.split(\"\\n\")[0].split(\" \").map(x=>Number(x))\n let [ch,cw] = arg.split(\"\\n\")[1].split(\" \").map(x=>Number(x))\n let [dh,dw] = arg.split(\"\\n\")[2].split(\" \").map(x=>Number(x))\n let input = arg.split(\"\\n\")\n \n input.shift()\n input.shift()\n input.shift()\n let s = []\n for(let i=0; ix*magic)\n //dy = dy.map(y=>y*magic)\n// 四方向を探索\n for (let dir = 0; dir < 4; ++dir) {\n let nh = h + dx[dir];\n let nw = w + dy[dir];\n\n // 場外アウトしたり、移動先が壁の場合はスルー\n if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;\n if (field[nh][nw] == '#') continue;\n\n // 移動先が探索済みの場合\n if (seen[nh][nw]) continue;\n\n // 再帰的に探索\n dfs(field, nh, nw, seen, H, W,dh,dw);\n }\n \n for (let dir_x = 0; dir_x < 5; ++dir_x) {\n for (let dir_y = 0; dir_y < 5; ++dir_y) {\n let nh = h + dir_x;\n let nw = w + dir_y;\n \n // 場外アウトしたり、移動先が壁の場合はスルー\n if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;\n if (field[nh][nw] == '#') continue;\n \n // 移動先が探索済みの場合\n if (seen[nh][nw]) continue;\n \n // 再帰的に探索\n dfs(field, nh, nw, seen, H, W,dh,dw);\n magicCount++\n }\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1598128592, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02579.html", "problem_id": "p02579", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02579/input.txt", "sample_output_relpath": "derived/input_output/data/p02579/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02579/JavaScript/s792808939.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s792808939", "user_id": "u435256638"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "let magicCount=0\nfunction main(arg) {\n \n let [h,w] = arg.split(\"\\n\")[0].split(\" \").map(x=>Number(x))\n let [ch,cw] = arg.split(\"\\n\")[1].split(\" \").map(x=>Number(x))\n let [dh,dw] = arg.split(\"\\n\")[2].split(\" \").map(x=>Number(x))\n let input = arg.split(\"\\n\")\n \n input.shift()\n input.shift()\n input.shift()\n let s = []\n for(let i=0; ix*magic)\n //dy = dy.map(y=>y*magic)\n// 四方向を探索\n for (let dir = 0; dir < 4; ++dir) {\n let nh = h + dx[dir];\n let nw = w + dy[dir];\n\n // 場外アウトしたり、移動先が壁の場合はスルー\n if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;\n if (field[nh][nw] == '#') continue;\n\n // 移動先が探索済みの場合\n if (seen[nh][nw]) continue;\n\n // 再帰的に探索\n dfs(field, nh, nw, seen, H, W,dh,dw);\n }\n \n for (let dir_x = 0; dir_x < 5; ++dir_x) {\n for (let dir_y = 0; dir_y < 5; ++dir_y) {\n let nh = h + dir_x;\n let nw = w + dir_y;\n \n // 場外アウトしたり、移動先が壁の場合はスルー\n if (nh < 0 || nh >= H || nw < 0 || nw >= W) continue;\n if (field[nh][nw] == '#') continue;\n \n // 移動先が探索済みの場合\n if (seen[nh][nw]) continue;\n \n // 再帰的に探索\n dfs(field, nh, nw, seen, H, W,dh,dw);\n magicCount++\n }\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "sample_input": "4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02579", "source_text": "Score : 400 points\n\nProblem Statement\n\nA maze is composed of a grid of H \\times W squares - H vertical, W horizontal.\n\nThe square at the i-th row from the top and the j-th column from the left - (i,j) - is a wall if S_{ij} is # and a road if S_{ij} is ..\n\nThere is a magician in (C_h,C_w). He can do the following two kinds of moves:\n\nMove A: Walk to a road square that is vertically or horizontally adjacent to the square he is currently in.\n\nMove B: Use magic to warp himself to a road square in the 5\\times 5 area centered at the square he is currently in.\n\nIn either case, he cannot go out of the maze.\n\nAt least how many times does he need to use the magic to reach (D_h, D_w)?\n\nConstraints\n\n1 \\leq H,W \\leq 10^3\n\n1 \\leq C_h,D_h \\leq H\n\n1 \\leq C_w,D_w \\leq W\n\nS_{ij} is # or ..\n\nS_{C_h C_w} and S_{D_h D_w} are ..\n\n(C_h,C_w) \\neq (D_h,D_w)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nC_h C_w\nD_h D_w\nS_{11}\\ldots S_{1W}\n\\vdots\nS_{H1}\\ldots S_{HW}\n\nOutput\n\nPrint the minimum number of times the magician needs to use the magic. If he cannot reach (D_h,D_w), print -1 instead.\n\nSample Input 1\n\n4 4\n1 1\n4 4\n..#.\n..#.\n.#..\n.#..\n\nSample Output 1\n\n1\n\nFor example, by walking to (2,2) and then using the magic to travel to (4,4), just one use of magic is enough.\n\nNote that he cannot walk diagonally.\n\nSample Input 2\n\n4 4\n1 4\n4 1\n.##.\n####\n####\n.##.\n\nSample Output 2\n\n-1\n\nHe cannot move from there.\n\nSample Input 3\n\n4 4\n2 2\n3 3\n....\n....\n....\n....\n\nSample Output 3\n\n0\n\nNo use of magic is needed.\n\nSample Input 4\n\n4 5\n1 2\n2 5\n#.###\n####.\n#..##\n#..##\n\nSample Output 4\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2588, "cpu_time_ms": 1472, "memory_kb": 80756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s845474038", "group_id": "codeNet:p02581", "input_text": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(){return +cin[cid++];}\nfunction nextstr(){return cin[cid++];}\nfunction nextbig(){return BigInt(cin[cid++]);}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(String(myOut));\n\nfunction main(){\n var n = next();\n var dp = xArray(-1,n,n), mx = 0, add = 0;\n var a = nexts(2).sort((a,b)=>a-b).map(a=>a-1);\n var q = [];\n var map = xArray(0,n);\n dp[a[0]][a[1]] = 0;\n map[a[0]]++, map[a[1]]++;\n for(var i = 1; i < n; i++){\n a = nexts(3).sort((a,b)=>a-b).map(a=>a-1);\n if(a[0] === a[2]){\n add++;\n continue;\n }\n q = [];\n solve(a[0],a[0],a[1],a[2]);\n if(a[0] !== a[1])solve(a[1],a[1],a[0],a[2]);\n else{\n for(var j = 0; j < a[0]; j++){\n solve(j,a[0],j,a[2]);\n }\n for(var j = a[0]+1; j < a[2]; j++){\n solve(a[0],j,j,a[2]);\n }\n for(var j = a[2]; j < n; j++){\n solve(a[0],j,a[2],j);\n }\n }\n if(a[1] !== a[2])solve(a[2],a[2],a[0],a[1]);\n else{\n for(var j = 0; j < a[0]; j++){\n solve(j,a[1],j,a[0]);\n }\n for(var j = a[0]; j < a[2]; j++){\n solve(j,a[2],a[0],j);\n }\n for(var j = a[2]+1; j < n; j++){\n solve(a[2],j,a[0],j);\n }\n }\n while(q.length){\n var w = q.pop(), v = q.pop(), u = q.pop();\n dp[u][v] = Math.max(dp[u][v], w);\n }\n for(var j = 0; j < 3; j++){\n var t = a[j];\n if(map[t] === 1)map[t] = 2, dp[t][t] = Math.max(0,dp[t][t]);\n else if(map[t] === 0){\n map[t] = 1;\n for(var k = 0; k < t; k++){\n if(map[k] === 0)continue;\n dp[k][t] = Math.max(0,dp[k][t]);\n }\n for(var k = t+1; k < n; k++){\n if(map[k] === 0)continue;\n dp[t][k] = Math.max(0,dp[t][k]);\n }\n }\n }\n }\n a = next()-1;\n solve(a,a,a,a);\n return mx+add;\n function solve(t,u,v,w){\n var x = Math.max(dp[v][w], dp[t][u]+1);\n q.push(v,w,x);\n mx = Math.max(mx,x);\n }\n}", "language": "JavaScript", "metadata": {"date": 1598184389, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02581.html", "problem_id": "p02581", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02581/input.txt", "sample_output_relpath": "derived/input_output/data/p02581/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02581/JavaScript/s845474038.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s845474038", "user_id": "u643613120"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(){return +cin[cid++];}\nfunction nextstr(){return cin[cid++];}\nfunction nextbig(){return BigInt(cin[cid++]);}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(String(myOut));\n\nfunction main(){\n var n = next();\n var dp = xArray(-1,n,n), mx = 0, add = 0;\n var a = nexts(2).sort((a,b)=>a-b).map(a=>a-1);\n var q = [];\n var map = xArray(0,n);\n dp[a[0]][a[1]] = 0;\n map[a[0]]++, map[a[1]]++;\n for(var i = 1; i < n; i++){\n a = nexts(3).sort((a,b)=>a-b).map(a=>a-1);\n if(a[0] === a[2]){\n add++;\n continue;\n }\n q = [];\n solve(a[0],a[0],a[1],a[2]);\n if(a[0] !== a[1])solve(a[1],a[1],a[0],a[2]);\n else{\n for(var j = 0; j < a[0]; j++){\n solve(j,a[0],j,a[2]);\n }\n for(var j = a[0]+1; j < a[2]; j++){\n solve(a[0],j,j,a[2]);\n }\n for(var j = a[2]; j < n; j++){\n solve(a[0],j,a[2],j);\n }\n }\n if(a[1] !== a[2])solve(a[2],a[2],a[0],a[1]);\n else{\n for(var j = 0; j < a[0]; j++){\n solve(j,a[1],j,a[0]);\n }\n for(var j = a[0]; j < a[2]; j++){\n solve(j,a[2],a[0],j);\n }\n for(var j = a[2]+1; j < n; j++){\n solve(a[2],j,a[0],j);\n }\n }\n while(q.length){\n var w = q.pop(), v = q.pop(), u = q.pop();\n dp[u][v] = Math.max(dp[u][v], w);\n }\n for(var j = 0; j < 3; j++){\n var t = a[j];\n if(map[t] === 1)map[t] = 2, dp[t][t] = Math.max(0,dp[t][t]);\n else if(map[t] === 0){\n map[t] = 1;\n for(var k = 0; k < t; k++){\n if(map[k] === 0)continue;\n dp[k][t] = Math.max(0,dp[k][t]);\n }\n for(var k = t+1; k < n; k++){\n if(map[k] === 0)continue;\n dp[t][k] = Math.max(0,dp[t][k]);\n }\n }\n }\n }\n a = next()-1;\n solve(a,a,a,a);\n return mx+add;\n function solve(t,u,v,w){\n var x = Math.max(dp[v][w], dp[t][u]+1);\n q.push(v,w,x);\n mx = Math.max(mx,x);\n }\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have 3N cards arranged in a row from left to right, where each card has an integer between 1 and N (inclusive) written on it. The integer written on the i-th card from the left is A_i.\n\nYou will do the following operation N-1 times:\n\nRearrange the five leftmost cards in any order you like, then remove the three leftmost cards. If the integers written on those three cards are all equal, you gain 1 point.\n\nAfter these N-1 operations, if the integers written on the remaining three cards are all equal, you will gain 1 additional point.\n\nFind the maximum number of points you can gain.\n\nConstraints\n\n1 \\leq N \\leq 2000\n\n1 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_{3N}\n\nOutput\n\nPrint the maximum number of points you can gain.\n\nSample Input 1\n\n2\n1 2 1 2 2 1\n\nSample Output 1\n\n2\n\nLet us rearrange the five leftmost cards so that the integers written on the six cards will be 2\\ 2\\ 2\\ 1\\ 1\\ 1 from left to right.\n\nThen, remove the three leftmost cards, all of which have the same integer 2, gaining 1 point.\n\nNow, the integers written on the remaining cards are 1\\ 1\\ 1.\n\nSince these three cards have the same integer 1, we gain 1 more point.\n\nIn this way, we can gain 2 points - which is the maximum possible.\n\nSample Input 2\n\n3\n1 1 2 2 3 3 3 2 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1 1 2 2 2 3 3 3 1\n\nSample Output 3\n\n3", "sample_input": "2\n1 2 1 2 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02581", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have 3N cards arranged in a row from left to right, where each card has an integer between 1 and N (inclusive) written on it. The integer written on the i-th card from the left is A_i.\n\nYou will do the following operation N-1 times:\n\nRearrange the five leftmost cards in any order you like, then remove the three leftmost cards. If the integers written on those three cards are all equal, you gain 1 point.\n\nAfter these N-1 operations, if the integers written on the remaining three cards are all equal, you will gain 1 additional point.\n\nFind the maximum number of points you can gain.\n\nConstraints\n\n1 \\leq N \\leq 2000\n\n1 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_{3N}\n\nOutput\n\nPrint the maximum number of points you can gain.\n\nSample Input 1\n\n2\n1 2 1 2 2 1\n\nSample Output 1\n\n2\n\nLet us rearrange the five leftmost cards so that the integers written on the six cards will be 2\\ 2\\ 2\\ 1\\ 1\\ 1 from left to right.\n\nThen, remove the three leftmost cards, all of which have the same integer 2, gaining 1 point.\n\nNow, the integers written on the remaining cards are 1\\ 1\\ 1.\n\nSince these three cards have the same integer 1, we gain 1 more point.\n\nIn this way, we can gain 2 points - which is the maximum possible.\n\nSample Input 2\n\n3\n1 1 2 2 3 3 3 2 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1 1 2 2 2 3 3 3 1\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2421, "cpu_time_ms": 753, "memory_kb": 105488}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s045309552", "group_id": "codeNet:p02582", "input_text": "function Main(input){\nconst a = input.trim();\n if(a.includes('R')) {\n console.log(1);\n }else if(a.includes('RR')) {\n console.log(2);\n } else if(a.includes('RRR')) {\n console.log(3);\n } else {\n console.log(0);\n }\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1598360658, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02582.html", "problem_id": "p02582", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02582/input.txt", "sample_output_relpath": "derived/input_output/data/p02582/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02582/JavaScript/s045309552.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s045309552", "user_id": "u486768123"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input){\nconst a = input.trim();\n if(a.includes('R')) {\n console.log(1);\n }else if(a.includes('RR')) {\n console.log(2);\n } else if(a.includes('RRR')) {\n console.log(3);\n } else {\n console.log(0);\n }\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "sample_input": "RRS\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02582", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 425, "cpu_time_ms": 62, "memory_kb": 29548}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s337462208", "group_id": "codeNet:p02582", "input_text": "'use strict';Object.defineProperty(exports,'__esModule',{value:true});var fs=require('fs');var _length = function (xs) {\n return xs.length;\n};\nvar _indexImpl = function (just) {\n return function (nothing) {\n return function (xs) {\n return function (i) {\n return i < 0 || i >= xs.length ? nothing : just(xs[i]);\n };\n };\n };\n};\nvar _concat = function (xss) {\n if (xss.length <= 10000) {\n return Array.prototype.concat.apply([], xss);\n }\n var result = [];\n for (var i = 0, l = xss.length; i < l; i++) {\n var xs = xss[i];\n for (var j = 0, m = xs.length; j < m; j++) {\n result.push(xs[j]);\n }\n }\n return result;\n};var _arrayMap = function (f) {\n return function (arr) {\n var l = arr.length;\n var result = new Array(l);\n for (var i = 0; i < l; i++) {\n result[i] = f(arr[i]);\n }\n return result;\n };\n};var Semigroupoid = function (compose) {\n this.compose = compose;\n};\nvar semigroupoidFn = new Semigroupoid(function (f) {\n return function (g) {\n return function (x) {\n return f(g(x));\n };\n };\n});\nvar compose = function (dict) {\n return dict.compose;\n};var flip = function (f) {\n return function (b) {\n return function (a) {\n return f(a)(b);\n };\n };\n};\nvar $$const = function (a) {\n return function (v) {\n return a;\n };\n};var _unit = {};var _showIntImpl = function (n) {\n return n.toString();\n};var Show = function (show) {\n this.show = show;\n};\nvar showInt = new Show(_showIntImpl);\nvar show = function (dict) {\n return dict.show;\n};var Functor = function (map) {\n this.map = map;\n};\nvar map = function (dict) {\n return dict.map;\n};\nvar mapFlipped = function (dictFunctor) {\n return function (fa) {\n return function (f) {\n return map(dictFunctor)(f)(fa);\n };\n };\n};\nvar $$void = function (dictFunctor) {\n return map(dictFunctor)($$const(_unit));\n};\nvar functorFn = new Functor(compose(semigroupoidFn));\nvar functorArray = new Functor(_arrayMap);var _concatArray = function (xs) {\n return function (ys) {\n if (xs.length === 0) return ys;\n if (ys.length === 0) return xs;\n return xs.concat(ys);\n };\n};var Semigroup = function (append) {\n this.append = append;\n};\nvar semigroupArray = new Semigroup(_concatArray);\nvar append = function (dict) {\n return dict.append;\n};var Alt = function (Functor0, alt) {\n this.Functor0 = Functor0;\n this.alt = alt;\n};\nvar altArray = new Alt(function () {\n return functorArray;\n}, append(semigroupArray));var _arrayApply = function (fs) {\n return function (xs) {\n var l = fs.length;\n var k = xs.length;\n var result = new Array(l * k);\n var n = 0;\n for (var i = 0; i < l; i++) {\n var f = fs[i];\n for (var j = 0; j < k; j++) {\n result[n++] = f(xs[j]);\n }\n }\n return result;\n };\n};var Category = function (Semigroupoid0, identity) {\n this.Semigroupoid0 = Semigroupoid0;\n this.identity = identity;\n};\nvar identity = function (dict) {\n return dict.identity;\n};\nvar categoryFn = new Category(function () {\n return semigroupoidFn;\n}, function (x) {\n return x;\n});var Apply = function (Functor0, apply) {\n this.Functor0 = Functor0;\n this.apply = apply;\n};\nvar applyArray = new Apply(function () {\n return functorArray;\n}, _arrayApply);\nvar apply = function (dict) {\n return dict.apply;\n};var Applicative = function (Apply0, pure) {\n this.Apply0 = Apply0;\n this.pure = pure;\n};\nvar pure = function (dict) {\n return dict.pure;\n};\nvar liftA1 = function (dictApplicative) {\n return function (f) {\n return function (a) {\n return apply(dictApplicative.Apply0())(pure(dictApplicative)(f))(a);\n };\n };\n};var _arrayBind = function (arr) {\n return function (f) {\n var result = [];\n for (var i = 0, l = arr.length; i < l; i++) {\n Array.prototype.push.apply(result, f(arr[i]));\n }\n return result;\n };\n};var Bind = function (Apply0, bind) {\n this.Apply0 = Apply0;\n this.bind = bind;\n};\nvar bindArray = new Bind(function () {\n return applyArray;\n}, _arrayBind);\nvar bind = function (dict) {\n return dict.bind;\n};var Monad = function (Applicative0, Bind1) {\n this.Applicative0 = Applicative0;\n this.Bind1 = Bind1;\n};\nvar ap = function (dictMonad) {\n return function (f) {\n return function (a) {\n return bind(dictMonad.Bind1())(f)(function (f$prime) {\n return bind(dictMonad.Bind1())(a)(function (a$prime) {\n return pure(dictMonad.Applicative0())(f$prime(a$prime));\n });\n });\n };\n };\n};var Bifunctor = function (bimap) {\n this.bimap = bimap;\n};\nvar bimap = function (dict) {\n return dict.bimap;\n};var _foldrArray = function (f) {\n return function (init) {\n return function (xs) {\n var acc = init;\n var len = xs.length;\n for (var i = len - 1; i >= 0; i--) {\n acc = f(xs[i])(acc);\n }\n return acc;\n };\n };\n};\nvar _foldlArray = function (f) {\n return function (init) {\n return function (xs) {\n var acc = init;\n var len = xs.length;\n for (var i = 0; i < len; i++) {\n acc = f(acc)(xs[i]);\n }\n return acc;\n };\n };\n};var Plus = function (Alt0, empty) {\n this.Alt0 = Alt0;\n this.empty = empty;\n};var refEq = function (r1) {\n return function (r2) {\n return r1 === r2;\n };\n};var Eq = function (eq) {\n this.eq = eq;\n};\nvar eqChar = new Eq(refEq);\nvar eq = function (dict) {\n return dict.eq;\n};var _boolConj = function (b1) {\n return function (b2) {\n return b1 && b2;\n };\n};\nvar _boolDisj = function (b1) {\n return function (b2) {\n return b1 || b2;\n };\n};\nvar _boolNot = function (b) {\n return !b;\n};var HeytingAlgebra = function (conj, disj, ff, implies, not, tt) {\n this.conj = conj;\n this.disj = disj;\n this.ff = ff;\n this.implies = implies;\n this.not = not;\n this.tt = tt;\n};\nvar not = function (dict) {\n return dict.not;\n};\nvar disj = function (dict) {\n return dict.disj;\n};\nvar heytingAlgebraBoolean = new HeytingAlgebra(_boolConj, _boolDisj, false, function (a) {\n return function (b) {\n return disj(heytingAlgebraBoolean)(not(heytingAlgebraBoolean)(a))(b);\n };\n}, _boolNot, true);var Monoid = function (Semigroup0, mempty) {\n this.Semigroup0 = Semigroup0;\n this.mempty = mempty;\n};\nvar mempty = function (dict) {\n return dict.mempty;\n};var Nothing = function () {\n function Nothing() {} Nothing.value = new Nothing();\n return Nothing;\n}();\nvar Just = function () {\n function Just(value0) {\n this.value0 = value0;\n } Just.create = function (value0) {\n return new Just(value0);\n };\n return Just;\n}();\nvar maybe = function (v) {\n return function (v1) {\n return function (v2) {\n if (v2 instanceof Nothing) {\n return v;\n } if (v2 instanceof Just) {\n return v1(v2.value0);\n } throw new Error(\"Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): \" + [v.constructor.name, v1.constructor.name, v2.constructor.name]);\n };\n };\n};\nvar isNothing = maybe(true)($$const(false));\nvar functorMaybe = new Functor(function (v) {\n return function (v1) {\n if (v1 instanceof Just) {\n return new Just(v(v1.value0));\n } return Nothing.value;\n };\n});\nvar fromJust = function (dictPartial) {\n return function (v) {\n if (v instanceof Just) {\n return v.value0;\n } throw new Error(\"Failed pattern match at Data.Maybe (line 268, column 1 - line 268, column 46): \" + [v.constructor.name]);\n };\n};var Foldable = function (foldMap, foldl, foldr) {\n this.foldMap = foldMap;\n this.foldl = foldl;\n this.foldr = foldr;\n};\nvar foldr = function (dict) {\n return dict.foldr;\n};\nvar foldl = function (dict) {\n return dict.foldl;\n};\nvar foldMapDefaultR = function (dictFoldable) {\n return function (dictMonoid) {\n return function (f) {\n return foldr(dictFoldable)(function (x) {\n return function (acc) {\n return append(dictMonoid.Semigroup0())(f(x))(acc);\n };\n })(mempty(dictMonoid));\n };\n };\n};\nvar foldableArray = new Foldable(function (dictMonoid) {\n return foldMapDefaultR(foldableArray)(dictMonoid);\n}, _foldlArray, _foldrArray);\nvar find = function (dictFoldable) {\n return function (p) {\n var go = function (v) {\n return function (v1) {\n if (v instanceof Nothing && p(v1)) {\n return new Just(v1);\n } return v;\n };\n };\n return foldl(dictFoldable)(go)(Nothing.value);\n };\n};var semigroupFirst = new Semigroup(function (v) {\n return function (v1) {\n if (v instanceof Just) {\n return v;\n } return v1;\n };\n});\nvar monoidFirst = new Monoid(function () {\n return semigroupFirst;\n}, Nothing.value);\nvar functorFirst = functorMaybe;\nvar altFirst = new Alt(function () {\n return functorFirst;\n}, append(semigroupFirst));\nvar plusFirst = new Plus(function () {\n return altFirst;\n}, mempty(monoidFirst));var semigroupLast = new Semigroup(function (v) {\n return function (v1) {\n if (v1 instanceof Just) {\n return v1;\n } if (v1 instanceof Nothing) {\n return v;\n } throw new Error(\"Failed pattern match at Data.Maybe.Last (line 52, column 1 - line 54, column 36): \" + [v.constructor.name, v1.constructor.name]);\n };\n});\nvar monoidLast = new Monoid(function () {\n return semigroupLast;\n}, Nothing.value);\nvar functorLast = functorMaybe;\nvar altLast = new Alt(function () {\n return functorLast;\n}, append(semigroupLast));\nvar plusLast = new Plus(function () {\n return altLast;\n}, mempty(monoidLast));var _pureE = function (a) {\n return function () {\n return a;\n };\n};\nvar _bindE = function (a) {\n return function (f) {\n return function () {\n return f(a())();\n };\n };\n};var monadEffect = new Monad(function () {\n return applicativeEffect;\n}, function () {\n return bindEffect;\n});\nvar bindEffect = new Bind(function () {\n return applyEffect;\n}, _bindE);\nvar applyEffect = new Apply(function () {\n return functorEffect;\n}, ap(monadEffect));\nvar applicativeEffect = new Applicative(function () {\n return applyEffect;\n}, _pureE);\nvar functorEffect = new Functor(liftA1(applicativeEffect));var _map_ = function (f) {\n return function (a) {\n return function () {\n return f(a());\n };\n };\n};\nvar _new = function (val) {\n return function () {\n return { value: val };\n };\n};\nvar _read = function (ref) {\n return function () {\n return ref.value;\n };\n};\nvar _modify$prime = function (f) {\n return function (ref) {\n return function () {\n var t = f(ref.value);\n ref.value = t.state;\n return t.value;\n };\n };\n};\nvar _write = function (a) {\n return function (ref) {\n return function () {\n return ref.value = a;\n };\n };\n};var modify = function (f) {\n return _modify$prime(function (s) {\n var s$prime = f(s);\n return {\n state: s$prime,\n value: s$prime\n };\n });\n};\nvar functorST = new Functor(_map_);var _empty = function () {\n return [];\n};\nvar _pushAll = function (as) {\n return function (xs) {\n return function () {\n return xs.push.apply(xs, as);\n };\n };\n};\nvar _unsafeFreeze = function (xs) {\n return function () {\n return xs;\n };\n};var push = function (a) {\n return _pushAll([a]);\n};var Iterator = function () {\n function Iterator(value0, value1) {\n this.value0 = value0;\n this.value1 = value1;\n } Iterator.create = function (value0) {\n return function (value1) {\n return new Iterator(value0, value1);\n };\n };\n return Iterator;\n}();\nvar peek = function (v) {\n return function __do() {\n var i = _read(v.value1)();\n return v.value0(i);\n };\n};\nvar next = function (v) {\n return function __do() {\n var i = _read(v.value1)();\n modify(function (v1) {\n return v1 + 1 | 0;\n })(v.value1)();\n return v.value0(i);\n };\n};\nvar pushWhile = function (p) {\n return function (iter) {\n return function (array) {\n return function __do() {\n var $$break = _new(false)();\n while (map(functorST)(not(heytingAlgebraBoolean))(_read($$break))()) {\n (function __do() {\n var mx = peek(iter)();\n if (mx instanceof Just && p(mx.value0)) {\n push(mx.value0)(array)();\n return $$void(functorST)(next(iter))();\n } return $$void(functorST)(_write(true)($$break))();\n })();\n } return {};\n };\n };\n };\n};\nvar iterator = function (f) {\n return map(functorST)(Iterator.create(f))(_new(0));\n};\nvar iterate = function (iter) {\n return function (f) {\n return function __do() {\n var $$break = _new(false)();\n while (map(functorST)(not(heytingAlgebraBoolean))(_read($$break))()) {\n (function __do() {\n var mx = next(iter)();\n if (mx instanceof Just) {\n return f(mx.value0)();\n } if (mx instanceof Nothing) {\n return $$void(functorST)(_write(true)($$break))();\n } throw new Error(\"Failed pattern match at Data.Array.ST.Iterator (line 42, column 5 - line 44, column 47): \" + [mx.constructor.name]);\n })();\n } return {};\n };\n };\n};\nvar exhausted = function () {\n var $13 = map(functorST)(isNothing);\n return function ($14) {\n return $13(peek($14));\n };\n}();var Tuple = function () {\n function Tuple(value0, value1) {\n this.value0 = value0;\n this.value1 = value1;\n } Tuple.create = function (value0) {\n return function (value1) {\n return new Tuple(value0, value1);\n };\n };\n return Tuple;\n}();\nvar bifunctorTuple = new Bifunctor(function (f) {\n return function (g) {\n return function (v) {\n return new Tuple(f(v.value0), g(v.value1));\n };\n };\n});var singleton = function (a) {\n return [a];\n};\nvar index = _indexImpl(Just.create)(Nothing.value);\nvar unzip = function (xs) {\n return function __do() {\n var fsts = _empty();\n var snds = _empty();\n var iter = iterator(function (v) {\n return index(xs)(v);\n })();\n iterate(iter)(function (v) {\n return function __do() {\n $$void(functorST)(push(v.value0)(fsts))();\n return $$void(functorST)(push(v.value1)(snds))();\n };\n })();\n var fsts$prime = _unsafeFreeze(fsts)();\n var snds$prime = _unsafeFreeze(snds)();\n return new Tuple(fsts$prime, snds$prime);\n }();\n};\nvar head = function (xs) {\n return index(xs)(0);\n};\nvar groupBy = function (op) {\n return function (xs) {\n return function __do() {\n var result = _empty();\n var iter = iterator(function (v) {\n return index(xs)(v);\n })();\n iterate(iter)(function (x) {\n return $$void(functorST)(function __do() {\n var sub = _empty();\n push(x)(sub)();\n pushWhile(op(x))(iter)(sub)();\n var grp = _unsafeFreeze(sub)();\n return push(grp)(result)();\n });\n })();\n return _unsafeFreeze(result)();\n }();\n };\n};\nvar group = function (dictEq) {\n return function (xs) {\n return groupBy(eq(dictEq))(xs);\n };\n};\nvar concatMap = flip(bind(bindArray));\nvar mapMaybe = function (f) {\n return concatMap(function () {\n var $94 = maybe([])(singleton);\n return function ($95) {\n return $94(f($95));\n };\n }());\n};\nvar catMaybes = mapMaybe(identity(categoryFn));var functorNonEmptyArray = functorArray;\nvar bindNonEmptyArray = bindArray;var _unsafeCoerce = function (x) {\n return x;\n};var unsafeFromArray = _unsafeCoerce;\nvar toArray = _unsafeCoerce;\nvar unzip$1 = function () {\n var $43 = bimap(bifunctorTuple)(unsafeFromArray)(unsafeFromArray);\n return function ($44) {\n return $43(unzip(toArray($44)));\n };\n}();\nvar concatMap$1 = flip(bind(bindNonEmptyArray));\nvar concat = function () {\n var $60 = map(functorNonEmptyArray)(toArray);\n return function ($61) {\n return unsafeFromArray(_concat(toArray($60($61))));\n };\n}();\nvar adaptMaybe = function (f) {\n var $64 = fromJust();\n return function ($65) {\n return $64(f(toArray($65)));\n };\n};\nvar head$1 = adaptMaybe(head);\nvar adaptAny = function (f) {\n return function ($67) {\n return f(toArray($67));\n };\n};\nvar length = adaptAny(_length);var _toCharArray = function (s) {\n return s.split(\"\");\n};var solve = function () {\n var count = function (s) {\n var v = function (v1) {\n {\n return 0;\n } };\n var $4 = function () {\n var $6 = find(foldableArray)(function (na) {\n return head$1(na) === \"R\";\n });\n var $7 = group(eqChar);\n return function ($8) {\n return $6($7($8));\n };\n }()(_toCharArray(s));\n if ($4 instanceof Just) {\n return length($4.value0);\n } return v();\n };\n var $9 = show(showInt);\n return function ($10) {\n return $9(count($10));\n };\n}();var _readAll = function () {\n return function () {\n return fs.readFileSync(\"/dev/stdin\", \"utf8\");\n };\n};var _log = function (s) {\n return function () {\n console.log(s);\n return {};\n };\n};var interact = function (solve) {\n return bind(bindEffect)(mapFlipped(functorEffect)(_readAll())(solve))(_log);\n};var main = interact(solve);\nvar _default = {\n main: main\n};exports.__reserved_default=_default;exports.main=main;\nmain();", "language": "JavaScript", "metadata": {"date": 1597616075, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02582.html", "problem_id": "p02582", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02582/input.txt", "sample_output_relpath": "derived/input_output/data/p02582/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02582/JavaScript/s337462208.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s337462208", "user_id": "u491103807"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "'use strict';Object.defineProperty(exports,'__esModule',{value:true});var fs=require('fs');var _length = function (xs) {\n return xs.length;\n};\nvar _indexImpl = function (just) {\n return function (nothing) {\n return function (xs) {\n return function (i) {\n return i < 0 || i >= xs.length ? nothing : just(xs[i]);\n };\n };\n };\n};\nvar _concat = function (xss) {\n if (xss.length <= 10000) {\n return Array.prototype.concat.apply([], xss);\n }\n var result = [];\n for (var i = 0, l = xss.length; i < l; i++) {\n var xs = xss[i];\n for (var j = 0, m = xs.length; j < m; j++) {\n result.push(xs[j]);\n }\n }\n return result;\n};var _arrayMap = function (f) {\n return function (arr) {\n var l = arr.length;\n var result = new Array(l);\n for (var i = 0; i < l; i++) {\n result[i] = f(arr[i]);\n }\n return result;\n };\n};var Semigroupoid = function (compose) {\n this.compose = compose;\n};\nvar semigroupoidFn = new Semigroupoid(function (f) {\n return function (g) {\n return function (x) {\n return f(g(x));\n };\n };\n});\nvar compose = function (dict) {\n return dict.compose;\n};var flip = function (f) {\n return function (b) {\n return function (a) {\n return f(a)(b);\n };\n };\n};\nvar $$const = function (a) {\n return function (v) {\n return a;\n };\n};var _unit = {};var _showIntImpl = function (n) {\n return n.toString();\n};var Show = function (show) {\n this.show = show;\n};\nvar showInt = new Show(_showIntImpl);\nvar show = function (dict) {\n return dict.show;\n};var Functor = function (map) {\n this.map = map;\n};\nvar map = function (dict) {\n return dict.map;\n};\nvar mapFlipped = function (dictFunctor) {\n return function (fa) {\n return function (f) {\n return map(dictFunctor)(f)(fa);\n };\n };\n};\nvar $$void = function (dictFunctor) {\n return map(dictFunctor)($$const(_unit));\n};\nvar functorFn = new Functor(compose(semigroupoidFn));\nvar functorArray = new Functor(_arrayMap);var _concatArray = function (xs) {\n return function (ys) {\n if (xs.length === 0) return ys;\n if (ys.length === 0) return xs;\n return xs.concat(ys);\n };\n};var Semigroup = function (append) {\n this.append = append;\n};\nvar semigroupArray = new Semigroup(_concatArray);\nvar append = function (dict) {\n return dict.append;\n};var Alt = function (Functor0, alt) {\n this.Functor0 = Functor0;\n this.alt = alt;\n};\nvar altArray = new Alt(function () {\n return functorArray;\n}, append(semigroupArray));var _arrayApply = function (fs) {\n return function (xs) {\n var l = fs.length;\n var k = xs.length;\n var result = new Array(l * k);\n var n = 0;\n for (var i = 0; i < l; i++) {\n var f = fs[i];\n for (var j = 0; j < k; j++) {\n result[n++] = f(xs[j]);\n }\n }\n return result;\n };\n};var Category = function (Semigroupoid0, identity) {\n this.Semigroupoid0 = Semigroupoid0;\n this.identity = identity;\n};\nvar identity = function (dict) {\n return dict.identity;\n};\nvar categoryFn = new Category(function () {\n return semigroupoidFn;\n}, function (x) {\n return x;\n});var Apply = function (Functor0, apply) {\n this.Functor0 = Functor0;\n this.apply = apply;\n};\nvar applyArray = new Apply(function () {\n return functorArray;\n}, _arrayApply);\nvar apply = function (dict) {\n return dict.apply;\n};var Applicative = function (Apply0, pure) {\n this.Apply0 = Apply0;\n this.pure = pure;\n};\nvar pure = function (dict) {\n return dict.pure;\n};\nvar liftA1 = function (dictApplicative) {\n return function (f) {\n return function (a) {\n return apply(dictApplicative.Apply0())(pure(dictApplicative)(f))(a);\n };\n };\n};var _arrayBind = function (arr) {\n return function (f) {\n var result = [];\n for (var i = 0, l = arr.length; i < l; i++) {\n Array.prototype.push.apply(result, f(arr[i]));\n }\n return result;\n };\n};var Bind = function (Apply0, bind) {\n this.Apply0 = Apply0;\n this.bind = bind;\n};\nvar bindArray = new Bind(function () {\n return applyArray;\n}, _arrayBind);\nvar bind = function (dict) {\n return dict.bind;\n};var Monad = function (Applicative0, Bind1) {\n this.Applicative0 = Applicative0;\n this.Bind1 = Bind1;\n};\nvar ap = function (dictMonad) {\n return function (f) {\n return function (a) {\n return bind(dictMonad.Bind1())(f)(function (f$prime) {\n return bind(dictMonad.Bind1())(a)(function (a$prime) {\n return pure(dictMonad.Applicative0())(f$prime(a$prime));\n });\n });\n };\n };\n};var Bifunctor = function (bimap) {\n this.bimap = bimap;\n};\nvar bimap = function (dict) {\n return dict.bimap;\n};var _foldrArray = function (f) {\n return function (init) {\n return function (xs) {\n var acc = init;\n var len = xs.length;\n for (var i = len - 1; i >= 0; i--) {\n acc = f(xs[i])(acc);\n }\n return acc;\n };\n };\n};\nvar _foldlArray = function (f) {\n return function (init) {\n return function (xs) {\n var acc = init;\n var len = xs.length;\n for (var i = 0; i < len; i++) {\n acc = f(acc)(xs[i]);\n }\n return acc;\n };\n };\n};var Plus = function (Alt0, empty) {\n this.Alt0 = Alt0;\n this.empty = empty;\n};var refEq = function (r1) {\n return function (r2) {\n return r1 === r2;\n };\n};var Eq = function (eq) {\n this.eq = eq;\n};\nvar eqChar = new Eq(refEq);\nvar eq = function (dict) {\n return dict.eq;\n};var _boolConj = function (b1) {\n return function (b2) {\n return b1 && b2;\n };\n};\nvar _boolDisj = function (b1) {\n return function (b2) {\n return b1 || b2;\n };\n};\nvar _boolNot = function (b) {\n return !b;\n};var HeytingAlgebra = function (conj, disj, ff, implies, not, tt) {\n this.conj = conj;\n this.disj = disj;\n this.ff = ff;\n this.implies = implies;\n this.not = not;\n this.tt = tt;\n};\nvar not = function (dict) {\n return dict.not;\n};\nvar disj = function (dict) {\n return dict.disj;\n};\nvar heytingAlgebraBoolean = new HeytingAlgebra(_boolConj, _boolDisj, false, function (a) {\n return function (b) {\n return disj(heytingAlgebraBoolean)(not(heytingAlgebraBoolean)(a))(b);\n };\n}, _boolNot, true);var Monoid = function (Semigroup0, mempty) {\n this.Semigroup0 = Semigroup0;\n this.mempty = mempty;\n};\nvar mempty = function (dict) {\n return dict.mempty;\n};var Nothing = function () {\n function Nothing() {} Nothing.value = new Nothing();\n return Nothing;\n}();\nvar Just = function () {\n function Just(value0) {\n this.value0 = value0;\n } Just.create = function (value0) {\n return new Just(value0);\n };\n return Just;\n}();\nvar maybe = function (v) {\n return function (v1) {\n return function (v2) {\n if (v2 instanceof Nothing) {\n return v;\n } if (v2 instanceof Just) {\n return v1(v2.value0);\n } throw new Error(\"Failed pattern match at Data.Maybe (line 217, column 1 - line 217, column 51): \" + [v.constructor.name, v1.constructor.name, v2.constructor.name]);\n };\n };\n};\nvar isNothing = maybe(true)($$const(false));\nvar functorMaybe = new Functor(function (v) {\n return function (v1) {\n if (v1 instanceof Just) {\n return new Just(v(v1.value0));\n } return Nothing.value;\n };\n});\nvar fromJust = function (dictPartial) {\n return function (v) {\n if (v instanceof Just) {\n return v.value0;\n } throw new Error(\"Failed pattern match at Data.Maybe (line 268, column 1 - line 268, column 46): \" + [v.constructor.name]);\n };\n};var Foldable = function (foldMap, foldl, foldr) {\n this.foldMap = foldMap;\n this.foldl = foldl;\n this.foldr = foldr;\n};\nvar foldr = function (dict) {\n return dict.foldr;\n};\nvar foldl = function (dict) {\n return dict.foldl;\n};\nvar foldMapDefaultR = function (dictFoldable) {\n return function (dictMonoid) {\n return function (f) {\n return foldr(dictFoldable)(function (x) {\n return function (acc) {\n return append(dictMonoid.Semigroup0())(f(x))(acc);\n };\n })(mempty(dictMonoid));\n };\n };\n};\nvar foldableArray = new Foldable(function (dictMonoid) {\n return foldMapDefaultR(foldableArray)(dictMonoid);\n}, _foldlArray, _foldrArray);\nvar find = function (dictFoldable) {\n return function (p) {\n var go = function (v) {\n return function (v1) {\n if (v instanceof Nothing && p(v1)) {\n return new Just(v1);\n } return v;\n };\n };\n return foldl(dictFoldable)(go)(Nothing.value);\n };\n};var semigroupFirst = new Semigroup(function (v) {\n return function (v1) {\n if (v instanceof Just) {\n return v;\n } return v1;\n };\n});\nvar monoidFirst = new Monoid(function () {\n return semigroupFirst;\n}, Nothing.value);\nvar functorFirst = functorMaybe;\nvar altFirst = new Alt(function () {\n return functorFirst;\n}, append(semigroupFirst));\nvar plusFirst = new Plus(function () {\n return altFirst;\n}, mempty(monoidFirst));var semigroupLast = new Semigroup(function (v) {\n return function (v1) {\n if (v1 instanceof Just) {\n return v1;\n } if (v1 instanceof Nothing) {\n return v;\n } throw new Error(\"Failed pattern match at Data.Maybe.Last (line 52, column 1 - line 54, column 36): \" + [v.constructor.name, v1.constructor.name]);\n };\n});\nvar monoidLast = new Monoid(function () {\n return semigroupLast;\n}, Nothing.value);\nvar functorLast = functorMaybe;\nvar altLast = new Alt(function () {\n return functorLast;\n}, append(semigroupLast));\nvar plusLast = new Plus(function () {\n return altLast;\n}, mempty(monoidLast));var _pureE = function (a) {\n return function () {\n return a;\n };\n};\nvar _bindE = function (a) {\n return function (f) {\n return function () {\n return f(a())();\n };\n };\n};var monadEffect = new Monad(function () {\n return applicativeEffect;\n}, function () {\n return bindEffect;\n});\nvar bindEffect = new Bind(function () {\n return applyEffect;\n}, _bindE);\nvar applyEffect = new Apply(function () {\n return functorEffect;\n}, ap(monadEffect));\nvar applicativeEffect = new Applicative(function () {\n return applyEffect;\n}, _pureE);\nvar functorEffect = new Functor(liftA1(applicativeEffect));var _map_ = function (f) {\n return function (a) {\n return function () {\n return f(a());\n };\n };\n};\nvar _new = function (val) {\n return function () {\n return { value: val };\n };\n};\nvar _read = function (ref) {\n return function () {\n return ref.value;\n };\n};\nvar _modify$prime = function (f) {\n return function (ref) {\n return function () {\n var t = f(ref.value);\n ref.value = t.state;\n return t.value;\n };\n };\n};\nvar _write = function (a) {\n return function (ref) {\n return function () {\n return ref.value = a;\n };\n };\n};var modify = function (f) {\n return _modify$prime(function (s) {\n var s$prime = f(s);\n return {\n state: s$prime,\n value: s$prime\n };\n });\n};\nvar functorST = new Functor(_map_);var _empty = function () {\n return [];\n};\nvar _pushAll = function (as) {\n return function (xs) {\n return function () {\n return xs.push.apply(xs, as);\n };\n };\n};\nvar _unsafeFreeze = function (xs) {\n return function () {\n return xs;\n };\n};var push = function (a) {\n return _pushAll([a]);\n};var Iterator = function () {\n function Iterator(value0, value1) {\n this.value0 = value0;\n this.value1 = value1;\n } Iterator.create = function (value0) {\n return function (value1) {\n return new Iterator(value0, value1);\n };\n };\n return Iterator;\n}();\nvar peek = function (v) {\n return function __do() {\n var i = _read(v.value1)();\n return v.value0(i);\n };\n};\nvar next = function (v) {\n return function __do() {\n var i = _read(v.value1)();\n modify(function (v1) {\n return v1 + 1 | 0;\n })(v.value1)();\n return v.value0(i);\n };\n};\nvar pushWhile = function (p) {\n return function (iter) {\n return function (array) {\n return function __do() {\n var $$break = _new(false)();\n while (map(functorST)(not(heytingAlgebraBoolean))(_read($$break))()) {\n (function __do() {\n var mx = peek(iter)();\n if (mx instanceof Just && p(mx.value0)) {\n push(mx.value0)(array)();\n return $$void(functorST)(next(iter))();\n } return $$void(functorST)(_write(true)($$break))();\n })();\n } return {};\n };\n };\n };\n};\nvar iterator = function (f) {\n return map(functorST)(Iterator.create(f))(_new(0));\n};\nvar iterate = function (iter) {\n return function (f) {\n return function __do() {\n var $$break = _new(false)();\n while (map(functorST)(not(heytingAlgebraBoolean))(_read($$break))()) {\n (function __do() {\n var mx = next(iter)();\n if (mx instanceof Just) {\n return f(mx.value0)();\n } if (mx instanceof Nothing) {\n return $$void(functorST)(_write(true)($$break))();\n } throw new Error(\"Failed pattern match at Data.Array.ST.Iterator (line 42, column 5 - line 44, column 47): \" + [mx.constructor.name]);\n })();\n } return {};\n };\n };\n};\nvar exhausted = function () {\n var $13 = map(functorST)(isNothing);\n return function ($14) {\n return $13(peek($14));\n };\n}();var Tuple = function () {\n function Tuple(value0, value1) {\n this.value0 = value0;\n this.value1 = value1;\n } Tuple.create = function (value0) {\n return function (value1) {\n return new Tuple(value0, value1);\n };\n };\n return Tuple;\n}();\nvar bifunctorTuple = new Bifunctor(function (f) {\n return function (g) {\n return function (v) {\n return new Tuple(f(v.value0), g(v.value1));\n };\n };\n});var singleton = function (a) {\n return [a];\n};\nvar index = _indexImpl(Just.create)(Nothing.value);\nvar unzip = function (xs) {\n return function __do() {\n var fsts = _empty();\n var snds = _empty();\n var iter = iterator(function (v) {\n return index(xs)(v);\n })();\n iterate(iter)(function (v) {\n return function __do() {\n $$void(functorST)(push(v.value0)(fsts))();\n return $$void(functorST)(push(v.value1)(snds))();\n };\n })();\n var fsts$prime = _unsafeFreeze(fsts)();\n var snds$prime = _unsafeFreeze(snds)();\n return new Tuple(fsts$prime, snds$prime);\n }();\n};\nvar head = function (xs) {\n return index(xs)(0);\n};\nvar groupBy = function (op) {\n return function (xs) {\n return function __do() {\n var result = _empty();\n var iter = iterator(function (v) {\n return index(xs)(v);\n })();\n iterate(iter)(function (x) {\n return $$void(functorST)(function __do() {\n var sub = _empty();\n push(x)(sub)();\n pushWhile(op(x))(iter)(sub)();\n var grp = _unsafeFreeze(sub)();\n return push(grp)(result)();\n });\n })();\n return _unsafeFreeze(result)();\n }();\n };\n};\nvar group = function (dictEq) {\n return function (xs) {\n return groupBy(eq(dictEq))(xs);\n };\n};\nvar concatMap = flip(bind(bindArray));\nvar mapMaybe = function (f) {\n return concatMap(function () {\n var $94 = maybe([])(singleton);\n return function ($95) {\n return $94(f($95));\n };\n }());\n};\nvar catMaybes = mapMaybe(identity(categoryFn));var functorNonEmptyArray = functorArray;\nvar bindNonEmptyArray = bindArray;var _unsafeCoerce = function (x) {\n return x;\n};var unsafeFromArray = _unsafeCoerce;\nvar toArray = _unsafeCoerce;\nvar unzip$1 = function () {\n var $43 = bimap(bifunctorTuple)(unsafeFromArray)(unsafeFromArray);\n return function ($44) {\n return $43(unzip(toArray($44)));\n };\n}();\nvar concatMap$1 = flip(bind(bindNonEmptyArray));\nvar concat = function () {\n var $60 = map(functorNonEmptyArray)(toArray);\n return function ($61) {\n return unsafeFromArray(_concat(toArray($60($61))));\n };\n}();\nvar adaptMaybe = function (f) {\n var $64 = fromJust();\n return function ($65) {\n return $64(f(toArray($65)));\n };\n};\nvar head$1 = adaptMaybe(head);\nvar adaptAny = function (f) {\n return function ($67) {\n return f(toArray($67));\n };\n};\nvar length = adaptAny(_length);var _toCharArray = function (s) {\n return s.split(\"\");\n};var solve = function () {\n var count = function (s) {\n var v = function (v1) {\n {\n return 0;\n } };\n var $4 = function () {\n var $6 = find(foldableArray)(function (na) {\n return head$1(na) === \"R\";\n });\n var $7 = group(eqChar);\n return function ($8) {\n return $6($7($8));\n };\n }()(_toCharArray(s));\n if ($4 instanceof Just) {\n return length($4.value0);\n } return v();\n };\n var $9 = show(showInt);\n return function ($10) {\n return $9(count($10));\n };\n}();var _readAll = function () {\n return function () {\n return fs.readFileSync(\"/dev/stdin\", \"utf8\");\n };\n};var _log = function (s) {\n return function () {\n console.log(s);\n return {};\n };\n};var interact = function (solve) {\n return bind(bindEffect)(mapFlipped(functorEffect)(_readAll())(solve))(_log);\n};var main = interact(solve);\nvar _default = {\n main: main\n};exports.__reserved_default=_default;exports.main=main;\nmain();", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "sample_input": "RRS\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02582", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.\n\nFind the maximum number of consecutive rainy days in this period.\n\nConstraints\n\n|S| = 3\n\nEach character of S is S or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of consecutive rainy days in the period.\n\nSample Input 1\n\nRRS\n\nSample Output 1\n\n2\n\nWe had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.\n\nSample Input 2\n\nSSS\n\nSample Output 2\n\n0\n\nIt was sunny throughout the period. We had no rainy days, so we should print 0.\n\nSample Input 3\n\nRSR\n\nSample Output 3\n\n1\n\nWe had rain on the 1-st and 3-rd days - two \"streaks\" of one rainy day, so we should print 1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 18404, "cpu_time_ms": 62, "memory_kb": 29840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s608824626", "group_id": "codeNet:p02583", "input_text": "inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n')\nN = inp.shift() * 1\nl = inp.shift().split(' ').map(x => +x).sort((a, b) => a - b)\nc = 0 \nfor (i=0; i +x).sort((a, b) => a - b)\nc = 0 \nfor (i=0; i+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(String(myOut));\n\nfunction main(){\n var n = next(), k = next();\n var p = nexts(n).map(a=>a-1);\n var c = nexts(n);\n var ans = -2e18, a = Array(n);\n for(var i = 0; i < n; i++){\n var cnt = 1;\n a = a.fill(0);\n var id = p[i];\n a[0] = c[id];\n while(cnt < k && id !== i){\n id = p[id];\n a[cnt] = a[cnt-1] + c[id];\n cnt++;\n }\n cnt;\n if(a[cnt-1] > 0)for(var j = 0; j < cnt; j++){\n var t = BigInt(a[j]) + BigInt(Math.floor((k-j-1)/cnt)) * BigInt(a[cnt-1]);\n if(ans < t)ans = t;\n }else for(var j = 0; j < cnt; j++){\n var t = a[j];\n if(ans < t)ans = t;\n }\n }\n return ans;\n}", "language": "JavaScript", "metadata": {"date": 1597542506, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02585.html", "problem_id": "p02585", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02585/input.txt", "sample_output_relpath": "derived/input_output/data/p02585/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02585/JavaScript/s070989341.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s070989341", "user_id": "u643613120"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(){return +cin[cid++];}\nfunction nextstr(){return cin[cid++];}\nfunction nextbig(){return BigInt(cin[cid++]);}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(String(myOut));\n\nfunction main(){\n var n = next(), k = next();\n var p = nexts(n).map(a=>a-1);\n var c = nexts(n);\n var ans = -2e18, a = Array(n);\n for(var i = 0; i < n; i++){\n var cnt = 1;\n a = a.fill(0);\n var id = p[i];\n a[0] = c[id];\n while(cnt < k && id !== i){\n id = p[id];\n a[cnt] = a[cnt-1] + c[id];\n cnt++;\n }\n cnt;\n if(a[cnt-1] > 0)for(var j = 0; j < cnt; j++){\n var t = BigInt(a[j]) + BigInt(Math.floor((k-j-1)/cnt)) * BigInt(a[cnt-1]);\n if(ans < t)ans = t;\n }else for(var j = 0; j < cnt; j++){\n var t = a[j];\n if(ans < t)ans = t;\n }\n }\n return ans;\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "sample_input": "5 2\n2 4 5 1 3\n3 4 -10 -8 8\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02585", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi will play a game using a piece on an array of squares numbered 1, 2, \\cdots, N. Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \\cdots, N: P_1, P_2, \\cdots, P_N.\n\nNow, he will choose one square and place the piece on that square. Then, he will make the following move some number of times between 1 and K (inclusive):\n\nIn one move, if the piece is now on Square i (1 \\leq i \\leq N), move it to Square P_i. Here, his score increases by C_{P_i}.\n\nHelp him by finding the maximum possible score at the end of the game. (The score is 0 at the beginning of the game.)\n\nConstraints\n\n2 \\leq N \\leq 5000\n\n1 \\leq K \\leq 10^9\n\n1 \\leq P_i \\leq N\n\nP_i \\neq i\n\nP_1, P_2, \\cdots, P_N are all different.\n\n-10^9 \\leq C_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nP_1 P_2 \\cdots P_N\nC_1 C_2 \\cdots C_N\n\nOutput\n\nPrint the maximum possible score at the end of the game.\n\nSample Input 1\n\n5 2\n2 4 5 1 3\n3 4 -10 -8 8\n\nSample Output 1\n\n8\n\nWhen we start at some square of our choice and make at most two moves, we have the following options:\n\nIf we start at Square 1, making one move sends the piece to Square 2, after which the score is 4. Making another move sends the piece to Square 4, after which the score is 4 + (-8) = -4.\n\nIf we start at Square 2, making one move sends the piece to Square 4, after which the score is -8. Making another move sends the piece to Square 1, after which the score is -8 + 3 = -5.\n\nIf we start at Square 3, making one move sends the piece to Square 5, after which the score is 8. Making another move sends the piece to Square 3, after which the score is 8 + (-10) = -2.\n\nIf we start at Square 4, making one move sends the piece to Square 1, after which the score is 3. Making another move sends the piece to Square 2, after which the score is 3 + 4 = 7.\n\nIf we start at Square 5, making one move sends the piece to Square 3, after which the score is -10. Making another move sends the piece to Square 5, after which the score is -10 + 8 = -2.\n\nThe maximum score achieved is 8.\n\nSample Input 2\n\n2 3\n2 1\n10 -7\n\nSample Output 2\n\n13\n\nSample Input 3\n\n3 3\n3 1 2\n-1000 -2000 -3000\n\nSample Output 3\n\n-1000\n\nWe have to make at least one move.\n\nSample Input 4\n\n10 58\n9 1 6 7 8 4 3 2 10 5\n695279662 988782657 -119067776 382975538 -151885171 -177220596 -169777795 37619092 389386780 980092719\n\nSample Output 4\n\n29507023469\n\nThe absolute value of the answer may be enormous.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1324, "cpu_time_ms": 3309, "memory_kb": 36856}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s400811085", "group_id": "codeNet:p02588", "input_text": "function main(input) {\n let args = input.split('\\n');\n args.pop();\n let count = 0;\n for (let i = 0;i < args.length;i++) {\n for (let j = i + 1;j < args.length;j++) {\n let result = (args[i] * 10000000000) * (args[j] * 10000000000);\n if (result % (10000000000 * 10000000000) == 0 && args[i] !== args[j]) {\n \tcount++;\n }\n }\n }\n console.log(count);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1597026072, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02588.html", "problem_id": "p02588", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02588/input.txt", "sample_output_relpath": "derived/input_output/data/p02588/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02588/JavaScript/s400811085.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s400811085", "user_id": "u720603143"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function main(input) {\n let args = input.split('\\n');\n args.pop();\n let count = 0;\n for (let i = 0;i < args.length;i++) {\n for (let j = i + 1;j < args.length;j++) {\n let result = (args[i] * 10000000000) * (args[j] * 10000000000);\n if (result % (10000000000 * 10000000000) == 0 && args[i] !== args[j]) {\n \tcount++;\n }\n }\n }\n console.log(count);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given N real values A_1, A_2, \\ldots, A_N.\nCompute the number of pairs of indices (i, j)\nsuch that i < j and the product A_i \\cdot A_j is integer.\n\nConstraints\n\n2 \\leq N \\leq 200\\,000\n\n0 < A_i < 10^4\n\nA_i is given with at most 9 digits after the decimal.\n\nInput\n\nInput is given from Standard Input in the following format.\n\nN\nA_1\nA_2\n\\vdots\nA_N\n\nOutput\n\nPrint the number of pairs with integer product A_i \\cdot A_j (and i < j).\n\nSample Input 1\n\n5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n\nSample Output 1\n\n3\n\nThere are 3 pairs with integer product:\n\n7.5 \\cdot 2.4 = 18\n\n7.5 \\cdot 16 = 120\n\n17 \\cdot 16 = 272\n\nSample Input 2\n\n11\n0.9\n1\n1\n1.25\n2.30000\n5\n70\n0.000000001\n9999.999999999\n0.999999999\n1.000000001\n\nSample Output 2\n\n8", "sample_input": "5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02588", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given N real values A_1, A_2, \\ldots, A_N.\nCompute the number of pairs of indices (i, j)\nsuch that i < j and the product A_i \\cdot A_j is integer.\n\nConstraints\n\n2 \\leq N \\leq 200\\,000\n\n0 < A_i < 10^4\n\nA_i is given with at most 9 digits after the decimal.\n\nInput\n\nInput is given from Standard Input in the following format.\n\nN\nA_1\nA_2\n\\vdots\nA_N\n\nOutput\n\nPrint the number of pairs with integer product A_i \\cdot A_j (and i < j).\n\nSample Input 1\n\n5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n\nSample Output 1\n\n3\n\nThere are 3 pairs with integer product:\n\n7.5 \\cdot 2.4 = 18\n\n7.5 \\cdot 16 = 120\n\n17 \\cdot 16 = 272\n\nSample Input 2\n\n11\n0.9\n1\n1\n1.25\n2.30000\n5\n70\n0.000000001\n9999.999999999\n0.999999999\n1.000000001\n\nSample Output 2\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 431, "cpu_time_ms": 2208, "memory_kb": 62592}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s221441543", "group_id": "codeNet:p02588", "input_text": "function Main(input) {\n let [l, ...valArr] = input.split('\\n')\n valArr = valArr.map(e=>parseFloat(e)).sort(function(a,b) { return a - b})\n let result = []\n let counter = 0\n for(let ele of valArr){\n let opArr = valArr.slice(++counter, valArr.length)\n let temp = opArr.filter(e=> (e*ele)%1===0)\n if(temp.length){result = [...result, ...temp]}\n }\n console.log(result.length)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1597025083, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02588.html", "problem_id": "p02588", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02588/input.txt", "sample_output_relpath": "derived/input_output/data/p02588/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02588/JavaScript/s221441543.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s221441543", "user_id": "u591390217"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function Main(input) {\n let [l, ...valArr] = input.split('\\n')\n valArr = valArr.map(e=>parseFloat(e)).sort(function(a,b) { return a - b})\n let result = []\n let counter = 0\n for(let ele of valArr){\n let opArr = valArr.slice(++counter, valArr.length)\n let temp = opArr.filter(e=> (e*ele)%1===0)\n if(temp.length){result = [...result, ...temp]}\n }\n console.log(result.length)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given N real values A_1, A_2, \\ldots, A_N.\nCompute the number of pairs of indices (i, j)\nsuch that i < j and the product A_i \\cdot A_j is integer.\n\nConstraints\n\n2 \\leq N \\leq 200\\,000\n\n0 < A_i < 10^4\n\nA_i is given with at most 9 digits after the decimal.\n\nInput\n\nInput is given from Standard Input in the following format.\n\nN\nA_1\nA_2\n\\vdots\nA_N\n\nOutput\n\nPrint the number of pairs with integer product A_i \\cdot A_j (and i < j).\n\nSample Input 1\n\n5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n\nSample Output 1\n\n3\n\nThere are 3 pairs with integer product:\n\n7.5 \\cdot 2.4 = 18\n\n7.5 \\cdot 16 = 120\n\n17 \\cdot 16 = 272\n\nSample Input 2\n\n11\n0.9\n1\n1\n1.25\n2.30000\n5\n70\n0.000000001\n9999.999999999\n0.999999999\n1.000000001\n\nSample Output 2\n\n8", "sample_input": "5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02588", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given N real values A_1, A_2, \\ldots, A_N.\nCompute the number of pairs of indices (i, j)\nsuch that i < j and the product A_i \\cdot A_j is integer.\n\nConstraints\n\n2 \\leq N \\leq 200\\,000\n\n0 < A_i < 10^4\n\nA_i is given with at most 9 digits after the decimal.\n\nInput\n\nInput is given from Standard Input in the following format.\n\nN\nA_1\nA_2\n\\vdots\nA_N\n\nOutput\n\nPrint the number of pairs with integer product A_i \\cdot A_j (and i < j).\n\nSample Input 1\n\n5\n7.5\n2.4\n17.000000001\n17\n16.000000000\n\nSample Output 1\n\n3\n\nThere are 3 pairs with integer product:\n\n7.5 \\cdot 2.4 = 18\n\n7.5 \\cdot 16 = 120\n\n17 \\cdot 16 = 272\n\nSample Input 2\n\n11\n0.9\n1\n1\n1.25\n2.30000\n5\n70\n0.000000001\n9999.999999999\n0.999999999\n1.000000001\n\nSample Output 2\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 445, "cpu_time_ms": 2229, "memory_kb": 756192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s920469505", "group_id": "codeNet:p02594", "input_text": "function MainA(input){\n console.log(Number(input.trim()) >=30 ? 'Yes' : 'No');\n}\nMainA(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1596546031, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02594.html", "problem_id": "p02594", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02594/input.txt", "sample_output_relpath": "derived/input_output/data/p02594/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02594/JavaScript/s920469505.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s920469505", "user_id": "u312237545"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "function MainA(input){\n console.log(Number(input.trim()) >=30 ? 'Yes' : 'No');\n}\nMainA(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n-40 \\leq X \\leq 40\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint Yes if you will turn on the air conditioner; print No otherwise.\n\nSample Input 1\n\n25\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n30\n\nSample Output 2\n\nYes", "sample_input": "25\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02594", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n-40 \\leq X \\leq 40\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint Yes if you will turn on the air conditioner; print No otherwise.\n\nSample Input 1\n\n25\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n30\n\nSample Output 2\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 141, "cpu_time_ms": 63, "memory_kb": 29560}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s979932769", "group_id": "codeNet:p02594", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\n // 1行目がinput[0], 2行目がinput[1], …に入る\n // var input1 = input.split(\"\\n\");\n // var input1 = input.split(\" \");\n // var n = Number(input1[0].split(' ')[0])\n // var k = Number(input1[0].split(' ')[1])\n // var nums = input1[1].split(' ').map(function (v) { return Number(v) })\n\n let n = Number(input)\n\n // console.log(input1\n // , n\n // , k\n // , nums)\n\n // var results = 0\n // var arrayNum = 0\n\n // for (var i = nums.length; i > 0; i--) {\n // arrayNum += i\n // }\n\n // const retArr2 = new Array(arrayNum).fill(0).map(function (v, idx) {\n // var getNum = 1\n\n // var idx2 = idx\n // // console.log('bg', idx, getNum)\n // while ((idx2 - (nums.length - getNum + 1)) >= 0) {\n\n // getNum++\n // // console.log(idx2)\n // idx2 = idx2 - (nums.length - getNum + 1)\n // // console.log(idx2, nums.length, getNum, (nums.length - getNum + 2))\n // }\n // console.log('ed', idx2, getNum)\n\n\n // const retArr = new Array(getNum).fill(null).map(function (v99, idx3) {\n // return nums[idx2 + idx3]\n // })\n\n\n // if (getNum > 3) {\n // throw new Error()\n // }\n\n // return {\n // getNum: getNum,\n // sum: retArr//.reduce(function (prev, curr) { return prev + curr }, 0)\n // }\n // })\n\n // console.log(retArr2)\n\n // while (getNum < nums.length) {\n\n // for (var n1 = 0; n1 < nums.length - getNum + 1; n1++) {\n // var n = nums.length - getNum + 1\n // var sumNums = new Array(n).fill(0)\n\n // sumNums = sumNums.map(function (v, idx) {\n // return new Array(getNum).fill(0).map(function (v2, idx2) {\n // return nums[n1 + idx2]\n // }).reduce(function (prev, curr) { return prev + curr }, 0)\n // })\n\n // console.log(\"sumNums1\", sumNums)\n\n // sumNums = sumNums.map(function (v3) {\n // if ((v3 % k) === getNum) {\n // return 1\n // } else {\n // return 0\n // }\n // }).reduce(function (prev, curr) { return prev + curr }, 0)\n // console.log(\"sumNums2\", sumNums)\n\n // console.log(\"sumNums\", sumNums, results)\n // results += sumNums\n // }\n\n // getNum++\n // console.log(\"getNum\", getNum, nums.length, results)\n // }\n\n // //文字列から10進数に変換するときはparseIntを使います\n // // var a = parseInt(i[0], 10);\n // // var b = parseInt(i[1], 10);\n // // var c = parseInt(i[2], 10);\n // var i1 = i.map(v => parseInt(v, 10))\n\n if (n >= 30) {\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n //出力\n // console.log(results, results);\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1596416860, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02594.html", "problem_id": "p02594", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02594/input.txt", "sample_output_relpath": "derived/input_output/data/p02594/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02594/JavaScript/s979932769.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s979932769", "user_id": "u317229831"}, "prompt_components": {"gold_output": "No\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\n // 1行目がinput[0], 2行目がinput[1], …に入る\n // var input1 = input.split(\"\\n\");\n // var input1 = input.split(\" \");\n // var n = Number(input1[0].split(' ')[0])\n // var k = Number(input1[0].split(' ')[1])\n // var nums = input1[1].split(' ').map(function (v) { return Number(v) })\n\n let n = Number(input)\n\n // console.log(input1\n // , n\n // , k\n // , nums)\n\n // var results = 0\n // var arrayNum = 0\n\n // for (var i = nums.length; i > 0; i--) {\n // arrayNum += i\n // }\n\n // const retArr2 = new Array(arrayNum).fill(0).map(function (v, idx) {\n // var getNum = 1\n\n // var idx2 = idx\n // // console.log('bg', idx, getNum)\n // while ((idx2 - (nums.length - getNum + 1)) >= 0) {\n\n // getNum++\n // // console.log(idx2)\n // idx2 = idx2 - (nums.length - getNum + 1)\n // // console.log(idx2, nums.length, getNum, (nums.length - getNum + 2))\n // }\n // console.log('ed', idx2, getNum)\n\n\n // const retArr = new Array(getNum).fill(null).map(function (v99, idx3) {\n // return nums[idx2 + idx3]\n // })\n\n\n // if (getNum > 3) {\n // throw new Error()\n // }\n\n // return {\n // getNum: getNum,\n // sum: retArr//.reduce(function (prev, curr) { return prev + curr }, 0)\n // }\n // })\n\n // console.log(retArr2)\n\n // while (getNum < nums.length) {\n\n // for (var n1 = 0; n1 < nums.length - getNum + 1; n1++) {\n // var n = nums.length - getNum + 1\n // var sumNums = new Array(n).fill(0)\n\n // sumNums = sumNums.map(function (v, idx) {\n // return new Array(getNum).fill(0).map(function (v2, idx2) {\n // return nums[n1 + idx2]\n // }).reduce(function (prev, curr) { return prev + curr }, 0)\n // })\n\n // console.log(\"sumNums1\", sumNums)\n\n // sumNums = sumNums.map(function (v3) {\n // if ((v3 % k) === getNum) {\n // return 1\n // } else {\n // return 0\n // }\n // }).reduce(function (prev, curr) { return prev + curr }, 0)\n // console.log(\"sumNums2\", sumNums)\n\n // console.log(\"sumNums\", sumNums, results)\n // results += sumNums\n // }\n\n // getNum++\n // console.log(\"getNum\", getNum, nums.length, results)\n // }\n\n // //文字列から10進数に変換するときはparseIntを使います\n // // var a = parseInt(i[0], 10);\n // // var b = parseInt(i[1], 10);\n // // var c = parseInt(i[2], 10);\n // var i1 = i.map(v => parseInt(v, 10))\n\n if (n >= 30) {\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n //出力\n // console.log(results, results);\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n-40 \\leq X \\leq 40\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint Yes if you will turn on the air conditioner; print No otherwise.\n\nSample Input 1\n\n25\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n30\n\nSample Output 2\n\nYes", "sample_input": "25\n"}, "reference_outputs": ["No\n"], "source_document_id": "p02594", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.\n\nThe current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?\n\nConstraints\n\n-40 \\leq X \\leq 40\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint Yes if you will turn on the air conditioner; print No otherwise.\n\nSample Input 1\n\n25\n\nSample Output 1\n\nNo\n\nSample Input 2\n\n30\n\nSample Output 2\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2821, "cpu_time_ms": 66, "memory_kb": 29684}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s150873420", "group_id": "codeNet:p02597", "input_text": "function MainD(input){\n const arr = input.split('\\n');\n const N = arr[0];\n const Ci = arr[1].split('');\n let answer = 0;\n\n // Wの数を数える\n let Wnum = 0;\n for(let i=0; i{\n const [n,c] = args.trim().split`\\n`;\n const N = n|0;\n let j = N, count = 0;\n for ( let i = 0; i < j; i++ ) {\n if ( c[i] === 'R' ) continue;\n for (;j > i;) {\n if ( c[j--] === 'R' ) {\n count++;\n break;\n }\n }\n }\n return count;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));\n", "language": "JavaScript", "metadata": {"date": 1596418424, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02597.html", "problem_id": "p02597", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02597/input.txt", "sample_output_relpath": "derived/input_output/data/p02597/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02597/JavaScript/s444784397.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444784397", "user_id": "u088845406"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "console.log((args=>{\n const [n,c] = args.trim().split`\\n`;\n const N = n|0;\n let j = N, count = 0;\n for ( let i = 0; i < j; i++ ) {\n if ( c[i] === 'R' ) continue;\n for (;j > i;) {\n if ( c[j--] === 'R' ) {\n count++;\n break;\n }\n }\n }\n return count;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "sample_input": "4\nWWRR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02597", "source_text": "Score : 400 points\n\nProblem Statement\n\nAn altar enshrines N stones arranged in a row from left to right. The color of the i-th stone from the left (1 \\leq i \\leq N) is given to you as a character c_i; R stands for red and W stands for white.\n\nYou can do the following two kinds of operations any number of times in any order:\n\nChoose two stones (not necessarily adjacent) and swap them.\n\nChoose one stone and change its color (from red to white and vice versa).\n\nAccording to a fortune-teller, a white stone placed to the immediate left of a red stone will bring a disaster. At least how many operations are needed to reach a situation without such a white stone?\n\nConstraints\n\n2 \\leq N \\leq 200000\n\nc_i is R or W.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nc_{1}c_{2}...c_{N}\n\nOutput\n\nPrint an integer representing the minimum number of operations needed.\n\nSample Input 1\n\n4\nWWRR\n\nSample Output 1\n\n2\n\nFor example, the two operations below will achieve the objective.\n\nSwap the 1-st and 3-rd stones from the left, resulting in RWWR.\n\nChange the color of the 4-th stone from the left, resulting in RWWW.\n\nSample Input 2\n\n2\nRR\n\nSample Output 2\n\n0\n\nIt can be the case that no operation is needed.\n\nSample Input 3\n\n8\nWRWWRWRR\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 340, "cpu_time_ms": 65, "memory_kb": 32636}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s161900760", "group_id": "codeNet:p02601", "input_text": "//let input = \"7 4 2\\n3\";\n\nfunction main(input){\n input = input.trim();\n let l1 = input.split(\"\\n\")[0];\n let l2 = input.split(\"\\n\")[1];\n let r = parseInt(l1.split(\" \")[0]);\n let g = parseInt(l1.split(\" \")[1]);\n let b = parseInt(l1.split(\" \")[2]);\n let n = parseInt(l2);\n\n function hantei(){\n return(rg){\n g = g*2;\n }else if(g>b){\n b = b*2\n }\n }\n \n for(i=0; ig){\n g = g*2;\n }else if(g>b){\n b = b*2\n }\n }\n \n for(i=0; i {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function () { return this.index < this.max },\n \"next\": function () { if (!this.hasNext()) { throw \"ArrayIndexOutOfBoundsException\"; } else { return this.list[this.index++]; } }\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nconst Main = () => {\n let [n, k] = nextIntArray()\n let a = next().split(\" \").map(el => BigInt(el))\n let tmp = 1n\n for (let i = 0; i < k ; i++) {\n tmp = tmp * a[i]\n }\n let prev\n let ans = \"\"\n for (let i = k; i < n; i++) {\n prev = tmp\n tmp = tmp / a[i - k]\n tmp = tmp * a[i]\n if (tmp > prev) {\n ans += \"Yes\\n\"\n } else {\n ans += \"No\\n\"\n }\n }\n console.log(ans)\n}\nMain()\n\n\n", "language": "JavaScript", "metadata": {"date": 1595731150, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02602.html", "problem_id": "p02602", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02602/input.txt", "sample_output_relpath": "derived/input_output/data/p02602/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02602/JavaScript/s765170621.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s765170621", "user_id": "u267235552"}, "prompt_components": {"gold_output": "Yes\nNo\n", "input_to_evaluate": "\"use strict\"\nconst create = () => {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function () { return this.index < this.max },\n \"next\": function () { if (!this.hasNext()) { throw \"ArrayIndexOutOfBoundsException\"; } else { return this.list[this.index++]; } }\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nconst Main = () => {\n let [n, k] = nextIntArray()\n let a = next().split(\" \").map(el => BigInt(el))\n let tmp = 1n\n for (let i = 0; i < k ; i++) {\n tmp = tmp * a[i]\n }\n let prev\n let ans = \"\"\n for (let i = k; i < n; i++) {\n prev = tmp\n tmp = tmp / a[i - k]\n tmp = tmp * a[i]\n if (tmp > prev) {\n ans += \"Yes\\n\"\n } else {\n ans += \"No\\n\"\n }\n }\n console.log(ans)\n}\nMain()\n\n\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nM-kun is a student in Aoki High School, where a year is divided into N terms.\n\nThere is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:\n\nFor the first through (K-1)-th terms: not given.\n\nFor each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.\n\nM-kun scored A_i in the exam at the end of the i-th term.\n\nFor each i such that K+1 \\leq i \\leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq K \\leq N-1\n\n1 \\leq A_i \\leq 10^{9}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 A_3 \\ldots A_N\n\nOutput\n\nPrint the answer in N-K lines.\n\nThe i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.\n\nSample Input 1\n\n5 3\n96 98 95 100 20\n\nSample Output 1\n\nYes\nNo\n\nHis grade for each term is computed as follows:\n\n3-rd term: (96 \\times 98 \\times 95) = 893760\n\n4-th term: (98 \\times 95 \\times 100) = 931000\n\n5-th term: (95 \\times 100 \\times 20) = 190000\n\nSample Input 2\n\n3 2\n1001 869120 1001\n\nSample Output 2\n\nNo\n\nNote that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.\n\nSample Input 3\n\n15 7\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9\n\nSample Output 3\n\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nYes", "sample_input": "5 3\n96 98 95 100 20\n"}, "reference_outputs": ["Yes\nNo\n"], "source_document_id": "p02602", "source_text": "Score: 300 points\n\nProblem Statement\n\nM-kun is a student in Aoki High School, where a year is divided into N terms.\n\nThere is an exam at the end of each term. According to the scores in those exams, a student is given a grade for each term, as follows:\n\nFor the first through (K-1)-th terms: not given.\n\nFor each of the K-th through N-th terms: the multiplication of the scores in the last K exams, including the exam in the graded term.\n\nM-kun scored A_i in the exam at the end of the i-th term.\n\nFor each i such that K+1 \\leq i \\leq N, determine whether his grade for the i-th term is strictly greater than the grade for the (i-1)-th term.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq K \\leq N-1\n\n1 \\leq A_i \\leq 10^{9}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 A_3 \\ldots A_N\n\nOutput\n\nPrint the answer in N-K lines.\n\nThe i-th line should contain Yes if the grade for the (K+i)-th term is greater than the grade for the (K+i-1)-th term, and No otherwise.\n\nSample Input 1\n\n5 3\n96 98 95 100 20\n\nSample Output 1\n\nYes\nNo\n\nHis grade for each term is computed as follows:\n\n3-rd term: (96 \\times 98 \\times 95) = 893760\n\n4-th term: (98 \\times 95 \\times 100) = 931000\n\n5-th term: (95 \\times 100 \\times 20) = 190000\n\nSample Input 2\n\n3 2\n1001 869120 1001\n\nSample Output 2\n\nNo\n\nNote that the output should be No if the grade for the 3-rd term is equal to the grade for the 2-nd term.\n\nSample Input 3\n\n15 7\n3 1 4 1 5 9 2 6 5 3 5 8 9 7 9\n\nSample Output 3\n\nYes\nYes\nNo\nYes\nYes\nNo\nYes\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1224, "cpu_time_ms": 2209, "memory_kb": 81748}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s690219382", "group_id": "codeNet:p02603", "input_text": "/*! path: /home/ts3min/work/tspro/src/contest/atcoder/msol2020/d.ts */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){\"use strict\";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,\"__esModule\",{value:!0}),t.main=void 0;const o=r(n(2)),i=n(3);function u(e){const t=i.getNextInt(e),n=t(),r=[];for(let e=0;et.next().value},t.getNextInt=function(e){const t=r(e);return()=>parseInt(t.next().value)},t.getNextBigInt=function(e){const t=r(e);return()=>BigInt(t.next().value)}}]);\n//# sourceMappingURL=submit.js.map", "language": "JavaScript", "metadata": {"date": 1595726909, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02603.html", "problem_id": "p02603", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02603/input.txt", "sample_output_relpath": "derived/input_output/data/p02603/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02603/JavaScript/s690219382.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s690219382", "user_id": "u144003804"}, "prompt_components": {"gold_output": "1685\n", "input_to_evaluate": "/*! path: /home/ts3min/work/tspro/src/contest/atcoder/msol2020/d.ts */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){\"use strict\";(function(e){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,\"__esModule\",{value:!0}),t.main=void 0;const o=r(n(2)),i=n(3);function u(e){const t=i.getNextInt(e),n=t(),r=[];for(let e=0;et.next().value},t.getNextInt=function(e){const t=r(e);return()=>parseInt(t.next().value)},t.getNextBigInt=function(e){const t=r(e);return()=>BigInt(t.next().value)}}]);\n//# sourceMappingURL=submit.js.map", "problem_context": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "sample_input": "7\n100 130 130 130 115 115 150\n"}, "reference_outputs": ["1685\n"], "source_document_id": "p02603", "source_text": "Score: 400 points\n\nProblem Statement\n\nTo become a millionaire, M-kun has decided to make money by trading in the next N days. Currently, he has 1000 yen and no stocks - only one kind of stock is issued in the country where he lives.\n\nHe is famous across the country for his ability to foresee the future. He already knows that the price of one stock in the next N days will be as follows:\n\nA_1 yen on the 1-st day, A_2 yen on the 2-nd day, ..., A_N yen on the N-th day.\n\nIn the i-th day, M-kun can make the following trade any number of times (possibly zero), within the amount of money and stocks that he has at the time.\n\nBuy stock: Pay A_i yen and receive one stock.\n\nSell stock: Sell one stock for A_i yen.\n\nWhat is the maximum possible amount of money that M-kun can have in the end by trading optimally?\n\nConstraints\n\n2 \\leq N \\leq 80\n\n100 \\leq A_i \\leq 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\cdots A_N\n\nOutput\n\nPrint the maximum possible amount of money that M-kun can have in the end, as an integer.\n\nSample Input 1\n\n7\n100 130 130 130 115 115 150\n\nSample Output 1\n\n1685\n\nIn this sample input, M-kun has seven days of trading. One way to have 1685 yen in the end is as follows:\n\nInitially, he has 1000 yen and no stocks.\n\nDay 1: Buy 10 stocks for 1000 yen. Now he has 0 yen.\n\nDay 2: Sell 7 stocks for 910 yen. Now he has 910 yen.\n\nDay 3: Sell 3 stocks for 390 yen. Now he has 1300 yen.\n\nDay 4: Do nothing.\n\nDay 5: Buy 1 stock for 115 yen. Now he has 1185 yen.\n\nDay 6: Buy 10 stocks for 1150 yen. Now he has 35 yen.\n\nDay 7: Sell 11 stocks for 1650 yen. Now he has 1685 yen.\n\nThere is no way to have 1686 yen or more in the end, so the answer is 1685.\n\nSample Input 2\n\n6\n200 180 160 140 120 100\n\nSample Output 2\n\n1000\n\nIn this sample input, it is optimal to do nothing throughout the six days, after which we will have 1000 yen.\n\nSample Input 3\n\n2\n157 193\n\nSample Output 3\n\n1216\n\nIn this sample input, it is optimal to buy 6 stocks in Day 1 and sell them in Day 2, after which we will have 1216 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2418, "cpu_time_ms": 65, "memory_kb": 29788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s329177071", "group_id": "codeNet:p02604", "input_text": "/*! path: /home/ts3min/work/tspro/src/contest/atcoder/msol2020/e.ts */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/contest/atcoder/msol2020/e.ts\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/webpack/buildin/module.js\":\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n/***/ }),\n\n/***/ \"./src/contest/atcoder/msol2020/e.ts\":\n/*!*******************************************!*\\\n !*** ./src/contest/atcoder/msol2020/e.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(module) {\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.main = void 0;\nconst fs_1 = __importDefault(__webpack_require__(/*! fs */ \"fs\"));\nconst io_1 = __webpack_require__(/*! ../../common/io */ \"./src/contest/common/io.ts\");\nconst INF = 1 << 30;\nvar Axis;\n(function (Axis) {\n Axis[\"X\"] = \"X\";\n Axis[\"Y\"] = \"Y\";\n Axis[\"N\"] = \"N\";\n})(Axis || (Axis = {}));\nfunction calc({ N, C, cand }) {\n let finalCost = 0;\n for (let i = 0; i < N; i++) {\n if (cand[i] != Axis.N) {\n continue;\n }\n let cost = Math.min(Math.abs(C[i].x), Math.abs(C[i].y)) * C[i].p;\n for (let j = 0; j < N; j++) {\n if (cand[j] == Axis.Y) {\n cost = Math.min(cost, Math.abs(C[i].x - C[j].x) * C[i].p);\n }\n else if (cand[j] == Axis.X) {\n cost = Math.min(cost, Math.abs(C[i].y - C[j].y) * C[i].p);\n }\n }\n finalCost += cost;\n }\n return finalCost;\n}\nfunction rec(i, k, sys) {\n const { cand, N, C, ans } = sys;\n if (i === N) {\n const res = calc({ N, C, cand });\n ans[k] = Math.min(ans[k], res);\n return;\n }\n cand[i] = Axis.N;\n rec(i + 1, k, sys);\n cand[i] = Axis.X;\n rec(i + 1, k + 1, sys);\n cand[i] = Axis.Y;\n rec(i + 1, k + 1, sys);\n}\nfunction solve({ N, C }) {\n const ans = Array(N + 1).fill(INF);\n const cand = Array(N);\n const sys = {\n N, C, ans, cand,\n };\n rec(0, 0, sys);\n return ans;\n}\nfunction main(line) {\n const nextInt = io_1.getNextInt(line);\n const N = nextInt();\n const C = [];\n for (let i = 0; i < N; i++) {\n const x = nextInt();\n const y = nextInt();\n const p = nextInt();\n C.push({ x, y, p });\n }\n console.log(solve({ N, C }).join('\\n'));\n}\nexports.main = main;\nif (__webpack_require__.c[__webpack_require__.s] === module) {\n const line = fs_1.default.readFileSync(\"/dev/stdin\", \"utf8\");\n main(line);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n/***/ }),\n\n/***/ \"./src/contest/common/io.ts\":\n/*!**********************************!*\\\n !*** ./src/contest/common/io.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getNextBigInt = exports.getNextInt = exports.getNext = exports.getIteratorWithParser = exports.getIterator = void 0;\nfunction* getIterator(line) {\n const tokens = line.split(/\\s+/);\n for (const token of tokens) {\n yield token;\n }\n}\nexports.getIterator = getIterator;\nfunction* getIteratorWithParser(line, parser) {\n const tokens = line.split(/\\s+/);\n for (const token of tokens) {\n yield parser(token);\n }\n}\nexports.getIteratorWithParser = getIteratorWithParser;\nfunction getNext(line) {\n const it = getIterator(line);\n return () => it.next().value;\n}\nexports.getNext = getNext;\nfunction getNextInt(line) {\n const it = getIterator(line);\n return () => parseInt(it.next().value);\n}\nexports.getNextInt = getNextInt;\nfunction getNextBigInt(line) {\n const it = getIterator(line);\n return () => BigInt(it.next().value);\n}\nexports.getNextBigInt = getNextBigInt;\n\n\n/***/ }),\n\n/***/ \"fs\":\n/*!*********************!*\\\n !*** external \"fs\" ***!\n \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"fs\");\n\n/***/ })\n\n/******/ });\n//# sourceMappingURL=submit.js.map", "language": "JavaScript", "metadata": {"date": 1595772811, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02604.html", "problem_id": "p02604", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02604/input.txt", "sample_output_relpath": "derived/input_output/data/p02604/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02604/JavaScript/s329177071.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s329177071", "user_id": "u144003804"}, "prompt_components": {"gold_output": "2900\n900\n0\n0\n", "input_to_evaluate": "/*! path: /home/ts3min/work/tspro/src/contest/atcoder/msol2020/e.ts */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/contest/atcoder/msol2020/e.ts\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/webpack/buildin/module.js\":\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n\n\n/***/ }),\n\n/***/ \"./src/contest/atcoder/msol2020/e.ts\":\n/*!*******************************************!*\\\n !*** ./src/contest/atcoder/msol2020/e.ts ***!\n \\*******************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function(module) {\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.main = void 0;\nconst fs_1 = __importDefault(__webpack_require__(/*! fs */ \"fs\"));\nconst io_1 = __webpack_require__(/*! ../../common/io */ \"./src/contest/common/io.ts\");\nconst INF = 1 << 30;\nvar Axis;\n(function (Axis) {\n Axis[\"X\"] = \"X\";\n Axis[\"Y\"] = \"Y\";\n Axis[\"N\"] = \"N\";\n})(Axis || (Axis = {}));\nfunction calc({ N, C, cand }) {\n let finalCost = 0;\n for (let i = 0; i < N; i++) {\n if (cand[i] != Axis.N) {\n continue;\n }\n let cost = Math.min(Math.abs(C[i].x), Math.abs(C[i].y)) * C[i].p;\n for (let j = 0; j < N; j++) {\n if (cand[j] == Axis.Y) {\n cost = Math.min(cost, Math.abs(C[i].x - C[j].x) * C[i].p);\n }\n else if (cand[j] == Axis.X) {\n cost = Math.min(cost, Math.abs(C[i].y - C[j].y) * C[i].p);\n }\n }\n finalCost += cost;\n }\n return finalCost;\n}\nfunction rec(i, k, sys) {\n const { cand, N, C, ans } = sys;\n if (i === N) {\n const res = calc({ N, C, cand });\n ans[k] = Math.min(ans[k], res);\n return;\n }\n cand[i] = Axis.N;\n rec(i + 1, k, sys);\n cand[i] = Axis.X;\n rec(i + 1, k + 1, sys);\n cand[i] = Axis.Y;\n rec(i + 1, k + 1, sys);\n}\nfunction solve({ N, C }) {\n const ans = Array(N + 1).fill(INF);\n const cand = Array(N);\n const sys = {\n N, C, ans, cand,\n };\n rec(0, 0, sys);\n return ans;\n}\nfunction main(line) {\n const nextInt = io_1.getNextInt(line);\n const N = nextInt();\n const C = [];\n for (let i = 0; i < N; i++) {\n const x = nextInt();\n const y = nextInt();\n const p = nextInt();\n C.push({ x, y, p });\n }\n console.log(solve({ N, C }).join('\\n'));\n}\nexports.main = main;\nif (__webpack_require__.c[__webpack_require__.s] === module) {\n const line = fs_1.default.readFileSync(\"/dev/stdin\", \"utf8\");\n main(line);\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n/***/ }),\n\n/***/ \"./src/contest/common/io.ts\":\n/*!**********************************!*\\\n !*** ./src/contest/common/io.ts ***!\n \\**********************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getNextBigInt = exports.getNextInt = exports.getNext = exports.getIteratorWithParser = exports.getIterator = void 0;\nfunction* getIterator(line) {\n const tokens = line.split(/\\s+/);\n for (const token of tokens) {\n yield token;\n }\n}\nexports.getIterator = getIterator;\nfunction* getIteratorWithParser(line, parser) {\n const tokens = line.split(/\\s+/);\n for (const token of tokens) {\n yield parser(token);\n }\n}\nexports.getIteratorWithParser = getIteratorWithParser;\nfunction getNext(line) {\n const it = getIterator(line);\n return () => it.next().value;\n}\nexports.getNext = getNext;\nfunction getNextInt(line) {\n const it = getIterator(line);\n return () => parseInt(it.next().value);\n}\nexports.getNextInt = getNextInt;\nfunction getNextBigInt(line) {\n const it = getIterator(line);\n return () => BigInt(it.next().value);\n}\nexports.getNextBigInt = getNextBigInt;\n\n\n/***/ }),\n\n/***/ \"fs\":\n/*!*********************!*\\\n !*** external \"fs\" ***!\n \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\nmodule.exports = require(\"fs\");\n\n/***/ })\n\n/******/ });\n//# sourceMappingURL=submit.js.map", "problem_context": "Score: 500 points\n\nProblem Statement\n\nNew AtCoder City has an infinite grid of streets, as follows:\n\nAt the center of the city stands a clock tower. Let (0, 0) be the coordinates of this point.\n\nA straight street, which we will call East-West Main Street, runs east-west and passes the clock tower. It corresponds to the x-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to East-West Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, y = -2, y = -1, y = 1, y = 2, \\ldots in the two-dimensional coordinate plane.\n\nA straight street, which we will call North-South Main Street, runs north-south and passes the clock tower. It corresponds to the y-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to North-South Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, x = -2, x = -1, x = 1, x = 2, \\ldots in the two-dimensional coordinate plane.\n\nThere are N residential areas in New AtCoder City. The i-th area is located at the intersection with the coordinates (X_i, Y_i) and has a population of P_i. Each citizen in the city lives in one of these areas.\n\nThe city currently has only two railroads, stretching infinitely, one along East-West Main Street and the other along North-South Main Street.\n\nM-kun, the mayor, thinks that they are not enough for the commuters, so he decides to choose K streets and build a railroad stretching infinitely along each of those streets.\n\nLet the walking distance of each citizen be the distance from his/her residential area to the nearest railroad.\n\nM-kun wants to build railroads so that the sum of the walking distances of all citizens, S, is minimized.\n\nFor each K = 0, 1, 2, \\dots, N, what is the minimum possible value of S after building railroads?\n\nConstraints\n\n1 \\leq N \\leq 15\n\n-10 \\ 000 \\leq X_i \\leq 10 \\ 000\n\n-10 \\ 000 \\leq Y_i \\leq 10 \\ 000\n\n1 \\leq P_i \\leq 1 \\ 000 \\ 000\n\nThe locations of the N residential areas, (X_i, Y_i), are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1 P_1\nX_2 Y_2 P_2\n: : :\nX_N Y_N P_N\n\nOutput\n\nPrint the answer in N+1 lines.\n\nThe i-th line (i = 1, \\ldots, N+1) should contain the minimum possible value of S after building railroads for the case K = i-1.\n\nSample Input 1\n\n3\n1 2 300\n3 3 600\n1 4 800\n\nSample Output 1\n\n2900\n900\n0\n0\n\nWhen K = 0, the residents of Area 1, 2, and 3 have to walk the distances of 1, 3, and 1, respectively, to reach a railroad.\n\nThus, the sum of the walking distances of all citizens, S, is 1 \\times 300 + 3 \\times 600 + 1 \\times 800 = 2900.\n\nWhen K = 1, if we build a railroad along the street corresponding to the line y = 4 in the coordinate plane, the walking distances of the citizens of Area 1, 2, and 3 become 1, 1, and 0, respectively.\n\nThen, S = 1 \\times 300 + 1 \\times 600 + 0 \\times 800 = 900.\n\nWe have many other options for where we build the railroad, but none of them makes S less than 900.\n\nWhen K = 2, if we build a railroad along the street corresponding to the lines x = 1 and x = 3 in the coordinate plane, all citizens can reach a railroad with the walking distance of 0, so S = 0. We can also have S = 0 when K = 3.\n\nThe figure below shows the optimal way to build railroads for the cases K = 0, 1, 2.\n\nThe street painted blue represents the roads along which we build railroads.\n\nSample Input 2\n\n5\n3 5 400\n5 3 700\n5 5 1000\n5 7 700\n7 5 400\n\nSample Output 2\n\n13800\n1600\n0\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the cases K = 1, 2.\n\nSample Input 3\n\n6\n2 5 1000\n5 2 1100\n5 5 1700\n-2 -5 900\n-5 -2 600\n-5 -5 2200\n\nSample Output 3\n\n26700\n13900\n3200\n1200\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 3.\n\nSample Input 4\n\n8\n2 2 286017\n3 1 262355\n2 -2 213815\n1 -3 224435\n-2 -2 136860\n-3 -1 239338\n-2 2 217647\n-1 3 141903\n\nSample Output 4\n\n2576709\n1569381\n868031\n605676\n366338\n141903\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 4.", "sample_input": "3\n1 2 300\n3 3 600\n1 4 800\n"}, "reference_outputs": ["2900\n900\n0\n0\n"], "source_document_id": "p02604", "source_text": "Score: 500 points\n\nProblem Statement\n\nNew AtCoder City has an infinite grid of streets, as follows:\n\nAt the center of the city stands a clock tower. Let (0, 0) be the coordinates of this point.\n\nA straight street, which we will call East-West Main Street, runs east-west and passes the clock tower. It corresponds to the x-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to East-West Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, y = -2, y = -1, y = 1, y = 2, \\ldots in the two-dimensional coordinate plane.\n\nA straight street, which we will call North-South Main Street, runs north-south and passes the clock tower. It corresponds to the y-axis in the two-dimensional coordinate plane.\n\nThere are also other infinitely many streets parallel to North-South Main Street, with a distance of 1 between them. They correspond to the lines \\ldots, x = -2, x = -1, x = 1, x = 2, \\ldots in the two-dimensional coordinate plane.\n\nThere are N residential areas in New AtCoder City. The i-th area is located at the intersection with the coordinates (X_i, Y_i) and has a population of P_i. Each citizen in the city lives in one of these areas.\n\nThe city currently has only two railroads, stretching infinitely, one along East-West Main Street and the other along North-South Main Street.\n\nM-kun, the mayor, thinks that they are not enough for the commuters, so he decides to choose K streets and build a railroad stretching infinitely along each of those streets.\n\nLet the walking distance of each citizen be the distance from his/her residential area to the nearest railroad.\n\nM-kun wants to build railroads so that the sum of the walking distances of all citizens, S, is minimized.\n\nFor each K = 0, 1, 2, \\dots, N, what is the minimum possible value of S after building railroads?\n\nConstraints\n\n1 \\leq N \\leq 15\n\n-10 \\ 000 \\leq X_i \\leq 10 \\ 000\n\n-10 \\ 000 \\leq Y_i \\leq 10 \\ 000\n\n1 \\leq P_i \\leq 1 \\ 000 \\ 000\n\nThe locations of the N residential areas, (X_i, Y_i), are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1 P_1\nX_2 Y_2 P_2\n: : :\nX_N Y_N P_N\n\nOutput\n\nPrint the answer in N+1 lines.\n\nThe i-th line (i = 1, \\ldots, N+1) should contain the minimum possible value of S after building railroads for the case K = i-1.\n\nSample Input 1\n\n3\n1 2 300\n3 3 600\n1 4 800\n\nSample Output 1\n\n2900\n900\n0\n0\n\nWhen K = 0, the residents of Area 1, 2, and 3 have to walk the distances of 1, 3, and 1, respectively, to reach a railroad.\n\nThus, the sum of the walking distances of all citizens, S, is 1 \\times 300 + 3 \\times 600 + 1 \\times 800 = 2900.\n\nWhen K = 1, if we build a railroad along the street corresponding to the line y = 4 in the coordinate plane, the walking distances of the citizens of Area 1, 2, and 3 become 1, 1, and 0, respectively.\n\nThen, S = 1 \\times 300 + 1 \\times 600 + 0 \\times 800 = 900.\n\nWe have many other options for where we build the railroad, but none of them makes S less than 900.\n\nWhen K = 2, if we build a railroad along the street corresponding to the lines x = 1 and x = 3 in the coordinate plane, all citizens can reach a railroad with the walking distance of 0, so S = 0. We can also have S = 0 when K = 3.\n\nThe figure below shows the optimal way to build railroads for the cases K = 0, 1, 2.\n\nThe street painted blue represents the roads along which we build railroads.\n\nSample Input 2\n\n5\n3 5 400\n5 3 700\n5 5 1000\n5 7 700\n7 5 400\n\nSample Output 2\n\n13800\n1600\n0\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the cases K = 1, 2.\n\nSample Input 3\n\n6\n2 5 1000\n5 2 1100\n5 5 1700\n-2 -5 900\n-5 -2 600\n-5 -5 2200\n\nSample Output 3\n\n26700\n13900\n3200\n1200\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 3.\n\nSample Input 4\n\n8\n2 2 286017\n3 1 262355\n2 -2 213815\n1 -3 224435\n-2 -2 136860\n-3 -1 239338\n-2 2 217647\n-1 3 141903\n\nSample Output 4\n\n2576709\n1569381\n868031\n605676\n366338\n141903\n0\n0\n0\n\nThe figure below shows the optimal way to build railroads for the case K = 4.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 8576, "cpu_time_ms": 3309, "memory_kb": 33592}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s764243577", "group_id": "codeNet:p02606", "input_text": "(async () => {\n process.stdin.setEncoding('utf8');\n let text = '';\n for await (const chunk of process.stdin) text += chunk;\n\n const lines = text.toString().split('\\n');\n const tmpArray = lines[1].split(' ');\n const count = lines[0];\n let result = 0;\n\n for (let i = 0; i < tmpArray.length; i++) {\n if (i % 2 === 0) {\n if (tmpArray[i] % 2 === 1) {\n result ++;\n }\n }\n }\n\n console.log(result);\n})();\n\n", "language": "JavaScript", "metadata": {"date": 1594516720, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02606.html", "problem_id": "p02606", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02606/input.txt", "sample_output_relpath": "derived/input_output/data/p02606/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02606/JavaScript/s764243577.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s764243577", "user_id": "u571644219"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "(async () => {\n process.stdin.setEncoding('utf8');\n let text = '';\n for await (const chunk of process.stdin) text += chunk;\n\n const lines = text.toString().split('\\n');\n const tmpArray = lines[1].split(' ');\n const count = lines[0];\n let result = 0;\n\n for (let i = 0; i < tmpArray.length; i++) {\n if (i % 2 === 0) {\n if (tmpArray[i] % 2 === 1) {\n result ++;\n }\n }\n }\n\n console.log(result);\n})();\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq L \\leq R \\leq 100\n\n1 \\leq d \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R d\n\nOutput\n\nPrint the number of multiples of d among the integers between L and R (inclusive).\n\nSample Input 1\n\n5 10 2\n\nSample Output 1\n\n3\n\nAmong the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.\n\nSample Input 2\n\n6 20 7\n\nSample Output 2\n\n2\n\nAmong the integers between 6 and 20, there are two multiples of 7: 7 and 14.\n\nSample Input 3\n\n1 100 1\n\nSample Output 3\n\n100", "sample_input": "5 10 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02606", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many multiples of d are there among the integers between L and R (inclusive)?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq L \\leq R \\leq 100\n\n1 \\leq d \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nL R d\n\nOutput\n\nPrint the number of multiples of d among the integers between L and R (inclusive).\n\nSample Input 1\n\n5 10 2\n\nSample Output 1\n\n3\n\nAmong the integers between 5 and 10, there are three multiples of 2: 6, 8, and 10.\n\nSample Input 2\n\n6 20 7\n\nSample Output 2\n\n2\n\nAmong the integers between 6 and 20, there are two multiples of 7: 7 and 14.\n\nSample Input 3\n\n1 100 1\n\nSample Output 3\n\n100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 430, "cpu_time_ms": 74, "memory_kb": 30032}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s627181436", "group_id": "codeNet:p02607", "input_text": "function Main(input){\n const num = input.split('\\n')[1].split(' ').map(Number);\n let odd_count = 0;\n // 奇数のマスのみチェック\n for(let n=0; n {\n return num % 2 === 0 ? false : i % 2 === 0 ? false : true;\n })\n console.log(ar2.length);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1594517484, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02607.html", "problem_id": "p02607", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02607/input.txt", "sample_output_relpath": "derived/input_output/data/p02607/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02607/JavaScript/s528718015.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s528718015", "user_id": "u722992894"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n\tconst n = input.split(\"\\n\")[0]\n\tconst ar = input.split(\"\\n\")[1].split(\" \")\n\tar2 = ar.filter((num, i)=> {\n return num % 2 === 0 ? false : i % 2 === 0 ? false : true;\n })\n console.log(ar2.length);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "sample_input": "5\n1 3 4 5 7\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02607", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N squares assigned the numbers 1,2,3,\\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.\n\nHow many squares i satisfy both of the following conditions?\n\nThe assigned number, i, is odd.\n\nThe written integer is odd.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, a_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\cdots a_N\n\nOutput\n\nPrint the number of squares that satisfy both of the conditions.\n\nSample Input 1\n\n5\n1 3 4 5 7\n\nSample Output 1\n\n2\n\nTwo squares, Square 1 and 5, satisfy both of the conditions.\n\nFor Square 2 and 4, the assigned numbers are not odd.\n\nFor Square 3, the written integer is not odd.\n\nSample Input 2\n\n15\n13 76 46 15 50 98 93 77 31 43 84 90 6 24 14\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 289, "cpu_time_ms": 61, "memory_kb": 29692}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s505032334", "group_id": "codeNet:p02608", "input_text": "var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split(\"\\n\");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(\" \").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();\nvar o = GET(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var N = +o.getValue(0);\n\n var result = Array(1000).fill(0);\n for(var x = 1; 100 > x; x++) {\n for(var y = 1; 100 > y; y++) {\n for(var z = 1; 100 > z; z++) {\n var n = x**2 + y**2 + z**2 + x*y + x*z + y*z;\n if (n > 1000) break;\n result[n - 1] += 1;\n }\n }\n }\n\n return result.slice(0, N).join('\\n');\n}\n", "language": "JavaScript", "metadata": {"date": 1596084960, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02608.html", "problem_id": "p02608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02608/input.txt", "sample_output_relpath": "derived/input_output/data/p02608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02608/JavaScript/s505032334.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s505032334", "user_id": "u358889974"}, "prompt_components": {"gold_output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n", "input_to_evaluate": "var GET = (function () {function f(s) {return new g(s);}function g(s) {this._s = s.trim().split(\"\\n\");}g.prototype.getValue = function (n) {return this._s[n];};g.prototype.getArray = function (n) {return this.stoa(this._s[n]);};g.prototype.slice = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stox(v));};g.prototype.sliceArray = function (s, limit) {return this._s.slice(s, +limit + s || undefined).map(v => this.stoa(v));};g.prototype.stoa = function (s) {return s.split(\" \").map(v => this.stox(v));};g.prototype.stox = function (v) {var i = +v;return (i === i) ? i : v;};return f;})();\nvar o = GET(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var N = +o.getValue(0);\n\n var result = Array(1000).fill(0);\n for(var x = 1; 100 > x; x++) {\n for(var y = 1; 100 > y; y++) {\n for(var z = 1; 100 > z; z++) {\n var n = x**2 + y**2 + z**2 + x*y + x*z + y*z;\n if (n > 1000) break;\n result[n - 1] += 1;\n }\n }\n }\n\n return result.slice(0, N).join('\\n');\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "sample_input": "20\n"}, "reference_outputs": ["0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"], "source_document_id": "p02608", "source_text": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1123, "cpu_time_ms": 82, "memory_kb": 32328}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s222970649", "group_id": "codeNet:p02608", "input_text": "/*\n-------関数一覧--------\narr1dto2d(Array) 一次元配列を二次元配列にします\npf(N)素因数分解した結果をオブジェクトで返します\ngcd(a,b)最大公約数を返します\nlcm(a,b)最小公倍数を返します\nnum(a,b)a-bを返します。ソート用です\nisPrime(n)素数かどうか真偽値で返します\nisNumber(n)数かどうか真偽値で返します\narrsum(arr)配列の合計値を返します\nnibu(arr,n)n以下で最も大きい数の添字を返します(nを含みます)\nbr(input)入力を改行で区切ります\n*/\nconst debugMode = false;\nconst inf = Number.MAX_SAFE_INTEGER;\nconst mod = 1000000007;\nfunction Main(input){\n var arr = new Array(10010).fill(0);\n for(var i=1;i<=120;i++){\n for(var j=1;j<=120;j++){\n for(var k=1;k<=120;k++){\n var n = i*i+j*j+k*k+i*j+j*k+k*i\n if(n<10010){\n arr[n]++;\n }\n }\n }\n }\n for(var i=1;i val==a[i]);\n sum += factorialize(a.length-1-i)*f;\n arr.splice(f,1);\n }\n return sum;\n}\nfunction arrsum(arr){\n var sum = 0;\n for (var i=0,len=arr.length; iarr[i]){\n\t\t\tmin = arr[i];\n\t\t\tpoint = i;\n\t\t}\n\t}\n\treturn point;\n}\nfunction isPrime(n){\n if(false===Number.isInteger(n)){\n return false;\n }\n if(n<=1){\n return false;\n }\n if(2===n){\n return true;\n }\n if(0===n%2){\n return false;\n }\n var square_root = Math.floor(Math.sqrt(n));\n for(var i=3; i<=square_root; i+=2){\n if(0===n%i){\n return false;\n }\n }\n return true;\n}\nfunction isNumber(val){\n\tconst pat = /^([1-9]\\d*|0)$/;\n\treturn pat.test(val);\n}\nfunction factorialize(num) {\n if (num === 0) { return 1; }\n return num * factorialize(num-1);\n}\nfunction arr1dto2d (arr){\n\tfor(var i=0;i 0)) {\n result[i] = 0;\n }\n result[i]++;\n break;\n }\n i++;\n }\n init = i;\n }\n return result;\n}\nfunction gcd(a, b) {\n if (b === 0){\n return a\n }\n return gcd(b, a % b)\n}\nfunction lcm(a,b) {\n var g = (n, m) => m ? g(m, n % m) : n\n return a * b / g(a, b)\n}\nfunction num(a, b) {\n return a - b;\n}\nfunction nibu(a,searchValue){\n\tvar index = -1;\n\n//調べる左端を表す添字(index)\nvar left = 0;\n\n//調べる右端を表す添字(index)\nvar right = a.length-1;\n\n//左端と右端にデータがある間は処理を繰り返す\nwhile(left <= right){\n\n //左右の真ん中を表す添字(index)\n middle =Math.floor((left +right)/2);\n\n //真ん中の値と探す値を比較する\n if(a[middle]==searchValue){\n //一致した場合、変数に入れて処理終了\n index = middle;\n break;\n }else if(a[middle]arr[i]){\n flag = false;\n break;\n }\n }\n return flag;\n}\nfunction primeFactorization(n) {\n\n\t// 平方根を保存\n\tvar s = Math.floor(Math.sqrt(n));\n\n\tvar r = 0;\n\n\tvar result = {};\n\n\t// 2から平方根までの素因数を求める\n\tfor (var i = 2;i <= s;i++) {\n\n\t\tif ((n % i) == 0) {\n\n\t\t\tr = 0; // 指数カウンタクリア\n\n\t\t\tdo {\n\n\t\t\t\tr++; // 指数カウンタプラス\n\n\t\t\t\tn = n / i;\n\n\t\t\t} while ((n % i) == 0);\n\n\t\t\t// 素因数iを指数とともに保存\n\t\t\tresult[i]=r;\n\n\t\t}\n\n\t}\n\n\t// 残った素数を追加\n\tif (n > s) {\n\t\tresult[n] = 1;\n\t}\n\n\treturn result;\n\n}\n", "language": "JavaScript", "metadata": {"date": 1594516993, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02608.html", "problem_id": "p02608", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02608/input.txt", "sample_output_relpath": "derived/input_output/data/p02608/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02608/JavaScript/s222970649.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s222970649", "user_id": "u938152299"}, "prompt_components": {"gold_output": "0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n", "input_to_evaluate": "/*\n-------関数一覧--------\narr1dto2d(Array) 一次元配列を二次元配列にします\npf(N)素因数分解した結果をオブジェクトで返します\ngcd(a,b)最大公約数を返します\nlcm(a,b)最小公倍数を返します\nnum(a,b)a-bを返します。ソート用です\nisPrime(n)素数かどうか真偽値で返します\nisNumber(n)数かどうか真偽値で返します\narrsum(arr)配列の合計値を返します\nnibu(arr,n)n以下で最も大きい数の添字を返します(nを含みます)\nbr(input)入力を改行で区切ります\n*/\nconst debugMode = false;\nconst inf = Number.MAX_SAFE_INTEGER;\nconst mod = 1000000007;\nfunction Main(input){\n var arr = new Array(10010).fill(0);\n for(var i=1;i<=120;i++){\n for(var j=1;j<=120;j++){\n for(var k=1;k<=120;k++){\n var n = i*i+j*j+k*k+i*j+j*k+k*i\n if(n<10010){\n arr[n]++;\n }\n }\n }\n }\n for(var i=1;i val==a[i]);\n sum += factorialize(a.length-1-i)*f;\n arr.splice(f,1);\n }\n return sum;\n}\nfunction arrsum(arr){\n var sum = 0;\n for (var i=0,len=arr.length; iarr[i]){\n\t\t\tmin = arr[i];\n\t\t\tpoint = i;\n\t\t}\n\t}\n\treturn point;\n}\nfunction isPrime(n){\n if(false===Number.isInteger(n)){\n return false;\n }\n if(n<=1){\n return false;\n }\n if(2===n){\n return true;\n }\n if(0===n%2){\n return false;\n }\n var square_root = Math.floor(Math.sqrt(n));\n for(var i=3; i<=square_root; i+=2){\n if(0===n%i){\n return false;\n }\n }\n return true;\n}\nfunction isNumber(val){\n\tconst pat = /^([1-9]\\d*|0)$/;\n\treturn pat.test(val);\n}\nfunction factorialize(num) {\n if (num === 0) { return 1; }\n return num * factorialize(num-1);\n}\nfunction arr1dto2d (arr){\n\tfor(var i=0;i 0)) {\n result[i] = 0;\n }\n result[i]++;\n break;\n }\n i++;\n }\n init = i;\n }\n return result;\n}\nfunction gcd(a, b) {\n if (b === 0){\n return a\n }\n return gcd(b, a % b)\n}\nfunction lcm(a,b) {\n var g = (n, m) => m ? g(m, n % m) : n\n return a * b / g(a, b)\n}\nfunction num(a, b) {\n return a - b;\n}\nfunction nibu(a,searchValue){\n\tvar index = -1;\n\n//調べる左端を表す添字(index)\nvar left = 0;\n\n//調べる右端を表す添字(index)\nvar right = a.length-1;\n\n//左端と右端にデータがある間は処理を繰り返す\nwhile(left <= right){\n\n //左右の真ん中を表す添字(index)\n middle =Math.floor((left +right)/2);\n\n //真ん中の値と探す値を比較する\n if(a[middle]==searchValue){\n //一致した場合、変数に入れて処理終了\n index = middle;\n break;\n }else if(a[middle]arr[i]){\n flag = false;\n break;\n }\n }\n return flag;\n}\nfunction primeFactorization(n) {\n\n\t// 平方根を保存\n\tvar s = Math.floor(Math.sqrt(n));\n\n\tvar r = 0;\n\n\tvar result = {};\n\n\t// 2から平方根までの素因数を求める\n\tfor (var i = 2;i <= s;i++) {\n\n\t\tif ((n % i) == 0) {\n\n\t\t\tr = 0; // 指数カウンタクリア\n\n\t\t\tdo {\n\n\t\t\t\tr++; // 指数カウンタプラス\n\n\t\t\t\tn = n / i;\n\n\t\t\t} while ((n % i) == 0);\n\n\t\t\t// 素因数iを指数とともに保存\n\t\t\tresult[i]=r;\n\n\t\t}\n\n\t}\n\n\t// 残った素数を追加\n\tif (n > s) {\n\t\tresult[n] = 1;\n\t}\n\n\treturn result;\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "sample_input": "20\n"}, "reference_outputs": ["0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n"], "source_document_id": "p02608", "source_text": "Score : 300 points\n\nProblem Statement\n\nLet f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions:\n\n1 \\leq x,y,z\n\nx^2 + y^2 + z^2 + xy + yz + zx = n\n\nGiven an integer N, find each of f(1),f(2),f(3),\\ldots,f(N).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint N lines. The i-th line should contain the value f(i).\n\nSample Input 1\n\n20\n\nSample Output 1\n\n0\n0\n0\n0\n0\n1\n0\n0\n0\n0\n3\n0\n0\n0\n0\n0\n3\n3\n0\n0\n\nFor n=6, only (1,1,1) satisfies both of the conditions. Thus, f(6) = 1.\n\nFor n=11, three triples, (1,1,2), (1,2,1), and (2,1,1), satisfy both of the conditions. Thus, f(6) = 3.\n\nFor n=17, three triples, (1,2,2), (2,1,2), and (2,2,1), satisfy both of the conditions. Thus, f(17) = 3.\n\nFor n=18, three triples, (1,1,3), (1,3,1), and (3,1,1), satisfy both of the conditions. Thus, f(18) = 3.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5901, "cpu_time_ms": 151, "memory_kb": 37472}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s951308872", "group_id": "codeNet:p02613", "input_text": "const main = (input) => {\n const [n, ...rows] = input.trim().split('\\n')\n const k = ['AC', 'WA', 'TLE', 'RE']\n const ans = {}\n for (let v of k) ans[v] = 0\n\n for (let r of rows) ans[r] += 1\n\n for (let v of k) console.log(`${v} x ${ans[v]}`)\n}\n\nprocess.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1593997698, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02613.html", "problem_id": "p02613", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02613/input.txt", "sample_output_relpath": "derived/input_output/data/p02613/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02613/JavaScript/s951308872.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s951308872", "user_id": "u124735330"}, "prompt_components": {"gold_output": "AC x 3\nWA x 1\nTLE x 2\nRE x 0\n", "input_to_evaluate": "const main = (input) => {\n const [n, ...rows] = input.trim().split('\\n')\n const k = ['AC', 'WA', 'TLE', 'RE']\n const ans = {}\n for (let v of k) ans[v] = 0\n\n for (let r of rows) ans[r] += 1\n\n for (let v of k) console.log(`${v} x ${ans[v]}`)\n}\n\nprocess.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "sample_input": "6\nAC\nTLE\nAC\nAC\nWA\nTLE\n"}, "reference_outputs": ["AC x 3\nWA x 1\nTLE x 2\nRE x 0\n"], "source_document_id": "p02613", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.\n\nThe problem has N test cases.\n\nFor each test case i (1\\leq i \\leq N), you are given a string S_i representing the verdict for that test case. Find the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSee the Output section for the output format.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nS_i is AC, WA, TLE, or RE.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n\\vdots\nS_N\n\nOutput\n\nLet C_0, C_1, C_2, and C_3 be the numbers of test cases for which the verdict is AC, WA, TLE, and RE, respectively. Print the following:\n\nAC x C_0\nWA x C_1\nTLE x C_2\nRE x C_3\n\nSample Input 1\n\n6\nAC\nTLE\nAC\nAC\nWA\nTLE\n\nSample Output 1\n\nAC x 3\nWA x 1\nTLE x 2\nRE x 0\n\nWe have 3, 1, 2, and 0 test case(s) for which the verdict is AC, WA, TLE, and RE, respectively.\n\nSample Input 2\n\n10\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\nAC\n\nSample Output 2\n\nAC x 10\nWA x 0\nTLE x 0\nRE x 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 334, "cpu_time_ms": 85, "memory_kb": 44300}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s443132148", "group_id": "codeNet:p02615", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var A = input[1].split(\" \").map(i => parseInt(i));\n A.sort((a,b) => b-a);\n var ans =0;\n var P = new Array(1).fill(A[0]);\n for(var i = 1;ia-b);\n }\n\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1598021437, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/JavaScript/s443132148.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s443132148", "user_id": "u221230011"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var A = input[1].split(\" \").map(i => parseInt(i));\n A.sort((a,b) => b-a);\n var ans =0;\n var P = new Array(1).fill(A[0]);\n for(var i = 1;ia-b);\n }\n\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 701, "cpu_time_ms": 2207, "memory_kb": 61196}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s525774175", "group_id": "codeNet:p02615", "input_text": "const insert = (circle, person) => {\n let max = 0\n let index = 0\n\n circle.forEach((v, i) => {\n const prev = i - 1 === -1 ? circle.length - 1 : i - 1\n const comfortableness = Math.min(circle[prev], circle[i])\n\n if (comfortableness > max ) {\n max = comfortableness\n index = i\n }\n })\n\n circle.splice(index, 0, person)\n\n return max\n}\n\nconst main = async () => {\n const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim()\n const [hString, aStrings] = input.split('\\n')\n const h = Number(hString)\n const as = aStrings.split(' ').map(Number)\n\n as.sort((a, b) => b - a)\n const circle = []\n \n const comfortableness = as.reduce((a, person) => a + insert(circle, person), 0)\n \n console.log(comfortableness)\n}\n\nmain()", "language": "JavaScript", "metadata": {"date": 1596297090, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/JavaScript/s525774175.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s525774175", "user_id": "u209012153"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "const insert = (circle, person) => {\n let max = 0\n let index = 0\n\n circle.forEach((v, i) => {\n const prev = i - 1 === -1 ? circle.length - 1 : i - 1\n const comfortableness = Math.min(circle[prev], circle[i])\n\n if (comfortableness > max ) {\n max = comfortableness\n index = i\n }\n })\n\n circle.splice(index, 0, person)\n\n return max\n}\n\nconst main = async () => {\n const input = require('fs').readFileSync('/dev/stdin', 'UTF-8').trim()\n const [hString, aStrings] = input.split('\\n')\n const h = Number(hString)\n const as = aStrings.split(' ').map(Number)\n\n as.sort((a, b) => b - a)\n const circle = []\n \n const comfortableness = as.reduce((a, person) => a + insert(circle, person), 0)\n \n console.log(comfortableness)\n}\n\nmain()", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 756, "cpu_time_ms": 2208, "memory_kb": 54528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s209590730", "group_id": "codeNet:p02615", "input_text": "/**\n * FastPriorityQueue.js : a fast heap-based priority queue in JavaScript.\n * (c) the authors\n * Licensed under the Apache License, Version 2.0.\n *\n * Speed-optimized heap-based priority queue for modern browsers and JavaScript engines.\n *\n * Usage :\n Installation (in shell, if you use node):\n $ npm install fastpriorityqueue\n Running test program (in JavaScript):\n // var FastPriorityQueue = require(\"fastpriorityqueue\");// in node\n var x = new FastPriorityQueue();\n x.add(1);\n x.add(0);\n x.add(5);\n x.add(4);\n x.add(3);\n x.peek(); // should return 0, leaves x unchanged\n x.size; // should return 5, leaves x unchanged\n while(!x.isEmpty()) {\n console.log(x.poll());\n } // will print 0 1 3 4 5\n x.trim(); // (optional) optimizes memory usage\n */\n'use strict';\n\nvar defaultcomparator = function(a, b) {\n return a < b;\n};\n\n// the provided comparator function should take a, b and return *true* when a < b\nfunction FastPriorityQueue(comparator) {\n if (!(this instanceof FastPriorityQueue)) return new FastPriorityQueue(comparator);\n this.array = [];\n this.size = 0;\n this.compare = comparator || defaultcomparator;\n}\n\n// copy the priority queue into another, and return it. Queue items are shallow-copied.\n// Runs in `O(n)` time.\nFastPriorityQueue.prototype.clone = function() {\n var fpq = new FastPriorityQueue(this.compare);\n fpq.size = this.size;\n for (var i = 0; i < this.size; i++) {\n fpq.array.push(this.array[i]);\n }\n return fpq;\n};\n\n// Add an element into the queue\n// runs in O(log n) time\nFastPriorityQueue.prototype.add = function(myval) {\n var i = this.size;\n this.array[this.size] = myval;\n this.size += 1;\n var p;\n var ap;\n while (i > 0) {\n p = (i - 1) >> 1;\n ap = this.array[p];\n if (!this.compare(myval, ap)) {\n break;\n }\n this.array[i] = ap;\n i = p;\n }\n this.array[i] = myval;\n};\n\n// replace the content of the heap by provided array and \"heapify it\"\nFastPriorityQueue.prototype.heapify = function(arr) {\n this.array = arr;\n this.size = arr.length;\n var i;\n for (i = this.size >> 1; i >= 0; i--) {\n this._percolateDown(i);\n }\n};\n\n// for internal use\nFastPriorityQueue.prototype._percolateUp = function(i, force) {\n var myval = this.array[i];\n var p;\n var ap;\n while (i > 0) {\n p = (i - 1) >> 1;\n ap = this.array[p];\n // force will skip the compare\n if (!force && !this.compare(myval, ap)) {\n break;\n }\n this.array[i] = ap;\n i = p;\n }\n this.array[i] = myval;\n};\n\n// for internal use\nFastPriorityQueue.prototype._percolateDown = function(i) {\n var size = this.size;\n var hsize = this.size >>> 1;\n var ai = this.array[i];\n var l;\n var r;\n var bestc;\n while (i < hsize) {\n l = (i << 1) + 1;\n r = l + 1;\n bestc = this.array[l];\n if (r < size) {\n if (this.compare(this.array[r], bestc)) {\n l = r;\n bestc = this.array[r];\n }\n }\n if (!this.compare(bestc, ai)) {\n break;\n }\n this.array[i] = bestc;\n i = l;\n }\n this.array[i] = ai;\n};\n\n// internal\n// _removeAt(index) will remove the item at the given index from the queue,\n// retaining balance. returns the removed item, or undefined if nothing is removed.\nFastPriorityQueue.prototype._removeAt = function(index) {\n if (index > this.size - 1 || index < 0) return undefined;\n\n // impl1:\n //this.array.splice(index, 1);\n //this.heapify(this.array);\n // impl2:\n this._percolateUp(index, true);\n return this.poll();\n};\n\n// remove(myval) will remove an item matching the provided value from the\n// queue, checked for equality by using the queue's comparator.\n// return true if removed, false otherwise.\nFastPriorityQueue.prototype.remove = function(myval) {\n for (var i = 0; i < this.size; i++) {\n if (!this.compare(this.array[i], myval) && !this.compare(myval, this.array[i])) {\n // items match, comparator returns false both ways, remove item\n this._removeAt(i);\n return true;\n }\n }\n return false;\n};\n\n// internal\n// removes and returns items for which the callback returns true.\nFastPriorityQueue.prototype._batchRemove = function(callback, limit) {\n // initialize return array with max size of the limit or current queue size\n var retArr = new Array(limit ? limit : this.size);\n var count = 0;\n\n if (typeof callback === 'function' && this.size) {\n var i = 0;\n while (i < this.size && count < retArr.length) {\n if (callback(this.array[i])) {\n retArr[count] = this._removeAt(i);\n count++;\n // move up a level in the heap if we remove an item\n i = i >> 1;\n } else {\n i++;\n }\n } \n }\n retArr.length = count;\n return retArr;\n}\n\n// removeOne(callback) will execute the callback function for each item of the queue\n// and will remove the first item for which the callback will return true.\n// return the removed item, or undefined if nothing is removed.\nFastPriorityQueue.prototype.removeOne = function(callback) {\n var arr = this._batchRemove(callback, 1);\n return arr.length > 0 ? arr[0] : undefined;\n};\n\n// remove(callback[, limit]) will execute the callback function for each item of\n// the queue and will remove each item for which the callback returns true, up to\n// a max limit of removed items if specified or no limit if unspecified.\n// return an array containing the removed items.\nFastPriorityQueue.prototype.removeMany = function(callback, limit) {\n return this._batchRemove(callback, limit);\n};\n\n// Look at the top of the queue (one of the smallest elements) without removing it\n// executes in constant time\n//\n// Calling peek on an empty priority queue returns\n// the \"undefined\" value.\n// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/undefined\n//\nFastPriorityQueue.prototype.peek = function() {\n if (this.size == 0) return undefined;\n return this.array[0];\n};\n\n// remove the element on top of the heap (one of the smallest elements)\n// runs in logarithmic time\n//\n// If the priority queue is empty, the function returns the\n// \"undefined\" value.\n// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/undefined\n//\n// For long-running and large priority queues, or priority queues\n// storing large objects, you may want to call the trim function\n// at strategic times to recover allocated memory.\nFastPriorityQueue.prototype.poll = function() {\n if (this.size == 0) return undefined;\n var ans = this.array[0];\n if (this.size > 1) {\n this.array[0] = this.array[--this.size];\n this._percolateDown(0);\n } else {\n this.size -= 1;\n }\n return ans;\n};\n\n// This function adds the provided value to the heap, while removing\n// and returning one of the smallest elements (like poll). The size of the queue\n// thus remains unchanged.\nFastPriorityQueue.prototype.replaceTop = function(myval) {\n if (this.size == 0) return undefined;\n var ans = this.array[0];\n this.array[0] = myval;\n this._percolateDown(0);\n return ans;\n};\n\n// recover unused memory (for long-running priority queues)\nFastPriorityQueue.prototype.trim = function() {\n this.array = this.array.slice(0, this.size);\n};\n\n// Check whether the heap is empty\nFastPriorityQueue.prototype.isEmpty = function() {\n return this.size === 0;\n};\n\n// iterate over the items in order, pass a callback that receives (item, index) as args.\n// TODO once we transpile, uncomment\n// if (Symbol && Symbol.iterator) {\n// FastPriorityQueue.prototype[Symbol.iterator] = function*() {\n// if (this.isEmpty()) return;\n// var fpq = this.clone();\n// while (!fpq.isEmpty()) {\n// yield fpq.poll();\n// }\n// };\n// }\nFastPriorityQueue.prototype.forEach = function(callback) {\n if (this.isEmpty() || typeof callback != 'function') return;\n var i = 0;\n var fpq = this.clone();\n while (!fpq.isEmpty()) {\n callback(fpq.poll(), i++);\n }\n};\n\n// return the k 'smallest' elements of the queue\n// runs in O(k log k) time\n// this is the equivalent of repeatedly calling poll, but\n// it has a better computational complexity, which can be\n// important for large data sets.\nFastPriorityQueue.prototype.kSmallest = function(k) {\n if (this.size == 0) return [];\n var comparator = this.compare;\n var arr = this.array\n var fpq = new FastPriorityQueue(function(a,b){\n return comparator(arr[a],arr[b]);\n });\n k = Math.min(this.size, k);\n var smallest = new Array(k);\n var j = 0;\n fpq.add(0);\n while (j < k) {\n var small = fpq.poll();\n smallest[j++] = this.array[small];\n var l = (small << 1) + 1;\n var r = l + 1;\n if (l < this.size) fpq.add(l);\n if (r < this.size) fpq.add(r);\n }\n return smallest;\n}\n\n\nfunction maxIndex(ai) {\n let max = -1\n let ind = -1\n for(let i = 0; i < ai.length; i++) {\n if (max < ai[i]) {\n ind = i\n max = ai[i]\n }\n }\n return ind\n}\n\nfunction main(input) {\n const inputs =input.split('\\n')\n const [N] = inputs[0].split(' ').map(Number)\n const Ai = inputs[1].split(' ').map(Number)\n\n const sortedAi = Ai.sort().reverse()\n // console.log(sortedAi)\n\n let number = sortedAi.shift()\n let currentAi = new FastPriorityQueue(function (a, b) {\n return a > b\n })\n currentAi.add(number)\n let countAi = number\n for(let i = 1; i < N ; i++) {\n const number = sortedAi.shift()\n const v = currentAi.poll()\n console.log('number:', number, 'v:', v)\n countAi += v\n currentAi.add(number)\n currentAi.add(number)\n console.log(currentAi)\n }\n console.log(countAi)\n}\n\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim())\n", "language": "JavaScript", "metadata": {"date": 1594003856, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/JavaScript/s209590730.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s209590730", "user_id": "u131856103"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "/**\n * FastPriorityQueue.js : a fast heap-based priority queue in JavaScript.\n * (c) the authors\n * Licensed under the Apache License, Version 2.0.\n *\n * Speed-optimized heap-based priority queue for modern browsers and JavaScript engines.\n *\n * Usage :\n Installation (in shell, if you use node):\n $ npm install fastpriorityqueue\n Running test program (in JavaScript):\n // var FastPriorityQueue = require(\"fastpriorityqueue\");// in node\n var x = new FastPriorityQueue();\n x.add(1);\n x.add(0);\n x.add(5);\n x.add(4);\n x.add(3);\n x.peek(); // should return 0, leaves x unchanged\n x.size; // should return 5, leaves x unchanged\n while(!x.isEmpty()) {\n console.log(x.poll());\n } // will print 0 1 3 4 5\n x.trim(); // (optional) optimizes memory usage\n */\n'use strict';\n\nvar defaultcomparator = function(a, b) {\n return a < b;\n};\n\n// the provided comparator function should take a, b and return *true* when a < b\nfunction FastPriorityQueue(comparator) {\n if (!(this instanceof FastPriorityQueue)) return new FastPriorityQueue(comparator);\n this.array = [];\n this.size = 0;\n this.compare = comparator || defaultcomparator;\n}\n\n// copy the priority queue into another, and return it. Queue items are shallow-copied.\n// Runs in `O(n)` time.\nFastPriorityQueue.prototype.clone = function() {\n var fpq = new FastPriorityQueue(this.compare);\n fpq.size = this.size;\n for (var i = 0; i < this.size; i++) {\n fpq.array.push(this.array[i]);\n }\n return fpq;\n};\n\n// Add an element into the queue\n// runs in O(log n) time\nFastPriorityQueue.prototype.add = function(myval) {\n var i = this.size;\n this.array[this.size] = myval;\n this.size += 1;\n var p;\n var ap;\n while (i > 0) {\n p = (i - 1) >> 1;\n ap = this.array[p];\n if (!this.compare(myval, ap)) {\n break;\n }\n this.array[i] = ap;\n i = p;\n }\n this.array[i] = myval;\n};\n\n// replace the content of the heap by provided array and \"heapify it\"\nFastPriorityQueue.prototype.heapify = function(arr) {\n this.array = arr;\n this.size = arr.length;\n var i;\n for (i = this.size >> 1; i >= 0; i--) {\n this._percolateDown(i);\n }\n};\n\n// for internal use\nFastPriorityQueue.prototype._percolateUp = function(i, force) {\n var myval = this.array[i];\n var p;\n var ap;\n while (i > 0) {\n p = (i - 1) >> 1;\n ap = this.array[p];\n // force will skip the compare\n if (!force && !this.compare(myval, ap)) {\n break;\n }\n this.array[i] = ap;\n i = p;\n }\n this.array[i] = myval;\n};\n\n// for internal use\nFastPriorityQueue.prototype._percolateDown = function(i) {\n var size = this.size;\n var hsize = this.size >>> 1;\n var ai = this.array[i];\n var l;\n var r;\n var bestc;\n while (i < hsize) {\n l = (i << 1) + 1;\n r = l + 1;\n bestc = this.array[l];\n if (r < size) {\n if (this.compare(this.array[r], bestc)) {\n l = r;\n bestc = this.array[r];\n }\n }\n if (!this.compare(bestc, ai)) {\n break;\n }\n this.array[i] = bestc;\n i = l;\n }\n this.array[i] = ai;\n};\n\n// internal\n// _removeAt(index) will remove the item at the given index from the queue,\n// retaining balance. returns the removed item, or undefined if nothing is removed.\nFastPriorityQueue.prototype._removeAt = function(index) {\n if (index > this.size - 1 || index < 0) return undefined;\n\n // impl1:\n //this.array.splice(index, 1);\n //this.heapify(this.array);\n // impl2:\n this._percolateUp(index, true);\n return this.poll();\n};\n\n// remove(myval) will remove an item matching the provided value from the\n// queue, checked for equality by using the queue's comparator.\n// return true if removed, false otherwise.\nFastPriorityQueue.prototype.remove = function(myval) {\n for (var i = 0; i < this.size; i++) {\n if (!this.compare(this.array[i], myval) && !this.compare(myval, this.array[i])) {\n // items match, comparator returns false both ways, remove item\n this._removeAt(i);\n return true;\n }\n }\n return false;\n};\n\n// internal\n// removes and returns items for which the callback returns true.\nFastPriorityQueue.prototype._batchRemove = function(callback, limit) {\n // initialize return array with max size of the limit or current queue size\n var retArr = new Array(limit ? limit : this.size);\n var count = 0;\n\n if (typeof callback === 'function' && this.size) {\n var i = 0;\n while (i < this.size && count < retArr.length) {\n if (callback(this.array[i])) {\n retArr[count] = this._removeAt(i);\n count++;\n // move up a level in the heap if we remove an item\n i = i >> 1;\n } else {\n i++;\n }\n } \n }\n retArr.length = count;\n return retArr;\n}\n\n// removeOne(callback) will execute the callback function for each item of the queue\n// and will remove the first item for which the callback will return true.\n// return the removed item, or undefined if nothing is removed.\nFastPriorityQueue.prototype.removeOne = function(callback) {\n var arr = this._batchRemove(callback, 1);\n return arr.length > 0 ? arr[0] : undefined;\n};\n\n// remove(callback[, limit]) will execute the callback function for each item of\n// the queue and will remove each item for which the callback returns true, up to\n// a max limit of removed items if specified or no limit if unspecified.\n// return an array containing the removed items.\nFastPriorityQueue.prototype.removeMany = function(callback, limit) {\n return this._batchRemove(callback, limit);\n};\n\n// Look at the top of the queue (one of the smallest elements) without removing it\n// executes in constant time\n//\n// Calling peek on an empty priority queue returns\n// the \"undefined\" value.\n// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/undefined\n//\nFastPriorityQueue.prototype.peek = function() {\n if (this.size == 0) return undefined;\n return this.array[0];\n};\n\n// remove the element on top of the heap (one of the smallest elements)\n// runs in logarithmic time\n//\n// If the priority queue is empty, the function returns the\n// \"undefined\" value.\n// https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/undefined\n//\n// For long-running and large priority queues, or priority queues\n// storing large objects, you may want to call the trim function\n// at strategic times to recover allocated memory.\nFastPriorityQueue.prototype.poll = function() {\n if (this.size == 0) return undefined;\n var ans = this.array[0];\n if (this.size > 1) {\n this.array[0] = this.array[--this.size];\n this._percolateDown(0);\n } else {\n this.size -= 1;\n }\n return ans;\n};\n\n// This function adds the provided value to the heap, while removing\n// and returning one of the smallest elements (like poll). The size of the queue\n// thus remains unchanged.\nFastPriorityQueue.prototype.replaceTop = function(myval) {\n if (this.size == 0) return undefined;\n var ans = this.array[0];\n this.array[0] = myval;\n this._percolateDown(0);\n return ans;\n};\n\n// recover unused memory (for long-running priority queues)\nFastPriorityQueue.prototype.trim = function() {\n this.array = this.array.slice(0, this.size);\n};\n\n// Check whether the heap is empty\nFastPriorityQueue.prototype.isEmpty = function() {\n return this.size === 0;\n};\n\n// iterate over the items in order, pass a callback that receives (item, index) as args.\n// TODO once we transpile, uncomment\n// if (Symbol && Symbol.iterator) {\n// FastPriorityQueue.prototype[Symbol.iterator] = function*() {\n// if (this.isEmpty()) return;\n// var fpq = this.clone();\n// while (!fpq.isEmpty()) {\n// yield fpq.poll();\n// }\n// };\n// }\nFastPriorityQueue.prototype.forEach = function(callback) {\n if (this.isEmpty() || typeof callback != 'function') return;\n var i = 0;\n var fpq = this.clone();\n while (!fpq.isEmpty()) {\n callback(fpq.poll(), i++);\n }\n};\n\n// return the k 'smallest' elements of the queue\n// runs in O(k log k) time\n// this is the equivalent of repeatedly calling poll, but\n// it has a better computational complexity, which can be\n// important for large data sets.\nFastPriorityQueue.prototype.kSmallest = function(k) {\n if (this.size == 0) return [];\n var comparator = this.compare;\n var arr = this.array\n var fpq = new FastPriorityQueue(function(a,b){\n return comparator(arr[a],arr[b]);\n });\n k = Math.min(this.size, k);\n var smallest = new Array(k);\n var j = 0;\n fpq.add(0);\n while (j < k) {\n var small = fpq.poll();\n smallest[j++] = this.array[small];\n var l = (small << 1) + 1;\n var r = l + 1;\n if (l < this.size) fpq.add(l);\n if (r < this.size) fpq.add(r);\n }\n return smallest;\n}\n\n\nfunction maxIndex(ai) {\n let max = -1\n let ind = -1\n for(let i = 0; i < ai.length; i++) {\n if (max < ai[i]) {\n ind = i\n max = ai[i]\n }\n }\n return ind\n}\n\nfunction main(input) {\n const inputs =input.split('\\n')\n const [N] = inputs[0].split(' ').map(Number)\n const Ai = inputs[1].split(' ').map(Number)\n\n const sortedAi = Ai.sort().reverse()\n // console.log(sortedAi)\n\n let number = sortedAi.shift()\n let currentAi = new FastPriorityQueue(function (a, b) {\n return a > b\n })\n currentAi.add(number)\n let countAi = number\n for(let i = 1; i < N ; i++) {\n const number = sortedAi.shift()\n const v = currentAi.poll()\n console.log('number:', number, 'v:', v)\n countAi += v\n currentAi.add(number)\n currentAi.add(number)\n console.log(currentAi)\n }\n console.log(countAi)\n}\n\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim())\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9578, "cpu_time_ms": 2811, "memory_kb": 98788}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s568245041", "group_id": "codeNet:p02615", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n const A = arg[1].split(\" \").map(n=>parseInt(n)).sort((a,b)=>b-a);\n \n let answer = 0;\n \n answer += A[0];\n let cnt = 1;\n \n for(let i=1; i= N - 1) break;\n \n answer += A[i];\n cnt++;\n if(cnt >= N - 1) break;\n \n // console.log(\"cnt:\" + cnt);\n // console.log(\"A[i]:\" + A[i]);\n // console.log(\"answer:\" + answer);\n // console.log(\"----\")\n }\n \n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1594002886, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/JavaScript/s568245041.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s568245041", "user_id": "u598795006"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n const A = arg[1].split(\" \").map(n=>parseInt(n)).sort((a,b)=>b-a);\n \n let answer = 0;\n \n answer += A[0];\n let cnt = 1;\n \n for(let i=1; i= N - 1) break;\n \n answer += A[i];\n cnt++;\n if(cnt >= N - 1) break;\n \n // console.log(\"cnt:\" + cnt);\n // console.log(\"A[i]:\" + A[i]);\n // console.log(\"answer:\" + answer);\n // console.log(\"----\")\n }\n \n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 698, "cpu_time_ms": 175, "memory_kb": 53180}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s221412993", "group_id": "codeNet:p02615", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n const A = arg[1].split(\" \").map(n=>parseInt(n)).sort((a,b)=>b-a);\n \n console.log(A.reduce((m,n)=>m+n) - A[A.length-1] - A[A.length-2] + A[1]);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1594002211, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02615.html", "problem_id": "p02615", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02615/input.txt", "sample_output_relpath": "derived/input_output/data/p02615/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02615/JavaScript/s221412993.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s221412993", "user_id": "u598795006"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n const A = arg[1].split(\" \").map(n=>parseInt(n)).sort((a,b)=>b-a);\n \n console.log(A.reduce((m,n)=>m+n) - A[A.length-1] - A[A.length-2] + A[1]);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "sample_input": "4\n2 2 1 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02615", "source_text": "Score: 400 points\n\nProblem Statement\n\nQuickly after finishing the tutorial of the online game ATChat, you have decided to visit a particular place with N-1 players who happen to be there. These N players, including you, are numbered 1 through N, and the friendliness of Player i is A_i.\n\nThe N players will arrive at the place one by one in some order. To make sure nobody gets lost, you have set the following rule: players who have already arrived there should form a circle, and a player who has just arrived there should cut into the circle somewhere.\n\nWhen each player, except the first one to arrive, arrives at the place, the player gets comfort equal to the smaller of the friendliness of the clockwise adjacent player and that of the counter-clockwise adjacent player. The first player to arrive there gets the comfort of 0.\n\nWhat is the maximum total comfort the N players can get by optimally choosing the order of arrivals and the positions in the circle to cut into?\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nPrint the maximum total comfort the N players can get.\n\nSample Input 1\n\n4\n2 2 1 3\n\nSample Output 1\n\n7\n\nBy arriving at the place in the order Player 4, 2, 1, 3, and cutting into the circle as shown in the figure, they can get the total comfort of 7.\n\nThey cannot get the total comfort greater than 7, so the answer is 7.\n\nSample Input 2\n\n7\n1 1 1 1 1 1 1\n\nSample Output 2\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 331, "cpu_time_ms": 184, "memory_kb": 53584}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s014672526", "group_id": "codeNet:p02616", "input_text": "function Main(input) {\n var C = 1e+9 + 7;\n var C2 = 1e+5;\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n var N = parseInt(input[0][0], 10);\n var K = parseInt(input[0][1], 10);\n var vec_A = input[1].map(e => parseInt(e, 10));\n vec_A.sort((a, b) => Math.abs(b) - Math.abs(a));\n\n var ans = calc(vec_A, N, K, C, C2);\n console.log(mod(ans, C));\n\n}\n\nfunction calc(vec_A, N, K, C, C2){\n var ans = 1;\n var minusCount = 0;\n var minPlus;\n var minMinus;\n for (var i = 0; i < K; i++){\n ans = kakeruR(ans, vec_A[i], C, C2);\n if (ans === 0) return 0\n if (vec_A[i] > 0) minPlus = i;\n if (vec_A[i] < 0) {\n minMinus = i;\n minusCount ++;\n }\n }\n if (K === N) return ans;\n if (minusCount % 2 === 0) return ans;\n\n if (minusCount < K) {\n // console.log(\"here\", minMinus, minPlus);\n var tmp01 = [0, -1];\n var tmp02 = [0, -1];\n for (var i = K; i < N; i++){\n if (vec_A[i] < 0){\n tmp01 = [vec_A[i], vec_A[minPlus], i];\n break;\n }\n }\n for (var i = K; i < N; i++){\n if (vec_A[i] > 0){\n tmp02 = [vec_A[i], vec_A[minMinus], i];\n break;\n }\n }\n if (tmp01[0] * tmp02[1] >= tmp02[0] * tmp01[1]){\n \n vec_A.splice(K, tmp01[2] - K);\n vec_A.splice(minPlus, 1);\n } else {\n vec_A.splice(K, tmp02[2] - K);\n vec_A.splice(minMinus, 1);\n }\n // console.log(vec_A);\n \n ans = 1;\n for (var i = 0; i < K; i++){\n ans = kakeruR(ans, vec_A[i], C, C2);\n if (ans === 0) return 0\n }\n return ans;\n } else {\n // console.log(\"there\");\n for (var i = K; i < N; i++){\n if (vec_A[i] >= 0){\n vec_A.splice(K, i - K);\n vec_A.splice(minMinus, 1);\n ans = 1;\n for (var i = 0; i < K; i++){\n ans = kakeruR(ans, vec_A[i], C, C2);\n if (ans === 0) return 0\n } \n return ans;\n }\n }\n // console.log(\"reached?\");\n ans = 1;\n for (var i = N - 1; i >= (N - K); i--){\n ans = kakeruR(ans, vec_A[i], C, C2);\n }\n return ans;\n }\n}\n\nfunction kakeruR(a, b, C, C2){\n\tvar tmpQ, tmpR, ans;\n \ttmpQ = (b / C2 | 0);\n tmpR = b - (tmpQ * C2);\n ans = (a * tmpQ % C) * C2 % C + (a * tmpR);\n \tans %= C;\n return ans;\n}\n\nfunction mod(i, j) {\n return (i % j) < 0 ? (i % j) + 0 + (j < 0 ? -j : j) : (i % j + 0);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")); ", "language": "JavaScript", "metadata": {"date": 1594031842, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02616.html", "problem_id": "p02616", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02616/input.txt", "sample_output_relpath": "derived/input_output/data/p02616/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02616/JavaScript/s014672526.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s014672526", "user_id": "u624950076"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "function Main(input) {\n var C = 1e+9 + 7;\n var C2 = 1e+5;\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n var N = parseInt(input[0][0], 10);\n var K = parseInt(input[0][1], 10);\n var vec_A = input[1].map(e => parseInt(e, 10));\n vec_A.sort((a, b) => Math.abs(b) - Math.abs(a));\n\n var ans = calc(vec_A, N, K, C, C2);\n console.log(mod(ans, C));\n\n}\n\nfunction calc(vec_A, N, K, C, C2){\n var ans = 1;\n var minusCount = 0;\n var minPlus;\n var minMinus;\n for (var i = 0; i < K; i++){\n ans = kakeruR(ans, vec_A[i], C, C2);\n if (ans === 0) return 0\n if (vec_A[i] > 0) minPlus = i;\n if (vec_A[i] < 0) {\n minMinus = i;\n minusCount ++;\n }\n }\n if (K === N) return ans;\n if (minusCount % 2 === 0) return ans;\n\n if (minusCount < K) {\n // console.log(\"here\", minMinus, minPlus);\n var tmp01 = [0, -1];\n var tmp02 = [0, -1];\n for (var i = K; i < N; i++){\n if (vec_A[i] < 0){\n tmp01 = [vec_A[i], vec_A[minPlus], i];\n break;\n }\n }\n for (var i = K; i < N; i++){\n if (vec_A[i] > 0){\n tmp02 = [vec_A[i], vec_A[minMinus], i];\n break;\n }\n }\n if (tmp01[0] * tmp02[1] >= tmp02[0] * tmp01[1]){\n \n vec_A.splice(K, tmp01[2] - K);\n vec_A.splice(minPlus, 1);\n } else {\n vec_A.splice(K, tmp02[2] - K);\n vec_A.splice(minMinus, 1);\n }\n // console.log(vec_A);\n \n ans = 1;\n for (var i = 0; i < K; i++){\n ans = kakeruR(ans, vec_A[i], C, C2);\n if (ans === 0) return 0\n }\n return ans;\n } else {\n // console.log(\"there\");\n for (var i = K; i < N; i++){\n if (vec_A[i] >= 0){\n vec_A.splice(K, i - K);\n vec_A.splice(minMinus, 1);\n ans = 1;\n for (var i = 0; i < K; i++){\n ans = kakeruR(ans, vec_A[i], C, C2);\n if (ans === 0) return 0\n } \n return ans;\n }\n }\n // console.log(\"reached?\");\n ans = 1;\n for (var i = N - 1; i >= (N - K); i--){\n ans = kakeruR(ans, vec_A[i], C, C2);\n }\n return ans;\n }\n}\n\nfunction kakeruR(a, b, C, C2){\n\tvar tmpQ, tmpR, ans;\n \ttmpQ = (b / C2 | 0);\n tmpR = b - (tmpQ * C2);\n ans = (a * tmpQ % C) * C2 % C + (a * tmpR);\n \tans %= C;\n return ans;\n}\n\nfunction mod(i, j) {\n return (i % j) < 0 ? (i % j) + 0 + (j < 0 ? -j : j) : (i % j + 0);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")); ", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "sample_input": "4 2\n1 2 -3 -4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02616", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2741, "cpu_time_ms": 296, "memory_kb": 53252}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s929777273", "group_id": "codeNet:p02616", "input_text": "console.log((args=>{\n const [[N,K],A] = args.trim().split('\\n').map( r=>r.split(' ').map(v=>v|0) );\n let Am = [], Ap = [];\n for ( let i = 0; i < N; i++ ) {\n if ( A[i] > 0 ) Ap.push(A[i]);\n if ( A[i] < 0 ) Am.push(A[i]);\n }\n const MOD = BigInt(1e9+7), mul = (a,b) => (BigInt(a)*BigInt(b)%MOD+MOD)%MOD;\n Am.sort((a,b)=>a-b);\n Ap.sort((a,b)=>b-a);\n if ( Ap.length === 0 && K&1 ) return `${ Am.slice(-K).reduce(mul,1) }`;\n let om = 0, op = 0, ap = [], am = [];\n for ( let i = 0; i < K; i++ ) {\n if ( (Ap[op]|0) > -(Am[om]|0) ) {\n ap.push(Ap[op]); op++;\n } else {\n am.push(Am[om]); om++;\n }\n }\n if ( am.length&1 ) {\n if ( (Ap[op]|0) > -(Am[om]|0) ) {\n ap.push(Ap[op]); am.pop();\n } else {\n am.push(Am[om]); ap.pop();\n }\n }\n return `${mul(ap.reduce(mul,1),am.reduce(mul,1))}`;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));\n", "language": "JavaScript", "metadata": {"date": 1594015449, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02616.html", "problem_id": "p02616", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02616/input.txt", "sample_output_relpath": "derived/input_output/data/p02616/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02616/JavaScript/s929777273.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s929777273", "user_id": "u088845406"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "console.log((args=>{\n const [[N,K],A] = args.trim().split('\\n').map( r=>r.split(' ').map(v=>v|0) );\n let Am = [], Ap = [];\n for ( let i = 0; i < N; i++ ) {\n if ( A[i] > 0 ) Ap.push(A[i]);\n if ( A[i] < 0 ) Am.push(A[i]);\n }\n const MOD = BigInt(1e9+7), mul = (a,b) => (BigInt(a)*BigInt(b)%MOD+MOD)%MOD;\n Am.sort((a,b)=>a-b);\n Ap.sort((a,b)=>b-a);\n if ( Ap.length === 0 && K&1 ) return `${ Am.slice(-K).reduce(mul,1) }`;\n let om = 0, op = 0, ap = [], am = [];\n for ( let i = 0; i < K; i++ ) {\n if ( (Ap[op]|0) > -(Am[om]|0) ) {\n ap.push(Ap[op]); op++;\n } else {\n am.push(Am[om]); om++;\n }\n }\n if ( am.length&1 ) {\n if ( (Ap[op]|0) > -(Am[om]|0) ) {\n ap.push(Ap[op]); am.pop();\n } else {\n am.push(Am[om]); ap.pop();\n }\n }\n return `${mul(ap.reduce(mul,1),am.reduce(mul,1))}`;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "sample_input": "4 2\n1 2 -3 -4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p02616", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N integers A_1,\\ldots,A_N.\n\nWe will choose exactly K of these elements. Find the maximum possible product of the chosen elements.\n\nThen, print the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nConstraints\n\n1 \\leq K \\leq N \\leq 2\\times 10^5\n\n|A_i| \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 \\ldots A_N\n\nOutput\n\nPrint the maximum product modulo (10^9+7), using an integer between 0 and 10^9+6 (inclusive).\n\nSample Input 1\n\n4 2\n1 2 -3 -4\n\nSample Output 1\n\n12\n\nThe possible products of the two chosen elements are 2, -3, -4, -6, -8, and 12, so the maximum product is 12.\n\nSample Input 2\n\n4 3\n-1 -2 -3 -4\n\nSample Output 2\n\n1000000001\n\nThe possible products of the three chosen elements are -24, -12, -8, and -6, so the maximum product is -6.\n\nWe print this value modulo (10^9+7), that is, 1000000001.\n\nSample Input 3\n\n2 1\n-1 1000000000\n\nSample Output 3\n\n1000000000\n\nThe possible products of the one chosen element are -1 and 1000000000, so the maximum product is 1000000000.\n\nSample Input 4\n\n10 10\n1000000000 100000000 10000000 1000000 100000 10000 1000 100 10 1\n\nSample Output 4\n\n999983200\n\nBe sure to print the product modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 884, "cpu_time_ms": 237, "memory_kb": 72932}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s112907850", "group_id": "codeNet:p02617", "input_text": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(){return +cin[cid++];}\nfunction nextstr(){return cin[cid++];}\nfunction nextbig(){return BigInt(cin[cid++]);}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n \nvar myOut = main();\nif(myOut !== undefined)console.log(String(myOut));\n \nfunction main(){\n var n = next();\n var ans = n * (n+1) * (n+2) / 6;\n for(var i = 1; i < n; i++){\n var u = next(), v = next();\n if(u > v){var temp = u; u = v; v = temp;}\n ans -= u * (n-v+1);\n }\n return ans;\n}", "language": "JavaScript", "metadata": {"date": 1594713764, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02617.html", "problem_id": "p02617", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02617/input.txt", "sample_output_relpath": "derived/input_output/data/p02617/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02617/JavaScript/s112907850.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s112907850", "user_id": "u944958519"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(){return +cin[cid++];}\nfunction nextstr(){return cin[cid++];}\nfunction nextbig(){return BigInt(cin[cid++]);}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n \nvar myOut = main();\nif(myOut !== undefined)console.log(String(myOut));\n \nfunction main(){\n var n = next();\n var ans = n * (n+1) * (n+2) / 6;\n for(var i = 1; i < n; i++){\n var u = next(), v = next();\n if(u > v){var temp = u; u = v; v = temp;}\n ans -= u * (n-v+1);\n }\n return ans;\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\\cdots, N and 1, 2, \\cdots, N-1. Edge i connects Vertex u_i and v_i.\n\nFor integers L, R (1 \\leq L \\leq R \\leq N), let us define a function f(L, R) as follows:\n\nLet S be the set of the vertices numbered L through R. f(L, R) represents the number of connected components in the subgraph formed only from the vertex set S and the edges whose endpoints both belong to S.\n\nCompute \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq u_i, v_i \\leq N\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1\nu_2 v_2\n:\nu_{N-1} v_{N-1}\n\nOutput\n\nPrint \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nSample Input 1\n\n3\n1 3\n2 3\n\nSample Output 1\n\n7\n\nWe have six possible pairs (L, R) as follows:\n\nFor L = 1, R = 1, S = \\{1\\} and we have 1 connected component.\n\nFor L = 1, R = 2, S = \\{1, 2\\} and we have 2 connected components.\n\nFor L = 1, R = 3, S = \\{1, 2, 3\\} and we have 1 connected component, since S contains both endpoints of each of the edges 1, 2.\n\nFor L = 2, R = 2, S = \\{2\\} and we have 1 connected component.\n\nFor L = 2, R = 3, S = \\{2, 3\\} and we have 1 connected component, since S contains both endpoints of Edge 2.\n\nFor L = 3, R = 3, S = \\{3\\} and we have 1 connected component.\n\nThe sum of these is 7.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n5 3\n5 7\n8 9\n1 9\n9 10\n8 4\n7 4\n6 10\n7 2\n\nSample Output 3\n\n113", "sample_input": "3\n1 3\n2 3\n"}, "reference_outputs": ["7\n"], "source_document_id": "p02617", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have a tree with N vertices and N-1 edges, respectively numbered 1, 2,\\cdots, N and 1, 2, \\cdots, N-1. Edge i connects Vertex u_i and v_i.\n\nFor integers L, R (1 \\leq L \\leq R \\leq N), let us define a function f(L, R) as follows:\n\nLet S be the set of the vertices numbered L through R. f(L, R) represents the number of connected components in the subgraph formed only from the vertex set S and the edges whose endpoints both belong to S.\n\nCompute \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq u_i, v_i \\leq N\n\nThe given graph is a tree.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1\nu_2 v_2\n:\nu_{N-1} v_{N-1}\n\nOutput\n\nPrint \\sum_{L=1}^{N} \\sum_{R=L}^{N} f(L, R).\n\nSample Input 1\n\n3\n1 3\n2 3\n\nSample Output 1\n\n7\n\nWe have six possible pairs (L, R) as follows:\n\nFor L = 1, R = 1, S = \\{1\\} and we have 1 connected component.\n\nFor L = 1, R = 2, S = \\{1, 2\\} and we have 2 connected components.\n\nFor L = 1, R = 3, S = \\{1, 2, 3\\} and we have 1 connected component, since S contains both endpoints of each of the edges 1, 2.\n\nFor L = 2, R = 2, S = \\{2\\} and we have 1 connected component.\n\nFor L = 2, R = 3, S = \\{2, 3\\} and we have 1 connected component, since S contains both endpoints of Edge 2.\n\nFor L = 3, R = 3, S = \\{3\\} and we have 1 connected component.\n\nThe sum of these is 7.\n\nSample Input 2\n\n2\n1 2\n\nSample Output 2\n\n3\n\nSample Input 3\n\n10\n5 3\n5 7\n8 9\n1 9\n9 10\n8 4\n7 4\n6 10\n7 2\n\nSample Output 3\n\n113", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 933, "cpu_time_ms": 135, "memory_kb": 61488}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s414514094", "group_id": "codeNet:p02622", "input_text": "function Main(input) {\n\tinput = input.split(\"\\n\");\n\tinput2 = input[1].split(\" \");\n\n \tvar a = input[0].split(\"\");\n\tvar b = input2[0].split(\"\");\n \tvar count = 0;\n \n \ta.forEach((item, i) => {\n if(a[i] !== b[i]) {\n count++;\n }\n });\n \n\t//出力\n\tconsole.log('%d',count);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1595705363, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/JavaScript/s414514094.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s414514094", "user_id": "u257694547"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "function Main(input) {\n\tinput = input.split(\"\\n\");\n\tinput2 = input[1].split(\" \");\n\n \tvar a = input[0].split(\"\");\n\tvar b = input2[0].split(\"\");\n \tvar count = 0;\n \n \ta.forEach((item, i) => {\n if(a[i] !== b[i]) {\n count++;\n }\n });\n \n\t//出力\n\tconsole.log('%d',count);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 477, "cpu_time_ms": 86, "memory_kb": 35544}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s225433185", "group_id": "codeNet:p02622", "input_text": "process.stdin.setEncoding('utf-8')\nprocess.stdin.on('data', (data) => {\n const array = data.trim().split(/[\\n]/)\n array[0].trim()\n array[1].trim()\n let res = 0\n for (let i = 0; i < array[0].length; i++) {\n if (array[0][i] !== array[1][i]){\n res ++\n }\n }\n console.log(res)\n})\n", "language": "JavaScript", "metadata": {"date": 1593310445, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/JavaScript/s225433185.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s225433185", "user_id": "u737801844"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "process.stdin.setEncoding('utf-8')\nprocess.stdin.on('data', (data) => {\n const array = data.trim().split(/[\\n]/)\n array[0].trim()\n array[1].trim()\n let res = 0\n for (let i = 0; i < array[0].length; i++) {\n if (array[0][i] !== array[1][i]){\n res ++\n }\n }\n console.log(res)\n})\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 321, "cpu_time_ms": 81, "memory_kb": 32732}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s385777620", "group_id": "codeNet:p02622", "input_text": "const Main = input => {\n input = input.split(\"\\n\");\n const s = input[0];\n const t = input[1];\n\n let count = 0;\n for(let i = 0; i < s.length; i++) {\n if(!(s.charAt(i) === t.charAt(i))) {\n count++;\n }\n }\n \n console.log(count);\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1593306452, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02622.html", "problem_id": "p02622", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02622/input.txt", "sample_output_relpath": "derived/input_output/data/p02622/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02622/JavaScript/s385777620.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s385777620", "user_id": "u765734095"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "const Main = input => {\n input = input.split(\"\\n\");\n const s = input[0];\n const t = input[1];\n\n let count = 0;\n for(let i = 0; i < s.length; i++) {\n if(!(s.charAt(i) === t.charAt(i))) {\n count++;\n }\n }\n \n console.log(count);\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "sample_input": "cupofcoffee\ncupofhottea\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02622", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings S and T. Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so.\n\nOperation: Choose one character of S and replace it with a different character.\n\nConstraints\n\nS and T have lengths between 1 and 2\\times 10^5 (inclusive).\n\nS and T consists of lowercase English letters.\n\nS and T have equal lengths.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\ncupofcoffee\ncupofhottea\n\nSample Output 1\n\n4\n\nWe can achieve the objective in four operations, such as the following:\n\nFirst, replace the sixth character c with h.\n\nSecond, replace the eighth character f with t.\n\nThird, replace the ninth character f with t.\n\nFourth, replace the eleventh character e with a.\n\nSample Input 2\n\nabcde\nbcdea\n\nSample Output 2\n\n5\n\nSample Input 3\n\napple\napple\n\nSample Output 3\n\n0\n\nNo operations may be needed to achieve the objective.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 68, "memory_kb": 33144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s788110563", "group_id": "codeNet:p02627", "input_text": "function Main(input) {\n const a = input;\n \n if(isUpperCase(a)){\n console.log('A');\n }else{\n console.log('a');\n }\n \n \n}\n\nconst isUpperCase = c => {\n return /^[A-Z]+$/g.test(c)\n}\n \n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1594759105, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02627.html", "problem_id": "p02627", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02627/input.txt", "sample_output_relpath": "derived/input_output/data/p02627/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02627/JavaScript/s788110563.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s788110563", "user_id": "u697972704"}, "prompt_components": {"gold_output": "A\n", "input_to_evaluate": "function Main(input) {\n const a = input;\n \n if(isUpperCase(a)){\n console.log('A');\n }else{\n console.log('a');\n }\n \n \n}\n\nconst isUpperCase = c => {\n return /^[A-Z]+$/g.test(c)\n}\n \n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "sample_input": "B\n"}, "reference_outputs": ["A\n"], "source_document_id": "p02627", "source_text": "Score : 100 points\n\nProblem Statement\n\nAn uppercase or lowercase English letter \\alpha will be given as input.\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nConstraints\n\n\\alpha is an uppercase (A - Z) or lowercase (a - z) English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nα\n\nOutput\n\nIf \\alpha is uppercase, print A; if it is lowercase, print a.\n\nSample Input 1\n\nB\n\nSample Output 1\n\nA\n\nB is uppercase, so we should print A.\n\nSample Input 2\n\na\n\nSample Output 2\n\na\n\na is lowercase, so we should print a.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 62, "memory_kb": 29408}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s914136778", "group_id": "codeNet:p02628", "input_text": "// parameter \"input\" gets all data\nfunction Main(input) {\n\t// the first line is assigned to input[0], the second line is assigned to input[1] similarly.\n\tinput = input.split(\"\\n\");\n\tlet n = input[0].split(\" \")[0];\n\tlet k = input[0].split(\" \")[1];\n\tlet arr = input[1].split(\" \").map(el => parseInt(el));\n\tarr.sort();\n \tlet ans = 0;\n\tfor(let i=0;i parseInt(el));\n\tarr.sort();\n \tlet ans = 0;\n\tfor(let i=0;i {\n const analyzed = analyzeInput(input);\n const result = getResult(analyzed.K, analyzed.Pk);\n\n console.log(result);\n});\n\nconst analyzeInput = (input) => {\n const lines = input.split(\"\\n\");\n const line1 = lines[0].split(\" \");\n const line2 = lines[1].split(\" \");\n\n const N = line1[0];\n const K = line1[1];\n\n const pk = line2.map(num => Number(num));\n\n return {\n N: N,\n K: K,\n Pk: pk,\n };\n};\n\nconst getResult = (k, pk) => {\n pk.sort((p1, p2) => {\n if (p1 > p2) return 1;\n if (p1 < p2) return -1;\n return 0;\n });\n\n const sum = pk.slice(0, k).reduce((total, curr) => {\n return total + curr;\n }, 0);\n\n return sum;\n};\n\n\n", "language": "JavaScript", "metadata": {"date": 1592788657, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02628.html", "problem_id": "p02628", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02628/input.txt", "sample_output_relpath": "derived/input_output/data/p02628/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02628/JavaScript/s058684626.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s058684626", "user_id": "u938005055"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\nprocess.stdin.on(\"data\", (input) => {\n const analyzed = analyzeInput(input);\n const result = getResult(analyzed.K, analyzed.Pk);\n\n console.log(result);\n});\n\nconst analyzeInput = (input) => {\n const lines = input.split(\"\\n\");\n const line1 = lines[0].split(\" \");\n const line2 = lines[1].split(\" \");\n\n const N = line1[0];\n const K = line1[1];\n\n const pk = line2.map(num => Number(num));\n\n return {\n N: N,\n K: K,\n Pk: pk,\n };\n};\n\nconst getResult = (k, pk) => {\n pk.sort((p1, p2) => {\n if (p1 > p2) return 1;\n if (p1 < p2) return -1;\n return 0;\n });\n\n const sum = pk.slice(0, k).reduce((total, curr) => {\n return total + curr;\n }, 0);\n\n return sum;\n};\n\n\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "sample_input": "5 3\n50 100 80 120 80\n"}, "reference_outputs": ["210\n"], "source_document_id": "p02628", "source_text": "Score : 200 points\n\nProblem Statement\n\nA shop sells N kinds of fruits, Fruit 1, \\ldots, N, at prices of p_1, \\ldots, p_N yen per item, respectively. (Yen is the currency of Japan.)\n\nHere, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits.\n\nConstraints\n\n1 \\leq K \\leq N \\leq 1000\n\n1 \\leq p_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 p_2 \\ldots p_N\n\nOutput\n\nPrint an integer representing the minimum possible total price of fruits.\n\nSample Input 1\n\n5 3\n50 100 80 120 80\n\nSample Output 1\n\n210\n\nThis shop sells Fruit 1, 2, 3, 4, and 5 for 50 yen, 100 yen, 80 yen, 120 yen, and 80 yen, respectively.\n\nThe minimum total price for three kinds of fruits is 50 + 80 + 80 = 210 yen when choosing Fruit 1, 3, and 5.\n\nSample Input 2\n\n1 1\n1000\n\nSample Output 2\n\n1000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 751, "cpu_time_ms": 77, "memory_kb": 30032}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s336397911", "group_id": "codeNet:p02628", "input_text": "\"use strict\"\nconst create = () => {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nconst Main = () => {\n const [N, K] = nextIntArray()\n const p = nextIntArray()\n p.sort((a,b) => a-b)\n let ans = 0\n for(let i = 0; i {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nconst Main = () => {\n const [N, K] = nextIntArray()\n const p = nextIntArray()\n p.sort((a,b) => a-b)\n let ans = 0\n for(let i = 0; i 0) {\n \tconst c = chars[value % base]\n result = c + result\n value = Math.floor(value / base)\n }\n\treturn result\n}\n \nconst inputValue = parseInt(fs.readFileSync('/dev/stdin', 'utf8'))\nconsole.log(changeBase(inputValue))", "language": "JavaScript", "metadata": {"date": 1592957194, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/JavaScript/s903363280.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s903363280", "user_id": "u078377510"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "const fs = require('fs')\nconst chars = 'abcdefghijklmnopqrstuvwxyz'\n \nfunction changeBase(value) {\n\tconst base = chars.length\n let result = ''\n while (value > 0) {\n \tconst c = chars[value % base]\n result = c + result\n value = Math.floor(value / base)\n }\n\treturn result\n}\n \nconst inputValue = parseInt(fs.readFileSync('/dev/stdin', 'utf8'))\nconsole.log(changeBase(inputValue))", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 401, "cpu_time_ms": 66, "memory_kb": 29548}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s721118852", "group_id": "codeNet:p02629", "input_text": "function main(input) {\n let N = parseInt(input.split(\"\\n\"), 10);\n let alphabet = \"abcdefghijklmnopqrstuvwhyz\";\n let result = \"\";\n\n while (0 < N) {\n let M = N % 26;\n if (M === 26) {\n M = 26;\n }\n result = alphabet.substr(M - 1, 1) + result;\n N = (N - M) / 26;\n }\n\n console.log(result);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// main(\"1111\");\n", "language": "JavaScript", "metadata": {"date": 1592865552, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/JavaScript/s721118852.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s721118852", "user_id": "u819348316"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "function main(input) {\n let N = parseInt(input.split(\"\\n\"), 10);\n let alphabet = \"abcdefghijklmnopqrstuvwhyz\";\n let result = \"\";\n\n while (0 < N) {\n let M = N % 26;\n if (M === 26) {\n M = 26;\n }\n result = alphabet.substr(M - 1, 1) + result;\n N = (N - M) / 26;\n }\n\n console.log(result);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// main(\"1111\");\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 385, "cpu_time_ms": 66, "memory_kb": 29388}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s190477977", "group_id": "codeNet:p02629", "input_text": "const main = (input) => {\n const a = '0abcdefghijklmnopqrstuvwxyz'\n let N = BigInt(input.trim())\n\n const ans = []\n while (N > 26n) {\n const r = Number(N % 26n)\n ans.unshift(a[r])\n N = (N - BigInt(r)) / 26n\n }\n if (N > 0n) ans.unshift(a[Number(N)])\n return console.log(ans.join(''))\n}\n\nprocess.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1592804648, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/JavaScript/s190477977.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s190477977", "user_id": "u124735330"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "const main = (input) => {\n const a = '0abcdefghijklmnopqrstuvwxyz'\n let N = BigInt(input.trim())\n\n const ans = []\n while (N > 26n) {\n const r = Number(N % 26n)\n ans.unshift(a[r])\n N = (N - BigInt(r)) / 26n\n }\n if (N > 0n) ans.unshift(a[Number(N)])\n return console.log(ans.join(''))\n}\n\nprocess.env.MYTEST ? test() : main(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 386, "cpu_time_ms": 62, "memory_kb": 29536}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s553296528", "group_id": "codeNet:p02629", "input_text": "\"use strict\";\n\nfunction main(input) {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n const alphabet_arr = alphabet.split(\"\");\n input = input.trim();\n const az = 26;\n let num = parseInt(input);\n let n = 1; //桁数\n let m = 0;\n let ans = [];\n\n while (num > 26) {\n n++;\n const a = num % az;\n ans.push(a);\n num = Math.floor(num / az);\n }\n ans.push(num % az);\n for (let i in ans) {\n ans[i] = alphabet_arr[ans[i] - 1];\n }\n console.log(ans.reverse().join(\"\"));\n}\nvar f = function (a, b) {\n return a - b;\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf-8\"));\n", "language": "JavaScript", "metadata": {"date": 1592794166, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/JavaScript/s553296528.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s553296528", "user_id": "u479559778"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "\"use strict\";\n\nfunction main(input) {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n const alphabet_arr = alphabet.split(\"\");\n input = input.trim();\n const az = 26;\n let num = parseInt(input);\n let n = 1; //桁数\n let m = 0;\n let ans = [];\n\n while (num > 26) {\n n++;\n const a = num % az;\n ans.push(a);\n num = Math.floor(num / az);\n }\n ans.push(num % az);\n for (let i in ans) {\n ans[i] = alphabet_arr[ans[i] - 1];\n }\n console.log(ans.reverse().join(\"\"));\n}\nvar f = function (a, b) {\n return a - b;\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf-8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 591, "cpu_time_ms": 62, "memory_kb": 29936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s527558096", "group_id": "codeNet:p02629", "input_text": "\"use strict\";\n\nfunction main(input) {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n const alphabet_arr = alphabet.split(\"\");\n console.log(alphabet_arr[0]);\n input = input.trim();\n const az = 26;\n let num = parseInt(input);\n let n = 1; //桁数\n let m = 0;\n let ans = [];\n\n while (num > 26) {\n n++;\n const a = num % az;\n ans.push(a);\n num = Math.floor(num / az);\n }\n ans.push(num % az);\n for (let i in ans) {\n ans[i] = alphabet_arr[ans[i] - 1];\n }\n console.log(ans);\n}\nvar f = function (a, b) {\n return a - b;\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf-8\"));\n", "language": "JavaScript", "metadata": {"date": 1592793883, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02629.html", "problem_id": "p02629", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02629/input.txt", "sample_output_relpath": "derived/input_output/data/p02629/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02629/JavaScript/s527558096.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s527558096", "user_id": "u479559778"}, "prompt_components": {"gold_output": "b\n", "input_to_evaluate": "\"use strict\";\n\nfunction main(input) {\n const alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n const alphabet_arr = alphabet.split(\"\");\n console.log(alphabet_arr[0]);\n input = input.trim();\n const az = 26;\n let num = parseInt(input);\n let n = 1; //桁数\n let m = 0;\n let ans = [];\n\n while (num > 26) {\n n++;\n const a = num % az;\n ans.push(a);\n num = Math.floor(num / az);\n }\n ans.push(num % az);\n for (let i in ans) {\n ans[i] = alphabet_arr[ans[i] - 1];\n }\n console.log(ans);\n}\nvar f = function (a, b) {\n return a - b;\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf-8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "sample_input": "2\n"}, "reference_outputs": ["b\n"], "source_document_id": "p02629", "source_text": "Score : 300 points\n\nProblem Statement\n\n1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001, but he gave them new names, as follows:\n\nthe dogs numbered 1,2,\\cdots,26 were respectively given the names a, b, ..., z;\n\nthe dogs numbered 27,28,29,\\cdots,701,702 were respectively given the names aa, ab, ac, ..., zy, zz;\n\nthe dogs numbered 703,704,705,\\cdots,18277,18278 were respectively given the names aaa, aab, aac, ..., zzy, zzz;\n\nthe dogs numbered 18279,18280,18281,\\cdots,475253,475254 were respectively given the names aaaa, aaab, aaac, ..., zzzy, zzzz;\n\nthe dogs numbered 475255,475256,\\cdots were respectively given the names aaaaa, aaaab, ...;\n\nand so on.\n\nTo sum it up, the dogs numbered 1, 2, \\cdots were respectively given the following names:\n\na, b, ..., z, aa, ab, ..., az, ba, bb, ..., bz, ..., za, zb, ..., zz, aaa, aab, ..., aaz, aba, abb, ..., abz, ..., zzz, aaaa, ...\n\nNow, Roger asks you:\n\n\"What is the name for the dog numbered N?\"\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 1000000000000001\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer to Roger's question as a string consisting of lowercase English letters.\n\nSample Input 1\n\n2\n\nSample Output 1\n\nb\n\nSample Input 2\n\n27\n\nSample Output 2\n\naa\n\nSample Input 3\n\n123456789\n\nSample Output 3\n\njjddja", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 604, "cpu_time_ms": 64, "memory_kb": 29936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s933813192", "group_id": "codeNet:p02630", "input_text": "\"use strict\"\n\nfunction main(arg) {\n lines = arg.split(\"\\n\")\n const N = Number(lines[0])\n let A = lines[1].split(\" \").map(x=>Number(x))\n const Q = Number(lines[2])\n lines.shift()\n lines.shift()\n lines.shift()\n const B = lines.map(x=>Number(x.split(\" \")[0]))\n const C = lines.map(x=>Number(x.split(\" \")[1]))\n \n let sum = []\n sum[0] = A.reduce((a,b)=>a+b)//initial summation\n A.sort()\n \n for(let i=0; iNumber(x))\n const Q = Number(lines[2])\n lines.shift()\n lines.shift()\n lines.shift()\n const B = lines.map(x=>Number(x.split(\" \")[0]))\n const C = lines.map(x=>Number(x.split(\" \")[1]))\n \n let sum = []\n sum[0] = A.reduce((a,b)=>a+b)//initial summation\n A.sort()\n \n for(let i=0; i parseInt(e, 10));\n var Q = parseInt(input[2], 10);\n ary_bc = [];\n for (var i = 0; i < Q; i++){\n ary_bc.push(input[i+3].map(e => parseInt(e, 10)));\n }\n var ATable = vec_A.reduce(function(m, a, i) {\n m[a] = (m[a] || []).concat(i);\n return m;\n }, {});\n var b, c, l;\n var vec_S = [];\n var S = sum(vec_A);\n\n for (i = 0; i < Q; i++){\n l = 0;\n if (ary_bc[i][0] in ATable){\n \tl = 0;\n \tvar tmp = ATable[String(ary_bc[i][0])]\n if (tmp !== undefined) l = tmp.length;\n if (ary_bc[i][1] in ATable){\n ATable[String(ary_bc[i][1])] = ATable[String(ary_bc[i][0])].concat(ATable[String(ary_bc[i][1])]);\n } else {\n ATable[String(ary_bc[i][1])] = ATable[String(ary_bc[i][0])];\n }\n delete(ATable[String(ary_bc[i][0])]);\n }\n S = S + (ary_bc[i][1] - ary_bc[i][0]) * l\n vec_S.push(S);\n }\n\tconsole.log(vec_S.join('\\n');\n} \n\nvar sum = function(arr) {\n var sum = 0;\n arr.forEach(function(elm) {\n sum += elm;\n });\n return sum;\n};\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1592795438, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02630.html", "problem_id": "p02630", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02630/input.txt", "sample_output_relpath": "derived/input_output/data/p02630/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02630/JavaScript/s398261448.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s398261448", "user_id": "u624950076"}, "prompt_components": {"gold_output": "11\n12\n16\n", "input_to_evaluate": "function Main(input) {\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n var N = parseInt(input[0],10);\n var vec_A = input[1].map(e => parseInt(e, 10));\n var Q = parseInt(input[2], 10);\n ary_bc = [];\n for (var i = 0; i < Q; i++){\n ary_bc.push(input[i+3].map(e => parseInt(e, 10)));\n }\n var ATable = vec_A.reduce(function(m, a, i) {\n m[a] = (m[a] || []).concat(i);\n return m;\n }, {});\n var b, c, l;\n var vec_S = [];\n var S = sum(vec_A);\n\n for (i = 0; i < Q; i++){\n l = 0;\n if (ary_bc[i][0] in ATable){\n \tl = 0;\n \tvar tmp = ATable[String(ary_bc[i][0])]\n if (tmp !== undefined) l = tmp.length;\n if (ary_bc[i][1] in ATable){\n ATable[String(ary_bc[i][1])] = ATable[String(ary_bc[i][0])].concat(ATable[String(ary_bc[i][1])]);\n } else {\n ATable[String(ary_bc[i][1])] = ATable[String(ary_bc[i][0])];\n }\n delete(ATable[String(ary_bc[i][0])]);\n }\n S = S + (ary_bc[i][1] - ary_bc[i][0]) * l\n vec_S.push(S);\n }\n\tconsole.log(vec_S.join('\\n');\n} \n\nvar sum = function(arr) {\n var sum = 0;\n arr.forEach(function(elm) {\n sum += elm;\n });\n return sum;\n};\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\n\nYou will now successively do the following Q operations:\n\nIn the i-th operation, you replace every element whose value is B_{i} with C_{i}.\n\nFor each i (1 \\leq i \\leq Q), find S_{i}: the sum of all elements in A just after the i-th operation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q, A_{i}, B_{i}, C_{i} \\leq 10^{5}\n\nB_{i} \\neq C_{i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1} A_{2} \\cdots A_{N}\nQ\nB_{1} C_{1}\nB_{2} C_{2}\n\\vdots\nB_{Q} C_{Q}\n\nOutput\n\nPrint Q integers S_{i} to Standard Output in the following format:\n\nS_{1}\nS_{2}\n\\vdots\nS_{Q}\n\nNote that S_{i} may not fit into a 32-bit integer.\n\nSample Input 1\n\n4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n11\n12\n16\n\nInitially, the sequence A is 1,2,3,4.\n\nAfter each operation, it becomes the following:\n\n2, 2, 3, 4\n\n2, 2, 4, 4\n\n4, 4, 4, 4\n\nSample Input 2\n\n4\n1 1 1 1\n3\n1 2\n2 1\n3 5\n\nSample Output 2\n\n8\n4\n4\n\nNote that the sequence A may not contain an element whose value is B_{i}.\n\nSample Input 3\n\n2\n1 2\n3\n1 100\n2 100\n100 1000\n\nSample Output 3\n\n102\n200\n2000", "sample_input": "4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n"}, "reference_outputs": ["11\n12\n16\n"], "source_document_id": "p02630", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have a sequence A composed of N positive integers: A_{1}, A_{2}, \\cdots, A_{N}.\n\nYou will now successively do the following Q operations:\n\nIn the i-th operation, you replace every element whose value is B_{i} with C_{i}.\n\nFor each i (1 \\leq i \\leq Q), find S_{i}: the sum of all elements in A just after the i-th operation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q, A_{i}, B_{i}, C_{i} \\leq 10^{5}\n\nB_{i} \\neq C_{i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_{1} A_{2} \\cdots A_{N}\nQ\nB_{1} C_{1}\nB_{2} C_{2}\n\\vdots\nB_{Q} C_{Q}\n\nOutput\n\nPrint Q integers S_{i} to Standard Output in the following format:\n\nS_{1}\nS_{2}\n\\vdots\nS_{Q}\n\nNote that S_{i} may not fit into a 32-bit integer.\n\nSample Input 1\n\n4\n1 2 3 4\n3\n1 2\n3 4\n2 4\n\nSample Output 1\n\n11\n12\n16\n\nInitially, the sequence A is 1,2,3,4.\n\nAfter each operation, it becomes the following:\n\n2, 2, 3, 4\n\n2, 2, 4, 4\n\n4, 4, 4, 4\n\nSample Input 2\n\n4\n1 1 1 1\n3\n1 2\n2 1\n3 5\n\nSample Output 2\n\n8\n4\n4\n\nNote that the sequence A may not contain an element whose value is B_{i}.\n\nSample Input 3\n\n2\n1 2\n3\n1 100\n2 100\n100 1000\n\nSample Output 3\n\n102\n200\n2000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1350, "cpu_time_ms": 173, "memory_kb": 29808}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s003467493", "group_id": "codeNet:p02639", "input_text": "function Main(input){\n input=input.split(\"\\n\"); //ここまで必須\n var line=input[0].split(\" \");\n var result=\"\";\n for (i=0;i<5;i++){\n if (line[i]==0){result=i}\n }\n console.log(parseInt(result)+1)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1594258986, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/JavaScript/s003467493.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s003467493", "user_id": "u631344187"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input){\n input=input.split(\"\\n\"); //ここまで必須\n var line=input[0].split(\" \");\n var result=\"\";\n for (i=0;i<5;i++){\n if (line[i]==0){result=i}\n }\n console.log(parseInt(result)+1)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 281, "cpu_time_ms": 58, "memory_kb": 29564}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s290098671", "group_id": "codeNet:p02639", "input_text": "// JavaScript source code\n\"use strict\";\n\nfunction main(input) {\n input = input.split(\" \");\n for (let i = 0; i < 5; i++) {\n if (input[i] == 0) {\n console.log(i + 1);\n break;\n }\n }\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1593287088, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/JavaScript/s290098671.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s290098671", "user_id": "u941828927"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "// JavaScript source code\n\"use strict\";\n\nfunction main(input) {\n input = input.split(\" \");\n for (let i = 0; i < 5; i++) {\n if (input[i] == 0) {\n console.log(i + 1);\n break;\n }\n }\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 283, "cpu_time_ms": 58, "memory_kb": 29624}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s702985822", "group_id": "codeNet:p02639", "input_text": "const toInt = x=>parseInt(x,10);\nconst toIntArr = arr=>arr.map(x=>toInt(x));\nconst abs = x=>x>0?x:-x;\nfunction min(){let rest = arguments,val=rest[0];for(let i=1;ival)val = rest[i];return val}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \nfunction Main(inputText){\n\tlet input = inputText.split('\\n');\n\tinput = input.map(e => toIntArr(e.split(' ')));\n\tlet xs = input[0];\n\tfor(let i = 0; i < 5; i++)if(i+1!==xs[i]){\n\t\tconsole.log(i+1);\n\t\treturn 0;\n\t};\n}", "language": "JavaScript", "metadata": {"date": 1592189894, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/JavaScript/s702985822.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s702985822", "user_id": "u511119682"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "const toInt = x=>parseInt(x,10);\nconst toIntArr = arr=>arr.map(x=>toInt(x));\nconst abs = x=>x>0?x:-x;\nfunction min(){let rest = arguments,val=rest[0];for(let i=1;ival)val = rest[i];return val}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \nfunction Main(inputText){\n\tlet input = inputText.split('\\n');\n\tinput = input.map(e => toIntArr(e.split(' ')));\n\tlet xs = input[0];\n\tfor(let i = 0; i < 5; i++)if(i+1!==xs[i]){\n\t\tconsole.log(i+1);\n\t\treturn 0;\n\t};\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 610, "cpu_time_ms": 45, "memory_kb": 29632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s749424783", "group_id": "codeNet:p02639", "input_text": "r=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\").split(\" \");\nfor(i in r)if(i==\"0\")console.log(i-0+1);", "language": "JavaScript", "metadata": {"date": 1592185026, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02639.html", "problem_id": "p02639", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02639/input.txt", "sample_output_relpath": "derived/input_output/data/p02639/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02639/JavaScript/s749424783.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s749424783", "user_id": "u876724679"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "r=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\").split(\" \");\nfor(i in r)if(i==\"0\")console.log(i-0+1);", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "sample_input": "0 2 3 4 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02639", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have five variables x_1, x_2, x_3, x_4, and x_5.\n\nThe variable x_i was initially assigned a value of i.\n\nSnuke chose one of these variables and assigned it 0.\n\nYou are given the values of the five variables after this assignment.\n\nFind out which variable Snuke assigned 0.\n\nConstraints\n\nThe values of x_1, x_2, x_3, x_4, and x_5 given as input are a possible outcome of the assignment by Snuke.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 x_2 x_3 x_4 x_5\n\nOutput\n\nIf the variable Snuke assigned 0 was x_i, print the integer i.\n\nSample Input 1\n\n0 2 3 4 5\n\nSample Output 1\n\n1\n\nIn this case, Snuke assigned 0 to x_1, so we should print 1.\n\nSample Input 2\n\n1 2 0 4 5\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 102, "cpu_time_ms": 49, "memory_kb": 29644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s648232886", "group_id": "codeNet:p02640", "input_text": "\"use strict\";\n\nconst main = (input) => {\n const spi = input.split('\\n');\n const [x, y] = spi[0].split(' ').map(e => parseInt(e));\n\n for (let i = 0; i < x + 1; i++) {\n const turu = i * 2;\n const kame = (x - i) * 4;\n\n if (turu + kame === y) {\n console.log(\"Yes\");\n return;\n }\n }\n\n console.log(\"No\");\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1597080594, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/JavaScript/s648232886.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s648232886", "user_id": "u688789047"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\n\nconst main = (input) => {\n const spi = input.split('\\n');\n const [x, y] = spi[0].split(' ').map(e => parseInt(e));\n\n for (let i = 0; i < x + 1; i++) {\n const turu = i * 2;\n const kame = (x - i) * 4;\n\n if (turu + kame === y) {\n console.log(\"Yes\");\n return;\n }\n }\n\n console.log(\"No\");\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 423, "cpu_time_ms": 237, "memory_kb": 30556}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s711074236", "group_id": "codeNet:p02640", "input_text": "function Main(input) {\n\n input = input.split(\"\\n\");\n const numArray = input[0].split(\" \");\n\n const sum = Number(numArray[0]);\n const legSum = Number(numArray[1]);\n\n const min = sum * 2;\n const max = sum * 4;\n\n\n if (legSum >= min && legSum <= max && legSum % 2 === 0) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1592971385, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/JavaScript/s711074236.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s711074236", "user_id": "u457440934"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(input) {\n\n input = input.split(\"\\n\");\n const numArray = input[0].split(\" \");\n\n const sum = Number(numArray[0]);\n const legSum = Number(numArray[1]);\n\n const min = sum * 2;\n const max = sum * 4;\n\n\n if (legSum >= min && legSum <= max && legSum % 2 === 0) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 422, "cpu_time_ms": 95, "memory_kb": 29524}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s911155127", "group_id": "codeNet:p02640", "input_text": "// ABC170 - B\nfunction main(input) {\n var inputs = input.trim().split('\\n');\n var X = inputs[0].split(' ')[0] - 0;\n var Y = inputs[0].split(' ')[1] - 0;\n\n for (var cr = 0; cr < X; cr++) {\n for (var tu = X - cr; tu >= 0; tu--) {\n if (cr * 2 + tu * 4 === Y) {\n console.log('Yes');\n return;\n }\n }\n }\n\n console.log('No');\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1592187790, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/JavaScript/s911155127.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s911155127", "user_id": "u474579514"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// ABC170 - B\nfunction main(input) {\n var inputs = input.trim().split('\\n');\n var X = inputs[0].split(' ')[0] - 0;\n var Y = inputs[0].split(' ')[1] - 0;\n\n for (var cr = 0; cr < X; cr++) {\n for (var tu = X - cr; tu >= 0; tu--) {\n if (cr * 2 + tu * 4 === Y) {\n console.log('Yes');\n return;\n }\n }\n }\n\n console.log('No');\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 412, "cpu_time_ms": 45, "memory_kb": 29608}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s931754581", "group_id": "codeNet:p02640", "input_text": "const main = (input) => {\n const args = input.trim().split(\" \");\n const x = parseInt(args[0], 10);\n const y = parseInt(args[1], 10);\n\n if (y % 2 !== 0 || y / 2 - x < 0 || 2 * x - y / 2 < 0) {\n console.log(\"No\");\n } else {\n console.log(\"Yes\");\n }\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1592184401, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02640.html", "problem_id": "p02640", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02640/input.txt", "sample_output_relpath": "derived/input_output/data/p02640/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02640/JavaScript/s931754581.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s931754581", "user_id": "u199519744"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "const main = (input) => {\n const args = input.trim().split(\" \");\n const x = parseInt(args[0], 10);\n const y = parseInt(args[1], 10);\n\n if (y % 2 !== 0 || y / 2 - x < 0 || 2 * x - y / 2 < 0) {\n console.log(\"No\");\n } else {\n console.log(\"Yes\");\n }\n};\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "sample_input": "3 8\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02640", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are some animals in a garden. Each of them is a crane with two legs or a turtle with four legs.\n\nTakahashi says: \"there are X animals in total in the garden, and they have Y legs in total.\" Determine whether there is a combination of numbers of cranes and turtles in which this statement is correct.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n1 \\leq Y \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf there is a combination of numbers of cranes and turtles in which the statement is correct, print Yes; otherwise, print No.\n\nSample Input 1\n\n3 8\n\nSample Output 1\n\nYes\n\nThe statement \"there are 3 animals in total in the garden, and they have 8 legs in total\" is correct if there are two cranes and one turtle. Thus, there is a combination of numbers of cranes and turtles in which the statement is correct.\n\nSample Input 2\n\n2 100\n\nSample Output 2\n\nNo\n\nThere is no combination of numbers of cranes and turtles in which this statement is correct.\n\nSample Input 3\n\n1 2\n\nSample Output 3\n\nYes\n\nWe also consider the case in which there are only cranes or only turtles.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 317, "cpu_time_ms": 48, "memory_kb": 29628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s870201202", "group_id": "codeNet:p02641", "input_text": "function main(input) {\n input = input.trim()\n const args = input.split(\"\\n\")\n\n args[0] = args[0].split(\" \")\n const x = Number(args[0][0])\n const n = Number(args[0][1])\n\n if (n === 0) return console.log(x)\n\n const pArray = args[1]\n .split(\" \")\n .map(v => Number(v))\n .sort((a, b) => a - b)\n\n const min = Math.min(x, pArray[0])\n const max = Math.max(x, pArray[n - 1])\n let last = null\n for (let i = min; i <= max + 1; i++) {\n if (pArray.includes(i) || i === x) continue\n\n const diff = Math.abs(x - i)\n if (!last) {\n last = { value: i, diff }\n continue\n }\n\n if (diff < last.diff) {\n last = { value: i, diff }\n continue\n }\n console.log(last.value)\n break\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))\n", "language": "JavaScript", "metadata": {"date": 1593649430, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/JavaScript/s870201202.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s870201202", "user_id": "u135661065"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "function main(input) {\n input = input.trim()\n const args = input.split(\"\\n\")\n\n args[0] = args[0].split(\" \")\n const x = Number(args[0][0])\n const n = Number(args[0][1])\n\n if (n === 0) return console.log(x)\n\n const pArray = args[1]\n .split(\" \")\n .map(v => Number(v))\n .sort((a, b) => a - b)\n\n const min = Math.min(x, pArray[0])\n const max = Math.max(x, pArray[n - 1])\n let last = null\n for (let i = min; i <= max + 1; i++) {\n if (pArray.includes(i) || i === x) continue\n\n const diff = Math.abs(x - i)\n if (!last) {\n last = { value: i, diff }\n continue\n }\n\n if (diff < last.diff) {\n last = { value: i, diff }\n continue\n }\n console.log(last.value)\n break\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 819, "cpu_time_ms": 62, "memory_kb": 29516}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s221410908", "group_id": "codeNet:p02641", "input_text": "const main = (input) => {\n const args = input.trim().split(\"\\n\");\n const [x, n] = args[0]\n .trim()\n .split(\" \")\n .map((n) => parseInt(n, 10));\n \n const excluded = (() => {\n if (n === 0) {\n return [];\n } else {\n return args[1]\n .trim()\n .split(\" \")\n .map((n) => parseInt(n, 10));\n }\n })();\n \n const selection = [...Array(101 + 1).keys()].filter(\n (s) => !excluded.includes(s)\n );\n \n const abs = (n) => {\n if (n < 0) return -n;\n else {\n return n;\n }\n };\n const byAsc = (a, b) => a[1] - b[1];\n \n const answer = selection\n .map((s) => [s, abs(x - s)])\n .sort(byAsc)[0][0];\n \n console.log(answer);\n};\n \nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1592191957, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/JavaScript/s221410908.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s221410908", "user_id": "u199519744"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "const main = (input) => {\n const args = input.trim().split(\"\\n\");\n const [x, n] = args[0]\n .trim()\n .split(\" \")\n .map((n) => parseInt(n, 10));\n \n const excluded = (() => {\n if (n === 0) {\n return [];\n } else {\n return args[1]\n .trim()\n .split(\" \")\n .map((n) => parseInt(n, 10));\n }\n })();\n \n const selection = [...Array(101 + 1).keys()].filter(\n (s) => !excluded.includes(s)\n );\n \n const abs = (n) => {\n if (n < 0) return -n;\n else {\n return n;\n }\n };\n const byAsc = (a, b) => a[1] - b[1];\n \n const answer = selection\n .map((s) => [s, abs(x - s)])\n .sort(byAsc)[0][0];\n \n console.log(answer);\n};\n \nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 736, "cpu_time_ms": 45, "memory_kb": 29652}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s806731136", "group_id": "codeNet:p02641", "input_text": "\nfunction main(input) {\n let [X, N, ...ps] = input.trim().split(/[\\s\\n]/).map(Number)\n \n let down = X\n let up = X\n\n let changed = false\n do {\n changed = false\n for(const p of ps) {\n if(down === p) {\n down--\n changed = true\n }\n\n if(up === p) {\n up++\n changed = true\n }\n }\n } while(changed)\n\n const d = Math.abs(down - X)\n const u = Math.abs(up - X)\n \n if(d === u || d < u) {\n console.log(down)\n } else {\n console.log(up)\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))\n", "language": "JavaScript", "metadata": {"date": 1592184426, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02641.html", "problem_id": "p02641", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02641/input.txt", "sample_output_relpath": "derived/input_output/data/p02641/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02641/JavaScript/s806731136.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s806731136", "user_id": "u760244603"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "\nfunction main(input) {\n let [X, N, ...ps] = input.trim().split(/[\\s\\n]/).map(Number)\n \n let down = X\n let up = X\n\n let changed = false\n do {\n changed = false\n for(const p of ps) {\n if(down === p) {\n down--\n changed = true\n }\n\n if(up === p) {\n up++\n changed = true\n }\n }\n } while(changed)\n\n const d = Math.abs(down - X)\n const u = Math.abs(up - X)\n \n if(d === u || d < u) {\n console.log(down)\n } else {\n console.log(up)\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "sample_input": "6 5\n4 7 10 6 5\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02641", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are an integer X and an integer sequence of length N: p_1, \\ldots, p_N.\n\nAmong the integers not contained in the sequence p_1, \\ldots, p_N (not necessarily positive), find the integer nearest to X, that is, find the integer whose absolute difference with X is the minimum. If there are multiple such integers, report the smallest such integer.\n\nConstraints\n\n1 \\leq X \\leq 100\n\n0 \\leq N \\leq 100\n\n1 \\leq p_i \\leq 100\n\np_1, \\ldots, p_N are all distinct.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX N\np_1 ... p_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n6 5\n4 7 10 6 5\n\nSample Output 1\n\n8\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the one nearest to 6 is 8.\n\nSample Input 2\n\n10 5\n4 7 10 6 5\n\nSample Output 2\n\n9\n\nAmong the integers not contained in the sequence 4, 7, 10, 6, 5, the ones nearest to 10 are 9 and 11. We should print the smaller one, 9.\n\nSample Input 3\n\n100 0\n\nSample Output 3\n\n100\n\nWhen N = 0, the second line in the input will be empty. Also, as seen here, X itself can be the answer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 659, "cpu_time_ms": 48, "memory_kb": 29748}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s387241844", "group_id": "codeNet:p02646", "input_text": "'use strict';\nfunction Main(stdin){\n const input = stdin.trim().split(/\\r?\\n/g);\n const A_V= input[0].split(' ').map(str => BigInt(str));\n const A = A_V[0], V = A_V[1];\n const B_W= input[1].split(' ').map(str => BigInt(str));\n const B = B_W[0], W = B_W[1];\n const T = BigInt(input[2]);\n let result = 'NO';\n let kyori;\n const tidimu = V - W;\n \n if(tidimu > 0){\n if(A > 0 && B < 0){\n kyori = A + BigInt(String(B).slice(1));\n } else if(A < 0 && B > 0){\n kyori = B + BigInt(String(A).slice(1));\n } else {\n kyori = A - B;\n if(kyori < 0) kyori = BigInt(String(kyori).slice(1));\n }\n if(tidimu * T > kyori) result = 'YES';\n }\n console.log(result);\n}\n\n// 固定\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1592099529, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02646.html", "problem_id": "p02646", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02646/input.txt", "sample_output_relpath": "derived/input_output/data/p02646/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02646/JavaScript/s387241844.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s387241844", "user_id": "u253942942"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "'use strict';\nfunction Main(stdin){\n const input = stdin.trim().split(/\\r?\\n/g);\n const A_V= input[0].split(' ').map(str => BigInt(str));\n const A = A_V[0], V = A_V[1];\n const B_W= input[1].split(' ').map(str => BigInt(str));\n const B = B_W[0], W = B_W[1];\n const T = BigInt(input[2]);\n let result = 'NO';\n let kyori;\n const tidimu = V - W;\n \n if(tidimu > 0){\n if(A > 0 && B < 0){\n kyori = A + BigInt(String(B).slice(1));\n } else if(A < 0 && B > 0){\n kyori = B + BigInt(String(A).slice(1));\n } else {\n kyori = A - B;\n if(kyori < 0) kyori = BigInt(String(kyori).slice(1));\n }\n if(tidimu * T > kyori) result = 'YES';\n }\n console.log(result);\n}\n\n// 固定\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "sample_input": "1 2\n3 1\n3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02646", "source_text": "Score : 200 points\n\nProblem Statement\n\nTwo children are playing tag on a number line. (In the game of tag, the child called \"it\" tries to catch the other child.) The child who is \"it\" is now at coordinate A, and he can travel the distance of V per second.\nThe other child is now at coordinate B, and she can travel the distance of W per second.\n\nHe can catch her when his coordinate is the same as hers.\nDetermine whether he can catch her within T seconds (including exactly T seconds later).\nWe assume that both children move optimally.\n\nConstraints\n\n-10^9 \\leq A,B \\leq 10^9\n\n1 \\leq V,W \\leq 10^9\n\n1 \\leq T \\leq 10^9\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA V\nB W\nT\n\nOutput\n\nIf \"it\" can catch the other child, print YES; otherwise, print NO.\n\nSample Input 1\n\n1 2\n3 1\n3\n\nSample Output 1\n\nYES\n\nSample Input 2\n\n1 2\n3 2\n3\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n1 2\n3 3\n3\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 772, "cpu_time_ms": 45, "memory_kb": 29632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s790770389", "group_id": "codeNet:p02647", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var mem = input[0].split(\"\");\n var arr = input[1].split(\" \").map(Number);\n while (1) {\n var tmp = new Array(arr.length).fill(0);\n for (var i = 0; i < arr.length; i++) {\n var n = arr[i];\n // console.log(i,n)\n var min = i - n;\n var max = i + n;\n if (min < 0) min = 0;\n if (max > arr.length-1) max = arr.length-1;\n for (var j = min; j <= max; j++) {\n tmp[j]++;\n }\n // console.log(max,min,tmp)\n }\n // console.log(arr)\n var flag = true;\n for (var i = 0; i < arr.length; i++) {\n if(arr[i]!=tmp[i]) flag = false;\n arr[i] = tmp[i];\n }\n if(flag) break;\n }\n console.log(arr.join(\" \"));\n} Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "language": "JavaScript", "metadata": {"date": 1592098389, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02647.html", "problem_id": "p02647", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02647/input.txt", "sample_output_relpath": "derived/input_output/data/p02647/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02647/JavaScript/s790770389.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s790770389", "user_id": "u938152299"}, "prompt_components": {"gold_output": "1 2 2 1 2\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n var mem = input[0].split(\"\");\n var arr = input[1].split(\" \").map(Number);\n while (1) {\n var tmp = new Array(arr.length).fill(0);\n for (var i = 0; i < arr.length; i++) {\n var n = arr[i];\n // console.log(i,n)\n var min = i - n;\n var max = i + n;\n if (min < 0) min = 0;\n if (max > arr.length-1) max = arr.length-1;\n for (var j = min; j <= max; j++) {\n tmp[j]++;\n }\n // console.log(max,min,tmp)\n }\n // console.log(arr)\n var flag = true;\n for (var i = 0; i < arr.length; i++) {\n if(arr[i]!=tmp[i]) flag = false;\n arr[i] = tmp[i];\n }\n if(flag) break;\n }\n console.log(arr.join(\" \"));\n} Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "problem_context": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "sample_input": "5 1\n1 0 0 1 0\n"}, "reference_outputs": ["1 2 2 1 2\n"], "source_document_id": "p02647", "source_text": "Score : 500 points\n\nProblem Statement\n\nWe have N bulbs arranged on a number line, numbered 1 to N from left to right.\nBulb i is at coordinate i.\n\nEach bulb has a non-negative integer parameter called intensity.\nWhen there is a bulb of intensity d at coordinate x, the bulb illuminates the segment from coordinate x-d-0.5 to x+d+0.5.\nInitially, the intensity of Bulb i is A_i. We will now do the following operation K times in a row:\n\nFor each integer i between 1 and N (inclusive), let B_i be the number of bulbs illuminating coordinate i. Then, change the intensity of each bulb i to B_i.\n\nFind the intensity of each bulb after the K operations.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq K \\leq 2 \\times 10^5\n\n0 \\leq A_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the intensity A{'}_i of each bulb i after the K operations to Standard Output in the following format:\n\nA{'}_1 A{'}_2 \\ldots A{'}_N\n\nSample Input 1\n\n5 1\n1 0 0 1 0\n\nSample Output 1\n\n1 2 2 1 2\n\nInitially, only Bulb 1 illuminates coordinate 1, so the intensity of Bulb 1 becomes 1 after the operation.\nSimilarly, the bulbs initially illuminating coordinate 2 are Bulb 1 and 2, so the intensity of Bulb 2 becomes 2.\n\nSample Input 2\n\n5 2\n1 0 0 1 0\n\nSample Output 2\n\n3 3 4 4 3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 899, "cpu_time_ms": 2207, "memory_kb": 45144}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s023824463", "group_id": "codeNet:p02657", "input_text": "let multiply (a, b) {\n return a * b;\n}", "language": "JavaScript", "metadata": {"date": 1591712534, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02657.html", "problem_id": "p02657", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02657/input.txt", "sample_output_relpath": "derived/input_output/data/p02657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02657/JavaScript/s023824463.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s023824463", "user_id": "u779749189"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "let multiply (a, b) {\n return a * b;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 39, "cpu_time_ms": 45, "memory_kb": 29940}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s520241984", "group_id": "codeNet:p02657", "input_text": "const rl = require(\"readline\").createInterface(process.stdin,process.stdout);\n\nlet count = 1\nlet inputA, inputB\nrl.on(\"line\", (input) => {\n if (count === 1) {\n inputA = input\n } else {\n inputB = input\n console.log(inputA * inputB)\n process.exit()\n }\n count++\n});\n", "language": "JavaScript", "metadata": {"date": 1590974996, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02657.html", "problem_id": "p02657", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02657/input.txt", "sample_output_relpath": "derived/input_output/data/p02657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02657/JavaScript/s520241984.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s520241984", "user_id": "u538608209"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "const rl = require(\"readline\").createInterface(process.stdin,process.stdout);\n\nlet count = 1\nlet inputA, inputB\nrl.on(\"line\", (input) => {\n if (count === 1) {\n inputA = input\n } else {\n inputB = input\n console.log(inputA * inputB)\n process.exit()\n }\n count++\n});\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 279, "cpu_time_ms": 53, "memory_kb": 30024}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s586612476", "group_id": "codeNet:p02657", "input_text": "function main(input){\n var inp=input.trim();\n var inpArray=inp.split(' ');\n out=parseInt(inpArray[0])*parseInt(inpArray[1]);\n console.log(out);\n \n}\n \n main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1590973580, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02657.html", "problem_id": "p02657", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02657/input.txt", "sample_output_relpath": "derived/input_output/data/p02657/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02657/JavaScript/s586612476.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s586612476", "user_id": "u486205579"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "function main(input){\n var inp=input.trim();\n var inpArray=inp.split(' ');\n out=parseInt(inpArray[0])*parseInt(inpArray[1]);\n console.log(out);\n \n}\n \n main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "sample_input": "2 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02657", "source_text": "Score : 100 points\n\nProblem Statement\n\nCompute A \\times B.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the value A \\times B as an integer.\n\nSample Input 1\n\n2 5\n\nSample Output 1\n\n10\n\nWe have 2 \\times 5 = 10.\n\nSample Input 2\n\n100 100\n\nSample Output 2\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 229, "cpu_time_ms": 49, "memory_kb": 29636}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s936003882", "group_id": "codeNet:p02660", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var ans = 0;\n var set = new Set();\n var N2=N;\n for(var i=2;i parseInt(n, 10));\n var zaseki = new Array(N);\n var nolike = 0;\n for (var x = 0; x < N; x++) {\n zaseki[x] = new Array(N);\n }\n var data = {};\n\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var num = (i - 1) * N + 1 + (j - 1);\n zaseki[i - 1][j - 1] = num;\n data[num] = [i, j];\n }\n }\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var idx = (i - 1) * N + 1 + (j - 1) - 1; //0基準\n var p = PArr[idx]; //座席の番号取得\n var id = data[p][0];\n var jd = data[p][1];\n zaseki[id - 1][jd - 1] = 0;\n\n if (id == 1 || jd == 1 || id == N || jd == N) {\n continue;\n } else {\n var left = 0;\n var right = 0;\n var up = 0;\n var down = 0;\n for (var a = id; a > 0; a--) {\n if (zaseki[a - 1][jd - 1] != 0) left++;\n }\n for (var b = id; b <= N; b++) {\n if (zaseki[b - 1][jd - 1] != 0) right++;\n }\n for (var c = id; c > 0; c--) {\n if (zaseki[id - 1][c - 1] != 0) up++;\n }\n for (var d = id; d <= N; d++) {\n if (zaseki[id - 1][d - 1] != 0) down++;\n }\n }\n nolike += Math.min(left, right, up, down);\n }\n }\n\n console.log(nolike);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1590289500, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02670.html", "problem_id": "p02670", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02670/input.txt", "sample_output_relpath": "derived/input_output/data/p02670/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02670/JavaScript/s395587847.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s395587847", "user_id": "u867200256"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n input = input.trim().split(\"\\n\");\n var N = parseInt(input[0], 10);\n var PArr = input[1].split(\" \").map((n) => parseInt(n, 10));\n var zaseki = new Array(N);\n var nolike = 0;\n for (var x = 0; x < N; x++) {\n zaseki[x] = new Array(N);\n }\n var data = {};\n\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var num = (i - 1) * N + 1 + (j - 1);\n zaseki[i - 1][j - 1] = num;\n data[num] = [i, j];\n }\n }\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var idx = (i - 1) * N + 1 + (j - 1) - 1; //0基準\n var p = PArr[idx]; //座席の番号取得\n var id = data[p][0];\n var jd = data[p][1];\n zaseki[id - 1][jd - 1] = 0;\n\n if (id == 1 || jd == 1 || id == N || jd == N) {\n continue;\n } else {\n var left = 0;\n var right = 0;\n var up = 0;\n var down = 0;\n for (var a = id; a > 0; a--) {\n if (zaseki[a - 1][jd - 1] != 0) left++;\n }\n for (var b = id; b <= N; b++) {\n if (zaseki[b - 1][jd - 1] != 0) right++;\n }\n for (var c = id; c > 0; c--) {\n if (zaseki[id - 1][c - 1] != 0) up++;\n }\n for (var d = id; d <= N; d++) {\n if (zaseki[id - 1][d - 1] != 0) down++;\n }\n }\n nolike += Math.min(left, right, up, down);\n }\n }\n\n console.log(nolike);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema there are N rows with N seats each, forming an N\\times N square. We denote with 1, 2,\\dots, N the viewers in the first row (from left to right); with N+1, \\dots, 2N the viewers in the second row (from left to right); and so on until the last row, whose viewers are denoted by N^2-N+1,\\dots, N^2.\n\nAt the end of the movie, the viewers go out of the cinema in a certain order: the i-th viewer leaving her seat is the one denoted by the number P_i. The viewer P_{i+1} waits until viewer P_i has left the cinema before leaving her seat.\nTo exit from the cinema, a viewer must move from seat to seat until she exits the square of seats (any side of the square is a valid exit). A viewer can move from a seat to one of its 4 adjacent seats (same row or same column).\nWhile leaving the cinema, it might be that a certain viewer x goes through a seat currently occupied by viewer y; in that case viewer y will hate viewer x forever. Each viewer chooses the way that minimizes the number of viewers that will hate her forever.\n\nCompute the number of pairs of viewers (x, y) such that y will hate x forever.\n\nConstraints\n\n2 \\le N \\le 500\n\nThe sequence P_1, P_2, \\dots, P_{N^2} is a permutation of \\{1, 2, \\dots, N^2\\}.\n\nInput\n\nThe input is given from Standard Input in the format\n\nN\nP_1 P_2 \\cdots P_{N^2}\n\nOutput\n\nIf ans is the number of pairs of viewers described in the statement, you should print on Standard Output\n\nans\n\nSample Input 1\n\n3\n1 3 7 9 5 4 8 6 2\n\nSample Output 1\n\n1\n\nBefore the end of the movie, the viewers are arranged in the cinema as follows:\n\n1 2 3\n4 5 6\n7 8 9\n\nThe first four viewers leaving the cinema (1, 3, 7, 9) can leave the cinema without going through any seat, so they will not be hated by anybody.\n\nThen, viewer 5 must go through one of the seats where viewers 2, 4, 6, 8 are currently seated while leaving the cinema; hence he will be hated by at least one of those viewers.\n\nFinally the remaining viewers can leave the cinema (in the order 4, 8, 6, 2) without going through any occupied seat (actually, they can leave the cinema without going through any seat at all).\n\nSample Input 2\n\n4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30\n\nSample Output 3\n\n11", "sample_input": "3\n1 3 7 9 5 4 8 6 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02670", "source_text": "Score : 700 points\n\nProblem Statement\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema there are N rows with N seats each, forming an N\\times N square. We denote with 1, 2,\\dots, N the viewers in the first row (from left to right); with N+1, \\dots, 2N the viewers in the second row (from left to right); and so on until the last row, whose viewers are denoted by N^2-N+1,\\dots, N^2.\n\nAt the end of the movie, the viewers go out of the cinema in a certain order: the i-th viewer leaving her seat is the one denoted by the number P_i. The viewer P_{i+1} waits until viewer P_i has left the cinema before leaving her seat.\nTo exit from the cinema, a viewer must move from seat to seat until she exits the square of seats (any side of the square is a valid exit). A viewer can move from a seat to one of its 4 adjacent seats (same row or same column).\nWhile leaving the cinema, it might be that a certain viewer x goes through a seat currently occupied by viewer y; in that case viewer y will hate viewer x forever. Each viewer chooses the way that minimizes the number of viewers that will hate her forever.\n\nCompute the number of pairs of viewers (x, y) such that y will hate x forever.\n\nConstraints\n\n2 \\le N \\le 500\n\nThe sequence P_1, P_2, \\dots, P_{N^2} is a permutation of \\{1, 2, \\dots, N^2\\}.\n\nInput\n\nThe input is given from Standard Input in the format\n\nN\nP_1 P_2 \\cdots P_{N^2}\n\nOutput\n\nIf ans is the number of pairs of viewers described in the statement, you should print on Standard Output\n\nans\n\nSample Input 1\n\n3\n1 3 7 9 5 4 8 6 2\n\nSample Output 1\n\n1\n\nBefore the end of the movie, the viewers are arranged in the cinema as follows:\n\n1 2 3\n4 5 6\n7 8 9\n\nThe first four viewers leaving the cinema (1, 3, 7, 9) can leave the cinema without going through any seat, so they will not be hated by anybody.\n\nThen, viewer 5 must go through one of the seats where viewers 2, 4, 6, 8 are currently seated while leaving the cinema; hence he will be hated by at least one of those viewers.\n\nFinally the remaining viewers can leave the cinema (in the order 4, 8, 6, 2) without going through any occupied seat (actually, they can leave the cinema without going through any seat at all).\n\nSample Input 2\n\n4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30\n\nSample Output 3\n\n11", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1451, "cpu_time_ms": 1921, "memory_kb": 77800}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s680874921", "group_id": "codeNet:p02670", "input_text": "function Main(input) {\n input = input.trim().split(\"\\n\");\n var N = parseInt(input[0], 10);\n var PArr = input[1].split(\" \").map((n) => parseInt(n, 10));\n var zaseki = new Array(N);\n var nolike = 0;\n for (var x = 0; x < N; x++) {\n zaseki[x] = new Array(N);\n }\n var data = {};\n\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var num = (i - 1) * N + 1 + (j - 1);\n zaseki[i - 1][j - 1] = num;\n data[num] = [i, j];\n }\n }\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var idx = (i - 1) * N + 1 + (j - 1) - 1; //0基準\n var p = PArr[idx]; //座席の番号取得\n var id = data[p][0];\n var jd = data[p][1];\n zaseki[id - 1][jd - 1] = 0;\n\n if (id == 1 || jd == 1 || id == N || jd == N) {\n continue;\n } else {\n var left = 0;\n var right = 0;\n var up = 0;\n var down = 0;\n for (var a = id; a > 0; a--) {\n if (zaseki[a - 1][jd - 1] != 0) left++;\n }\n for (var b = id; b <= N; b++) {\n if (zaseki[b - 1][jd - 1] != 0) right++;\n }\n for (var c = id; c > 0; c--) {\n if (zaseki[id - 1][c - 1] != 0) up++;\n }\n for (var d = id; d <= N; d++) {\n if (zaseki[id - 1][d - 1] != 0) down++;\n }\n nolike += Math.min(left, right, up, down);\n }\n }\n }\n\n console.log(nolike);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1590288847, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02670.html", "problem_id": "p02670", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02670/input.txt", "sample_output_relpath": "derived/input_output/data/p02670/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02670/JavaScript/s680874921.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s680874921", "user_id": "u867200256"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n input = input.trim().split(\"\\n\");\n var N = parseInt(input[0], 10);\n var PArr = input[1].split(\" \").map((n) => parseInt(n, 10));\n var zaseki = new Array(N);\n var nolike = 0;\n for (var x = 0; x < N; x++) {\n zaseki[x] = new Array(N);\n }\n var data = {};\n\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var num = (i - 1) * N + 1 + (j - 1);\n zaseki[i - 1][j - 1] = num;\n data[num] = [i, j];\n }\n }\n for (var i = 1; i <= N; i++) {\n for (var j = 1; j <= N; j++) {\n var idx = (i - 1) * N + 1 + (j - 1) - 1; //0基準\n var p = PArr[idx]; //座席の番号取得\n var id = data[p][0];\n var jd = data[p][1];\n zaseki[id - 1][jd - 1] = 0;\n\n if (id == 1 || jd == 1 || id == N || jd == N) {\n continue;\n } else {\n var left = 0;\n var right = 0;\n var up = 0;\n var down = 0;\n for (var a = id; a > 0; a--) {\n if (zaseki[a - 1][jd - 1] != 0) left++;\n }\n for (var b = id; b <= N; b++) {\n if (zaseki[b - 1][jd - 1] != 0) right++;\n }\n for (var c = id; c > 0; c--) {\n if (zaseki[id - 1][c - 1] != 0) up++;\n }\n for (var d = id; d <= N; d++) {\n if (zaseki[id - 1][d - 1] != 0) down++;\n }\n nolike += Math.min(left, right, up, down);\n }\n }\n }\n\n console.log(nolike);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 700 points\n\nProblem Statement\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema there are N rows with N seats each, forming an N\\times N square. We denote with 1, 2,\\dots, N the viewers in the first row (from left to right); with N+1, \\dots, 2N the viewers in the second row (from left to right); and so on until the last row, whose viewers are denoted by N^2-N+1,\\dots, N^2.\n\nAt the end of the movie, the viewers go out of the cinema in a certain order: the i-th viewer leaving her seat is the one denoted by the number P_i. The viewer P_{i+1} waits until viewer P_i has left the cinema before leaving her seat.\nTo exit from the cinema, a viewer must move from seat to seat until she exits the square of seats (any side of the square is a valid exit). A viewer can move from a seat to one of its 4 adjacent seats (same row or same column).\nWhile leaving the cinema, it might be that a certain viewer x goes through a seat currently occupied by viewer y; in that case viewer y will hate viewer x forever. Each viewer chooses the way that minimizes the number of viewers that will hate her forever.\n\nCompute the number of pairs of viewers (x, y) such that y will hate x forever.\n\nConstraints\n\n2 \\le N \\le 500\n\nThe sequence P_1, P_2, \\dots, P_{N^2} is a permutation of \\{1, 2, \\dots, N^2\\}.\n\nInput\n\nThe input is given from Standard Input in the format\n\nN\nP_1 P_2 \\cdots P_{N^2}\n\nOutput\n\nIf ans is the number of pairs of viewers described in the statement, you should print on Standard Output\n\nans\n\nSample Input 1\n\n3\n1 3 7 9 5 4 8 6 2\n\nSample Output 1\n\n1\n\nBefore the end of the movie, the viewers are arranged in the cinema as follows:\n\n1 2 3\n4 5 6\n7 8 9\n\nThe first four viewers leaving the cinema (1, 3, 7, 9) can leave the cinema without going through any seat, so they will not be hated by anybody.\n\nThen, viewer 5 must go through one of the seats where viewers 2, 4, 6, 8 are currently seated while leaving the cinema; hence he will be hated by at least one of those viewers.\n\nFinally the remaining viewers can leave the cinema (in the order 4, 8, 6, 2) without going through any occupied seat (actually, they can leave the cinema without going through any seat at all).\n\nSample Input 2\n\n4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30\n\nSample Output 3\n\n11", "sample_input": "3\n1 3 7 9 5 4 8 6 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02670", "source_text": "Score : 700 points\n\nProblem Statement\n\nTonight, in your favourite cinema they are giving the movie Joker and all seats are occupied. In the cinema there are N rows with N seats each, forming an N\\times N square. We denote with 1, 2,\\dots, N the viewers in the first row (from left to right); with N+1, \\dots, 2N the viewers in the second row (from left to right); and so on until the last row, whose viewers are denoted by N^2-N+1,\\dots, N^2.\n\nAt the end of the movie, the viewers go out of the cinema in a certain order: the i-th viewer leaving her seat is the one denoted by the number P_i. The viewer P_{i+1} waits until viewer P_i has left the cinema before leaving her seat.\nTo exit from the cinema, a viewer must move from seat to seat until she exits the square of seats (any side of the square is a valid exit). A viewer can move from a seat to one of its 4 adjacent seats (same row or same column).\nWhile leaving the cinema, it might be that a certain viewer x goes through a seat currently occupied by viewer y; in that case viewer y will hate viewer x forever. Each viewer chooses the way that minimizes the number of viewers that will hate her forever.\n\nCompute the number of pairs of viewers (x, y) such that y will hate x forever.\n\nConstraints\n\n2 \\le N \\le 500\n\nThe sequence P_1, P_2, \\dots, P_{N^2} is a permutation of \\{1, 2, \\dots, N^2\\}.\n\nInput\n\nThe input is given from Standard Input in the format\n\nN\nP_1 P_2 \\cdots P_{N^2}\n\nOutput\n\nIf ans is the number of pairs of viewers described in the statement, you should print on Standard Output\n\nans\n\nSample Input 1\n\n3\n1 3 7 9 5 4 8 6 2\n\nSample Output 1\n\n1\n\nBefore the end of the movie, the viewers are arranged in the cinema as follows:\n\n1 2 3\n4 5 6\n7 8 9\n\nThe first four viewers leaving the cinema (1, 3, 7, 9) can leave the cinema without going through any seat, so they will not be hated by anybody.\n\nThen, viewer 5 must go through one of the seats where viewers 2, 4, 6, 8 are currently seated while leaving the cinema; hence he will be hated by at least one of those viewers.\n\nFinally the remaining viewers can leave the cinema (in the order 4, 8, 6, 2) without going through any occupied seat (actually, they can leave the cinema without going through any seat at all).\n\nSample Input 2\n\n4\n6 7 1 4 13 16 10 9 5 11 12 14 15 2 3 8\n\nSample Output 2\n\n3\n\nSample Input 3\n\n6\n11 21 35 22 7 36 27 34 8 20 15 13 16 1 24 3 2 17 26 9 18 32 31 23 19 14 4 25 10 29 28 33 12 6 5 30\n\nSample Output 3\n\n11", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1453, "cpu_time_ms": 1989, "memory_kb": 77756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s844534212", "group_id": "codeNet:p02675", "input_text": "\"use strict\";\n\nconst main = (arg) => {\n const array = arg.trim().split(\"\");\n const lastNumber = array[array.length - 1];\n if (lastNumber == 3) {\n console.log(\"bon\");\n } else if (\n lastNumber == 0 ||\n lastNumber == 1 ||\n lastNumber == 6 ||\n lastNumber == 8\n ) {\n console.log(\"pon\");\n } else {\n console.log(\"hon\");\n }\n};\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// main(\"183\");\n// https://atcoder.jp/contests/abc168/tasks/abc168_a\n", "language": "JavaScript", "metadata": {"date": 1592662144, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02675.html", "problem_id": "p02675", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02675/input.txt", "sample_output_relpath": "derived/input_output/data/p02675/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02675/JavaScript/s844534212.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s844534212", "user_id": "u819348316"}, "prompt_components": {"gold_output": "pon\n", "input_to_evaluate": "\"use strict\";\n\nconst main = (arg) => {\n const array = arg.trim().split(\"\");\n const lastNumber = array[array.length - 1];\n if (lastNumber == 3) {\n console.log(\"bon\");\n } else if (\n lastNumber == 0 ||\n lastNumber == 1 ||\n lastNumber == 6 ||\n lastNumber == 8\n ) {\n console.log(\"pon\");\n } else {\n console.log(\"hon\");\n }\n};\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// main(\"183\");\n// https://atcoder.jp/contests/abc168/tasks/abc168_a\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "sample_input": "16\n"}, "reference_outputs": ["pon\n"], "source_document_id": "p02675", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 472, "cpu_time_ms": 61, "memory_kb": 29500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s629141914", "group_id": "codeNet:p02675", "input_text": "function main(input) {\n const inputs = input.trim().split('\\n');\n var N = inputs[0];\n var N1 = N.slice(-1);\n\n if ('24579'.includes(N1)) {\n console.log('hon');\n } else if ('0168'.includes(N1)) {\n console.log('pon');\n } else {\n console.log('bon');\n }\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1589764293, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02675.html", "problem_id": "p02675", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02675/input.txt", "sample_output_relpath": "derived/input_output/data/p02675/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02675/JavaScript/s629141914.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s629141914", "user_id": "u474579514"}, "prompt_components": {"gold_output": "pon\n", "input_to_evaluate": "function main(input) {\n const inputs = input.trim().split('\\n');\n var N = inputs[0];\n var N1 = N.slice(-1);\n\n if ('24579'.includes(N1)) {\n console.log('hon');\n } else if ('0168'.includes(N1)) {\n console.log('pon');\n } else {\n console.log('bon');\n }\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "sample_input": "16\n"}, "reference_outputs": ["pon\n"], "source_document_id": "p02675", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe cat Snuke wants to play a popular Japanese game called ÅtCoder, so Iroha has decided to teach him Japanese.\n\nWhen counting pencils in Japanese, the counter word \"本\" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation of \"本\" in the phrase \"N 本\" for a positive integer N not exceeding 999 is as follows:\n\nhon when the digit in the one's place of N is 2, 4, 5, 7, or 9;\n\npon when the digit in the one's place of N is 0, 1, 6 or 8;\n\nbon when the digit in the one's place of N is 3.\n\nGiven N, print the pronunciation of \"本\" in the phrase \"N 本\".\n\nConstraints\n\nN is a positive integer not exceeding 999.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n16\n\nSample Output 1\n\npon\n\nThe digit in the one's place of 16 is 6, so the \"本\" in \"16 本\" is pronounced pon.\n\nSample Input 2\n\n2\n\nSample Output 2\n\nhon\n\nSample Input 3\n\n183\n\nSample Output 3\n\nbon", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 324, "cpu_time_ms": 48, "memory_kb": 29640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s166677381", "group_id": "codeNet:p02677", "input_text": "function main(input) {\n\tinput = input.split(\"\\n\");\n \tinput = input[0].split(\" \");\n \tlet a = parseInt(input[0], 10);\n \tlet b = parseInt(input[1], 10);\n \tlet h = parseInt(input[2], 10);\n \tlet m = parseInt(input[3], 10);\n \n\tconsole.log(\n \tMath.sqrt(\n \tMath.pow(a, 2) + Math.pow(b, 2) - 2*a*b*Math.cos(\n Math.PI*Math.abs((5*h - m))/30\n )\n ).toFixed(20)\n );\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1590605126, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02677.html", "problem_id": "p02677", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02677/input.txt", "sample_output_relpath": "derived/input_output/data/p02677/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02677/JavaScript/s166677381.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s166677381", "user_id": "u479580453"}, "prompt_components": {"gold_output": "5.00000000000000000000\n", "input_to_evaluate": "function main(input) {\n\tinput = input.split(\"\\n\");\n \tinput = input[0].split(\" \");\n \tlet a = parseInt(input[0], 10);\n \tlet b = parseInt(input[1], 10);\n \tlet h = parseInt(input[2], 10);\n \tlet m = parseInt(input[3], 10);\n \n\tconsole.log(\n \tMath.sqrt(\n \tMath.pow(a, 2) + Math.pow(b, 2) - 2*a*b*Math.cos(\n Math.PI*Math.abs((5*h - m))/30\n )\n ).toFixed(20)\n );\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "sample_input": "3 4 9 0\n"}, "reference_outputs": ["5.00000000000000000000\n"], "source_document_id": "p02677", "source_text": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 462, "cpu_time_ms": 53, "memory_kb": 29568}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s492711702", "group_id": "codeNet:p02677", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const A = parseInt(arg[0].split(\" \")[0]);\n const B = parseInt(arg[0].split(\" \")[1]);\n const H = parseInt(arg[0].split(\" \")[2]);\n const M = parseInt(arg[0].split(\" \")[3]);\n \n let angleA = (360 / 12) * (H % 12);\n const angleB = (360 / 60) * M;\n angleA += 30 * (M / 60);\n \n const absAB = Math.abs(angleA - angleB);\n const angle = Math.min(absAB, 360 - absAB);\n \n let answer;\n \n answer = (Math.pow(A, 2) + Math.pow(B, 2)) - (2 * A * B) * (Math.cos(angle * (Math.PI / 180)));\n \n //console.log(angle);\n console.log(Math.sqrt(answer));\n // console.log(Math.cos(90))\n //console.log(Math.sqrt(20));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1589771120, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02677.html", "problem_id": "p02677", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02677/input.txt", "sample_output_relpath": "derived/input_output/data/p02677/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02677/JavaScript/s492711702.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s492711702", "user_id": "u598795006"}, "prompt_components": {"gold_output": "5.00000000000000000000\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const A = parseInt(arg[0].split(\" \")[0]);\n const B = parseInt(arg[0].split(\" \")[1]);\n const H = parseInt(arg[0].split(\" \")[2]);\n const M = parseInt(arg[0].split(\" \")[3]);\n \n let angleA = (360 / 12) * (H % 12);\n const angleB = (360 / 60) * M;\n angleA += 30 * (M / 60);\n \n const absAB = Math.abs(angleA - angleB);\n const angle = Math.min(absAB, 360 - absAB);\n \n let answer;\n \n answer = (Math.pow(A, 2) + Math.pow(B, 2)) - (2 * A * B) * (Math.cos(angle * (Math.PI / 180)));\n \n //console.log(angle);\n console.log(Math.sqrt(answer));\n // console.log(Math.cos(90))\n //console.log(Math.sqrt(20));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "sample_input": "3 4 9 0\n"}, "reference_outputs": ["5.00000000000000000000\n"], "source_document_id": "p02677", "source_text": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 783, "cpu_time_ms": 49, "memory_kb": 29812}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s605999575", "group_id": "codeNet:p02677", "input_text": "function main(input) {\n const args = input.split(\"\\n\");\n const [A, B, H, M] = args[0].split(\" \").map((n) => parseInt(n, 10));\n\n const min = H * 60 + M;\n console.log(Math.sqrt(A * A + B * B - (2 * A * B * Math.cos(11 * Math.PI * min / 360))));\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1589766489, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02677.html", "problem_id": "p02677", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02677/input.txt", "sample_output_relpath": "derived/input_output/data/p02677/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02677/JavaScript/s605999575.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s605999575", "user_id": "u475690012"}, "prompt_components": {"gold_output": "5.00000000000000000000\n", "input_to_evaluate": "function main(input) {\n const args = input.split(\"\\n\");\n const [A, B, H, M] = args[0].split(\" \").map((n) => parseInt(n, 10));\n\n const min = H * 60 + M;\n console.log(Math.sqrt(A * A + B * B - (2 * A * B * Math.cos(11 * Math.PI * min / 360))));\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "sample_input": "3 4 9 0\n"}, "reference_outputs": ["5.00000000000000000000\n"], "source_document_id": "p02677", "source_text": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 49, "memory_kb": 29724}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s510858867", "group_id": "codeNet:p02677", "input_text": "let input = require('fs').readFileSync('/dev/stdin', 'utf8').split(' ');\n// let input = '3 4 10 40'.split(' ');\n\nconst a = parseInt(input[0],10);\nconst b = parseInt(input[1],10);\nconst h = parseInt(input[2],10);\nconst m = parseInt(input[3],10);\nconst pi = Math.PI;\n\nconst arga = (h + m/60)*pi/6;\nconst argb = pi * m / 30;\n\nconst c = (a**2 + b**2 - 2*a*b*Math.cos(arga-argb))**0.5;\n\nconsole.log(c);", "language": "JavaScript", "metadata": {"date": 1589765930, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02677.html", "problem_id": "p02677", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02677/input.txt", "sample_output_relpath": "derived/input_output/data/p02677/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02677/JavaScript/s510858867.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s510858867", "user_id": "u320758035"}, "prompt_components": {"gold_output": "5.00000000000000000000\n", "input_to_evaluate": "let input = require('fs').readFileSync('/dev/stdin', 'utf8').split(' ');\n// let input = '3 4 10 40'.split(' ');\n\nconst a = parseInt(input[0],10);\nconst b = parseInt(input[1],10);\nconst h = parseInt(input[2],10);\nconst m = parseInt(input[3],10);\nconst pi = Math.PI;\n\nconst arga = (h + m/60)*pi/6;\nconst argb = pi * m / 30;\n\nconst c = (a**2 + b**2 - 2*a*b*Math.cos(arga-argb))**0.5;\n\nconsole.log(c);", "problem_context": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "sample_input": "3 4 9 0\n"}, "reference_outputs": ["5.00000000000000000000\n"], "source_document_id": "p02677", "source_text": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 397, "cpu_time_ms": 48, "memory_kb": 29772}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s841446977", "group_id": "codeNet:p02677", "input_text": "\"use strict\";\nvar input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nvar cin = input.trim().split(/ |\\n/), cid = 0;\n\nfunction main() {\n let a = +cin.shift();//jisin\n let b = +cin.shift();//hunsin\n let h = +cin.shift();\n let m = +cin.shift();\n let theta = Math.PI * ((h / 6 +m/360) - m / 30);\n let xx = a * a + b * b - 2 * a * b * Math.cos(theta);\n let x = Math.sqrt(xx);\n console.log(x);\n}\nmain();", "language": "JavaScript", "metadata": {"date": 1589765239, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02677.html", "problem_id": "p02677", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02677/input.txt", "sample_output_relpath": "derived/input_output/data/p02677/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02677/JavaScript/s841446977.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s841446977", "user_id": "u499179030"}, "prompt_components": {"gold_output": "5.00000000000000000000\n", "input_to_evaluate": "\"use strict\";\nvar input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nvar cin = input.trim().split(/ |\\n/), cid = 0;\n\nfunction main() {\n let a = +cin.shift();//jisin\n let b = +cin.shift();//hunsin\n let h = +cin.shift();\n let m = +cin.shift();\n let theta = Math.PI * ((h / 6 +m/360) - m / 30);\n let xx = a * a + b * b - 2 * a * b * Math.cos(theta);\n let x = Math.sqrt(xx);\n console.log(x);\n}\nmain();", "problem_context": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "sample_input": "3 4 9 0\n"}, "reference_outputs": ["5.00000000000000000000\n"], "source_document_id": "p02677", "source_text": "Score: 300 points\n\nProblem Statement\n\nConsider an analog clock whose hour and minute hands are A and B centimeters long, respectively.\n\nAn endpoint of the hour hand and an endpoint of the minute hand are fixed at the same point, around which each hand rotates clockwise at constant angular velocity. It takes the hour and minute hands 12 hours and 1 hour to make one full rotation, respectively.\n\nAt 0 o'clock, the two hands overlap each other. H hours and M minutes later, what is the distance in centimeters between the unfixed endpoints of the hands?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 1000\n\n0 \\leq H \\leq 11\n\n0 \\leq M \\leq 59\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B H M\n\nOutput\n\nPrint the answer without units. Your output will be accepted when its absolute or relative error from the correct value is at most 10^{-9}.\n\nSample Input 1\n\n3 4 9 0\n\nSample Output 1\n\n5.00000000000000000000\n\nThe two hands will be in the positions shown in the figure below, so the answer is 5 centimeters.\n\nSample Input 2\n\n3 4 10 40\n\nSample Output 2\n\n4.56425719433005567605\n\nThe two hands will be in the positions shown in the figure below. Note that each hand always rotates at constant angular velocity.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 429, "cpu_time_ms": 45, "memory_kb": 29748}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s985162652", "group_id": "codeNet:p02679", "input_text": "const main = arg => {\n const input = arg.trim().split('\\n');\n const abList = input.slice(1).map(l => l.split(' ').map(x => Number(x)));\n\n console.log(abList.reduce(\n (accumulator, [a, b], index) =>\n 1 + accumulator + abList.slice(index + 1)\n .filter(([aa, bb]) => a !== aa && b !== bb)\n .filter(([aa, bb]) => a * aa + b * bb !== 0).length,\n 0,\n ));\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1589769356, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02679.html", "problem_id": "p02679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02679/input.txt", "sample_output_relpath": "derived/input_output/data/p02679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02679/JavaScript/s985162652.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s985162652", "user_id": "u452847480"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "const main = arg => {\n const input = arg.trim().split('\\n');\n const abList = input.slice(1).map(l => l.split(' ').map(x => Number(x)));\n\n console.log(abList.reduce(\n (accumulator, [a, b], index) =>\n 1 + accumulator + abList.slice(index + 1)\n .filter(([aa, bb]) => a !== aa && b !== bb)\n .filter(([aa, bb]) => a * aa + b * bb !== 0).length,\n 0,\n ));\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "sample_input": "3\n1 2\n-1 1\n2 -1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02679", "source_text": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 438, "cpu_time_ms": 2211, "memory_kb": 171180}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s633846341", "group_id": "codeNet:p02679", "input_text": "const main = arg => {\n const input = arg.trim().split('\\n');\n const abList = input.slice(1).map(l => l.split(' ').map(x => Number(x)));\n\n console.log(abList.reduce(\n (accumulator, [a, b], index) =>\n accumulator + abList.slice(index + 1).filter(([aa, bb]) => a * aa + b * bb !== 0).length + 1,\n 0,\n ));\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1589768938, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02679.html", "problem_id": "p02679", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02679/input.txt", "sample_output_relpath": "derived/input_output/data/p02679/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02679/JavaScript/s633846341.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s633846341", "user_id": "u452847480"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "const main = arg => {\n const input = arg.trim().split('\\n');\n const abList = input.slice(1).map(l => l.split(' ').map(x => Number(x)));\n\n console.log(abList.reduce(\n (accumulator, [a, b], index) =>\n accumulator + abList.slice(index + 1).filter(([aa, bb]) => a * aa + b * bb !== 0).length + 1,\n 0,\n ));\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "sample_input": "3\n1 2\n-1 1\n2 -1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02679", "source_text": "Score: 500 points\n\nProblem Statement\n\nWe have caught N sardines. The deliciousness and fragrantness of the i-th sardine is A_i and B_i, respectively.\n\nWe will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time.\n\nThe i-th and j-th sardines (i \\neq j) are on bad terms if and only if A_i \\cdot A_j + B_i \\cdot B_j = 0.\n\nIn how many ways can we choose the set of sardines to put into the cooler? Since the count can be enormous, print it modulo 1000000007.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n-10^{18} \\leq A_i, B_i \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n:\nA_N B_N\n\nOutput\n\nPrint the count modulo 1000000007.\n\nSample Input 1\n\n3\n1 2\n-1 1\n2 -1\n\nSample Output 1\n\n5\n\nThere are five ways to choose the set of sardines, as follows:\n\nThe 1-st\n\nThe 1-st and 2-nd\n\nThe 2-nd\n\nThe 2-nd and 3-rd\n\nThe 3-rd\n\nSample Input 2\n\n10\n3 2\n3 2\n-1 1\n2 -1\n-3 -9\n-8 12\n7 7\n8 1\n8 2\n8 4\n\nSample Output 2\n\n479", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 377, "cpu_time_ms": 2212, "memory_kb": 171232}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s827072201", "group_id": "codeNet:p02681", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const S = (arg[0].split(\" \")[0]).split(\"\");\n const T = (arg[1].split(\" \")[0]).split(\"\");\n \n T.pop();\n \n console.log(S.join(\"\") === T.join(\"\") ? \"Yes\" : \"No\");\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1589158904, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02681.html", "problem_id": "p02681", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02681/input.txt", "sample_output_relpath": "derived/input_output/data/p02681/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02681/JavaScript/s827072201.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s827072201", "user_id": "u598795006"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const S = (arg[0].split(\" \")[0]).split(\"\");\n const T = (arg[1].split(\" \")[0]).split(\"\");\n \n T.pop();\n \n console.log(S.join(\"\") === T.join(\"\") ? \"Yes\" : \"No\");\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "sample_input": "chokudai\nchokudaiz\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02681", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to be a member of some web service.\n\nHe tried to register himself with the ID S, which turned out to be already used by another user.\n\nThus, he decides to register using a string obtained by appending one character at the end of S as his ID.\n\nHe is now trying to register with the ID T. Determine whether this string satisfies the property above.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\n1 \\leq |S| \\leq 10\n\n|T| = |S| + 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf T satisfies the property in Problem Statement, print Yes; otherwise, print No.\n\nSample Input 1\n\nchokudai\nchokudaiz\n\nSample Output 1\n\nYes\n\nchokudaiz can be obtained by appending z at the end of chokudai.\n\nSample Input 2\n\nsnuke\nsnekee\n\nSample Output 2\n\nNo\n\nsnekee cannot be obtained by appending one character at the end of snuke.\n\nSample Input 3\n\na\naa\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 310, "cpu_time_ms": 45, "memory_kb": 29624}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s823232999", "group_id": "codeNet:p02682", "input_text": "function main(input) {\n\tinput = input.split(\" \");\n\tconst A = input[0];\n\tconst B = input[1];\n\tconst C = input[1];\n\tconst K = input[3];\n\t\n\tif (A+B>=K){\n\t console.log(A);\n\t} else {\n\t console.log(2*A+B-K);\n\t}\n\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "language": "JavaScript", "metadata": {"date": 1589161546, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/JavaScript/s823232999.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s823232999", "user_id": "u702144572"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function main(input) {\n\tinput = input.split(\" \");\n\tconst A = input[0];\n\tconst B = input[1];\n\tconst C = input[1];\n\tconst K = input[3];\n\t\n\tif (A+B>=K){\n\t console.log(A);\n\t} else {\n\t console.log(2*A+B-K);\n\t}\n\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 279, "cpu_time_ms": 49, "memory_kb": 29884}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s357902524", "group_id": "codeNet:p02682", "input_text": "function Main(input) {\n\tvar str = input;\n\tvar ans = 0;\n\tstr = str.split(\"\\n\")[0];\n\tstr = str.split(\" \");\n\tvar a = Number(str[0]);\n\tvar b = Number(str[1]);\n\tvar c = Number(str[2]);\n\tvar k = Number(str[3]);\n\tans = Number(ans);\n\tif (a <= k){\n\tans = ans + a;\n\tk = k - a;\n\tk = k - b;\n\t\tif(k > 0){\n\t\t\tans = ans - k;\n\t\t}\n \t}else{\n \t\tans = a;\n \t}\n\t console.log(ans);\n}\n //*おまじない\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1589161206, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/JavaScript/s357902524.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s357902524", "user_id": "u345348381"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n\tvar str = input;\n\tvar ans = 0;\n\tstr = str.split(\"\\n\")[0];\n\tstr = str.split(\" \");\n\tvar a = Number(str[0]);\n\tvar b = Number(str[1]);\n\tvar c = Number(str[2]);\n\tvar k = Number(str[3]);\n\tans = Number(ans);\n\tif (a <= k){\n\tans = ans + a;\n\tk = k - a;\n\tk = k - b;\n\t\tif(k > 0){\n\t\t\tans = ans - k;\n\t\t}\n \t}else{\n \t\tans = a;\n \t}\n\t console.log(ans);\n}\n //*おまじない\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 445, "cpu_time_ms": 45, "memory_kb": 29860}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s809899283", "group_id": "codeNet:p02682", "input_text": "let input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split(\"\\n\")[0].split(' ').map(i => parseInt(i))\n\nconst A = input[0]\nconst B = input[1]\nconst C = input[2]\n\n// const ABC = [\n// [1, input[0]],\n// [0, input[1]],\n// [-1, input[2]]\n// ]\nconst K = input[3]\n\ncount = 0\nresult = 0\n\nif (K - count - A >= 0) {\n count += A\n result += A * 1\n} else {\n console.log(K)\n return\n}\n\nif (K - count - B >= 0) {\n count += B\n result += B * 0\n} else {\n console.log(result)\n return\n}\n\nresult += (K - count) * (-1)\n\nconsole.log(result)\n", "language": "JavaScript", "metadata": {"date": 1589160923, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02682.html", "problem_id": "p02682", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02682/input.txt", "sample_output_relpath": "derived/input_output/data/p02682/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02682/JavaScript/s809899283.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s809899283", "user_id": "u291625338"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "let input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split(\"\\n\")[0].split(' ').map(i => parseInt(i))\n\nconst A = input[0]\nconst B = input[1]\nconst C = input[2]\n\n// const ABC = [\n// [1, input[0]],\n// [0, input[1]],\n// [-1, input[2]]\n// ]\nconst K = input[3]\n\ncount = 0\nresult = 0\n\nif (K - count - A >= 0) {\n count += A\n result += A * 1\n} else {\n console.log(K)\n return\n}\n\nif (K - count - B >= 0) {\n count += B\n result += B * 0\n} else {\n console.log(result)\n return\n}\n\nresult += (K - count) * (-1)\n\nconsole.log(result)\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "sample_input": "2 1 1 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02682", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s.\n\nWe will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, B, C\n\n1 \\leq K \\leq A + B + C \\leq 2 \\times 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C K\n\nOutput\n\nPrint the maximum possible sum of the numbers written on the cards chosen.\n\nSample Input 1\n\n2 1 1 3\n\nSample Output 1\n\n2\n\nConsider picking up two cards with 1s and one card with a 0.\nIn this case, the sum of the numbers written on the cards is 2, which is the maximum possible value.\n\nSample Input 2\n\n1 2 3 4\n\nSample Output 2\n\n0\n\nSample Input 3\n\n2000000000 0 0 2000000000\n\nSample Output 3\n\n2000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 559, "cpu_time_ms": 45, "memory_kb": 29872}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s270929852", "group_id": "codeNet:p02683", "input_text": "// ABC167 - B\nfunction main(input) {\n var inputs = input.split('\\n');\n var line1 = inputs[0].split(' ');\n var n = parseInt(line1[0], 10);\n var m = parseInt(line1[1], 10);\n var x = parseInt(line1[2], 10);\n\n var c = [];\n var a = [];\n for (var i = 0; i < n; i++) {\n var lineN = inputs[i + 1].split(' ');\n c.push(parseInt(lineN[0], 10));\n a[i] = [];\n for (var j = 1; j < m + 1; j++) {\n a[i].push(parseInt(lineN[j], 10));\n }\n }\n\n var iniAs = [];\n for (var i = 0; i < m; i++) {\n iniAs.push(0);\n }\n\n var maxCost = c.reduce((a, b) => a + b);\n var minCost = maxCost * 1;\n\n var bits = bitComb(n);\n bits.forEach((bit) => {\n var tempCost = 0;\n var tempAs = iniAs.concat();\n bit.forEach((bitItem) => {\n tempCost += c[bitItem];\n tempAs = sumItems(tempAs.concat(), a[bitItem]);\n });\n if (tempAs.every((foo) => foo >= x)) minCost = Math.min(minCost, tempCost);\n });\n\n console.log(minCost != maxCost ? minCost : -1);\n}\n\nfunction bitComb(n) {\n var ret = [];\n for (let bit = 0; bit < (1 << n); bit++) {\n let row = [];\n for (let i = 0; i < n; i++) {\n if (bit & (1 << i)) {\n row.push(i);\n }\n }\n ret.push(row);\n }\n return ret;\n}\n\nfunction sumItems(arr1, arr2) {\n var ret = [];\n for (var i = 0; i < arr1.length; i++) {\n ret.push(arr1[i] + arr2[i]);\n }\n return ret;\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1589164548, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02683.html", "problem_id": "p02683", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02683/input.txt", "sample_output_relpath": "derived/input_output/data/p02683/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02683/JavaScript/s270929852.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s270929852", "user_id": "u474579514"}, "prompt_components": {"gold_output": "120\n", "input_to_evaluate": "// ABC167 - B\nfunction main(input) {\n var inputs = input.split('\\n');\n var line1 = inputs[0].split(' ');\n var n = parseInt(line1[0], 10);\n var m = parseInt(line1[1], 10);\n var x = parseInt(line1[2], 10);\n\n var c = [];\n var a = [];\n for (var i = 0; i < n; i++) {\n var lineN = inputs[i + 1].split(' ');\n c.push(parseInt(lineN[0], 10));\n a[i] = [];\n for (var j = 1; j < m + 1; j++) {\n a[i].push(parseInt(lineN[j], 10));\n }\n }\n\n var iniAs = [];\n for (var i = 0; i < m; i++) {\n iniAs.push(0);\n }\n\n var maxCost = c.reduce((a, b) => a + b);\n var minCost = maxCost * 1;\n\n var bits = bitComb(n);\n bits.forEach((bit) => {\n var tempCost = 0;\n var tempAs = iniAs.concat();\n bit.forEach((bitItem) => {\n tempCost += c[bitItem];\n tempAs = sumItems(tempAs.concat(), a[bitItem]);\n });\n if (tempAs.every((foo) => foo >= x)) minCost = Math.min(minCost, tempCost);\n });\n\n console.log(minCost != maxCost ? minCost : -1);\n}\n\nfunction bitComb(n) {\n var ret = [];\n for (let bit = 0; bit < (1 << n); bit++) {\n let row = [];\n for (let i = 0; i < n; i++) {\n if (bit & (1 << i)) {\n row.push(i);\n }\n }\n ret.push(row);\n }\n return ret;\n}\n\nfunction sumItems(arr1, arr2) {\n var ret = [];\n for (var i = 0; i < arr1.length; i++) {\n ret.push(arr1[i] + arr2[i]);\n }\n return ret;\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "sample_input": "3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n"}, "reference_outputs": ["120\n"], "source_document_id": "p02683", "source_text": "Score : 300 points\n\nProblem\n\nTakahashi, who is a novice in competitive programming, wants to learn M algorithms.\nInitially, his understanding level of each of the M algorithms is 0.\n\nTakahashi is visiting a bookstore, where he finds N books on algorithms.\nThe i-th book (1\\leq i\\leq N) is sold for C_i yen (the currency of Japan). If he buys and reads it, his understanding level of the j-th algorithm will increase by A_{i,j} for each j (1\\leq j\\leq M).\nThere is no other way to increase the understanding levels of the algorithms.\n\nTakahashi's objective is to make his understanding levels of all the M algorithms X or higher. Determine whether this objective is achievable. If it is achievable, find the minimum amount of money needed to achieve it.\n\nConstraints\n\nAll values in input are integers.\n\n1\\leq N, M\\leq 12\n\n1\\leq X\\leq 10^5\n\n1\\leq C_i \\leq 10^5\n\n0\\leq A_{i, j} \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M X\nC_1 A_{1,1} A_{1,2} \\cdots A_{1,M}\nC_2 A_{2,1} A_{2,2} \\cdots A_{2,M}\n\\vdots\nC_N A_{N,1} A_{N,2} \\cdots A_{N,M}\n\nOutput\n\nIf the objective is not achievable, print -1; otherwise, print the minimum amount of money needed to achieve it.\n\nSample Input 1\n\n3 3 10\n60 2 2 4\n70 8 7 9\n50 2 3 9\n\nSample Output 1\n\n120\n\nBuying the second and third books makes his understanding levels of all the algorithms 10 or higher, at the minimum cost possible.\n\nSample Input 2\n\n3 3 10\n100 3 1 4\n100 1 5 9\n100 2 6 5\n\nSample Output 2\n\n-1\n\nBuying all the books is still not enough to make his understanding levels of all the algorithms 10 or higher.\n\nSample Input 3\n\n8 5 22\n100 3 7 5 3 1\n164 4 5 2 7 8\n334 7 2 7 2 9\n234 4 7 2 8 2\n541 5 4 3 3 6\n235 4 8 6 9 7\n394 3 6 1 6 2\n872 8 4 3 7 2\n\nSample Output 3\n\n1067", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1406, "cpu_time_ms": 65, "memory_kb": 36628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s226956100", "group_id": "codeNet:p02686", "input_text": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var NN = \"No\", YY = \"Yes\";\n var n = next();\n var up = [], ud = [], sum = 0, rest = 0;\n for(var i = 0; i < n; i++){\n var mn = 0, last = 0;\n var s = next(1);\n for(var j = 0; j < s.length; j++){\n if(s[j] === \"(\")last++;\n else{\n last--;\n if(last < mn)mn = last;\n }\n }\n sum += last;\n if(mn >= 0)rest += last;\n else if(last <= 0)up.push([-mn+last,last]);\n else ud.push([-mn,last]);\n }\n if(sum)return NN;\n ud.sort((a,b)=>a[0]-b[0]);\n for(var i = 0; i < ud.length; i++){\n if(ud[i][0] > rest)return NN;\n rest += ud[i][1];\n }\n up.sort((a,b)=>b[0]-a[0]);\n for(var i = 0; i < up.length; i++){\n var [mn,last] = up[i];\n if(mn > rest)return NN;\n rest += last;\n }\n return YY;\n}", "language": "JavaScript", "metadata": {"date": 1589197162, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02686.html", "problem_id": "p02686", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02686/input.txt", "sample_output_relpath": "derived/input_output/data/p02686/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02686/JavaScript/s226956100.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s226956100", "user_id": "u643613120"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var NN = \"No\", YY = \"Yes\";\n var n = next();\n var up = [], ud = [], sum = 0, rest = 0;\n for(var i = 0; i < n; i++){\n var mn = 0, last = 0;\n var s = next(1);\n for(var j = 0; j < s.length; j++){\n if(s[j] === \"(\")last++;\n else{\n last--;\n if(last < mn)mn = last;\n }\n }\n sum += last;\n if(mn >= 0)rest += last;\n else if(last <= 0)up.push([-mn+last,last]);\n else ud.push([-mn,last]);\n }\n if(sum)return NN;\n ud.sort((a,b)=>a[0]-b[0]);\n for(var i = 0; i < ud.length; i++){\n if(ud[i][0] > rest)return NN;\n rest += ud[i][1];\n }\n up.sort((a,b)=>b[0]-a[0]);\n for(var i = 0; i < up.length; i++){\n var [mn,last] = up[i];\n if(mn > rest)return NN;\n rest += last;\n }\n return YY;\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "sample_input": "2\n)\n(()\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02686", "source_text": "Score : 600 points\n\nProblem Statement\n\nA bracket sequence is a string that is one of the following:\n\nAn empty string;\n\nThe concatenation of (, A, and ) in this order, for some bracket sequence A ;\n\nThe concatenation of A and B in this order, for some non-empty bracket sequences A and B /\n\nGiven are N strings S_i. Can a bracket sequence be formed by concatenating all the N strings in some order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nThe total length of the strings S_i is at most 10^6.\n\nS_i is a non-empty string consisting of ( and ).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nIf a bracket sequence can be formed by concatenating all the N strings in some order, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n)\n(()\n\nSample Output 1\n\nYes\n\nConcatenating (() and ) in this order forms a bracket sequence.\n\nSample Input 2\n\n2\n)(\n()\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n4\n((()))\n((((((\n))))))\n()()()\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n3\n(((\n)\n)\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1390, "cpu_time_ms": 332, "memory_kb": 126652}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s625952960", "group_id": "codeNet:p02687", "input_text": "const main = input => /^ABC/.test(input) ? \"ARC\" : \"ABC\"; // Implement this function\n \nconsole.log(main(require('fs').readFileSync('/dev/stdin', 'utf8'))); // Common part", "language": "JavaScript", "metadata": {"date": 1589026004, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02687.html", "problem_id": "p02687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02687/input.txt", "sample_output_relpath": "derived/input_output/data/p02687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02687/JavaScript/s625952960.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s625952960", "user_id": "u959036715"}, "prompt_components": {"gold_output": "ARC\n", "input_to_evaluate": "const main = input => /^ABC/.test(input) ? \"ARC\" : \"ABC\"; // Implement this function\n \nconsole.log(main(require('fs').readFileSync('/dev/stdin', 'utf8'))); // Common part", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "sample_input": "ABC\n"}, "reference_outputs": ["ARC\n"], "source_document_id": "p02687", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 170, "cpu_time_ms": 226, "memory_kb": 30100}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s234949811", "group_id": "codeNet:p02687", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var a = input[0];\n if (a === \"ABC\") {\n\tconsole.log(\"ARC\")\n } else {\n\tconsole.log(\"ABC\") \n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));//おまじない", "language": "JavaScript", "metadata": {"date": 1588825530, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02687.html", "problem_id": "p02687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02687/input.txt", "sample_output_relpath": "derived/input_output/data/p02687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02687/JavaScript/s234949811.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s234949811", "user_id": "u225355598"}, "prompt_components": {"gold_output": "ARC\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n var a = input[0];\n if (a === \"ABC\") {\n\tconsole.log(\"ARC\")\n } else {\n\tconsole.log(\"ABC\") \n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));//おまじない", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "sample_input": "ABC\n"}, "reference_outputs": ["ARC\n"], "source_document_id": "p02687", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 223, "cpu_time_ms": 45, "memory_kb": 29472}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s454637968", "group_id": "codeNet:p02687", "input_text": "const Main = (arg) => {\n const elem = arg.split('_')[0];\n if(elem === 'ABC') {\n console.log('ARC')\n } else if (elem === 'ARC') {\n console.log('ABC')\n }\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1588699243, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02687.html", "problem_id": "p02687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02687/input.txt", "sample_output_relpath": "derived/input_output/data/p02687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02687/JavaScript/s454637968.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s454637968", "user_id": "u348070693"}, "prompt_components": {"gold_output": "ARC\n", "input_to_evaluate": "const Main = (arg) => {\n const elem = arg.split('_')[0];\n if(elem === 'ABC') {\n console.log('ARC')\n } else if (elem === 'ARC') {\n console.log('ABC')\n }\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "sample_input": "ABC\n"}, "reference_outputs": ["ARC\n"], "source_document_id": "p02687", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 349, "cpu_time_ms": 270, "memory_kb": 29588}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s022271790", "group_id": "codeNet:p02687", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n  if (input == 'ABC') {\n console.log('ARC');\n } else {\n console.log('ABC');\n }\n\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1588554141, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02687.html", "problem_id": "p02687", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02687/input.txt", "sample_output_relpath": "derived/input_output/data/p02687/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02687/JavaScript/s022271790.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s022271790", "user_id": "u413378154"}, "prompt_components": {"gold_output": "ARC\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n  if (input == 'ABC') {\n console.log('ARC');\n } else {\n console.log('ABC');\n }\n\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "sample_input": "ABC\n"}, "reference_outputs": ["ARC\n"], "source_document_id": "p02687", "source_text": "Score : 100 points\n\nProblem Statement\n\nAtCoder Inc. holds a contest every Saturday.\n\nThere are two types of contests called ABC and ARC, and just one of them is held at a time.\n\nThe company holds these two types of contests alternately: an ARC follows an ABC and vice versa.\n\nGiven a string S representing the type of the contest held last week, print the string representing the type of the contest held this week.\n\nConstraints\n\nS is ABC or ARC.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the string representing the type of the contest held this week.\n\nSample Input 1\n\nABC\n\nSample Output 1\n\nARC\n\nThey held an ABC last week, so they will hold an ARC this week.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 345, "cpu_time_ms": 44, "memory_kb": 29620}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s319176666", "group_id": "codeNet:p02688", "input_text": "const main = input => parseInt(input.split(\" \")[0]) - new Set(input.split(\"\\n\").slice(1).filter((e, i) => i % 2).map(e => e.slice(\" \")).flat()).size; // Implement this function\n\nconsole.log(main(require('fs').readFileSync('/dev/stdin', 'utf8'))); // Common part", "language": "JavaScript", "metadata": {"date": 1589025520, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02688.html", "problem_id": "p02688", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02688/input.txt", "sample_output_relpath": "derived/input_output/data/p02688/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02688/JavaScript/s319176666.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s319176666", "user_id": "u959036715"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "const main = input => parseInt(input.split(\" \")[0]) - new Set(input.split(\"\\n\").slice(1).filter((e, i) => i % 2).map(e => e.slice(\" \")).flat()).size; // Implement this function\n\nconsole.log(main(require('fs').readFileSync('/dev/stdin', 'utf8'))); // Common part", "problem_context": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "sample_input": "3 2\n2\n1 3\n1\n3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02688", "source_text": "Score : 200 points\n\nProblem Statement\n\nN Snukes called Snuke 1, Snuke 2, ..., Snuke N live in a town.\n\nThere are K kinds of snacks sold in this town, called Snack 1, Snack 2, ..., Snack K. The following d_i Snukes have Snack i: Snuke A_{i, 1}, A_{i, 2}, \\cdots, A_{i, {d_i}}.\n\nTakahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq K \\leq 100\n\n1 \\leq d_i \\leq N\n\n1 \\leq A_{i, 1} < \\cdots < A_{i, d_i} \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nd_1\nA_{1, 1} \\cdots A_{1, d_1}\n\\vdots\nd_K\nA_{K, 1} \\cdots A_{K, d_K}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n2\n1 3\n1\n3\n\nSample Output 1\n\n1\n\nSnuke 1 has Snack 1.\n\nSnuke 2 has no snacks.\n\nSnuke 3 has Snack 1 and 2.\n\nThus, there will be one victim: Snuke 2.\n\nSample Input 2\n\n3 3\n1\n3\n1\n3\n1\n3\n\nSample Output 2\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 261, "cpu_time_ms": 226, "memory_kb": 30100}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s909758368", "group_id": "codeNet:p02688", "input_text": "const Main = (input) => {\n ans=''\n const lines = input.split('\\r')\n line0=lines[0].trim().split(\" \")\n N=line0[0]\n K=lines[1]\n a=new Array(N)\n for (i=2;i {\n ans=''\n const lines = input.split('\\r')\n line0=lines[0].trim().split(\" \")\n N=line0[0]\n K=lines[1]\n a=new Array(N)\n for (i=2;i Number(height))\n const routeList = inputList.slice(2)\n\n let list = new Array(n)\n for (let i=0; i Number(height))\n const routeList = inputList.slice(2)\n\n let list = new Array(n)\n for (let i=0; i {\n const inputList = arg.trim().split(\"\\n\");\n // 回答を記述\n const N = parseInt(inputList[0].split(' ')[0]);\n // [高さ, 隣より高いbool]\n const peaks = inputList[1].split(' ').map(ele => parseInt(ele)).map(ele => [ele, true]);\n // 道のリスト(idx >= 2)から隣以下の高さであればboolをfalseにする\n for (let i = 2; i < inputList.length; i++) {\n // idxにするために -1\n const AB = inputList[i].split(' ').map(ele => parseInt(ele) - 1);\n if (peaks[AB[0]][0] <= peaks[AB[1]][0] ) peaks[AB[0]][1] = false;\n if (peaks[AB[0]][0] >= peaks[AB[1]][0] ) peaks[AB[1]][1] = false;\n }\n // 高いbool == true の要素数を出力する\n console.log(peaks.filter(ele => ele[1] == true).length)\n\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1588821883, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/JavaScript/s090718427.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s090718427", "user_id": "u472713288"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n const inputList = arg.trim().split(\"\\n\");\n // 回答を記述\n const N = parseInt(inputList[0].split(' ')[0]);\n // [高さ, 隣より高いbool]\n const peaks = inputList[1].split(' ').map(ele => parseInt(ele)).map(ele => [ele, true]);\n // 道のリスト(idx >= 2)から隣以下の高さであればboolをfalseにする\n for (let i = 2; i < inputList.length; i++) {\n // idxにするために -1\n const AB = inputList[i].split(' ').map(ele => parseInt(ele) - 1);\n if (peaks[AB[0]][0] <= peaks[AB[1]][0] ) peaks[AB[0]][1] = false;\n if (peaks[AB[0]][0] >= peaks[AB[1]][0] ) peaks[AB[1]][1] = false;\n }\n // 高いbool == true の要素数を出力する\n console.log(peaks.filter(ele => ele[1] == true).length)\n\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 836, "cpu_time_ms": 221, "memory_kb": 79036}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s836052957", "group_id": "codeNet:p02689", "input_text": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var [n,m] = nexts(2);\n var h = nexts(n);\n var q = xArray(1,n);\n for(var i = 0; i < m; i++){\n var [a,b] = nexts(2);\n a--,b--;\n if(h[a] >= h[b])q[b] = 0;\n if(h[b] >= h[a])q[a] = 0;\n }\n return q.reduce((a,b)=>a+b);\n}", "language": "JavaScript", "metadata": {"date": 1588556867, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/JavaScript/s836052957.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s836052957", "user_id": "u643613120"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var [n,m] = nexts(2);\n var h = nexts(n);\n var q = xArray(1,n);\n for(var i = 0; i < m; i++){\n var [a,b] = nexts(2);\n a--,b--;\n if(h[a] >= h[b])q[b] = 0;\n if(h[b] >= h[a])q[a] = 0;\n }\n return q.reduce((a,b)=>a+b);\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 879, "cpu_time_ms": 185, "memory_kb": 76076}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s486545689", "group_id": "codeNet:p02689", "input_text": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split(\"\\n\");\n\nconst firstLine = input[0].split(\" \").map((val) => parseInt(val, 10));\n\nconst N = firstLine[0];\nconst M = firstLine[1];\n\nconst heightList = input[1].split(\" \").map((val) => parseInt(val, 10));\nconst goodPlaceList = Array(N).fill(true);\n\nfor (let i = 2; i < M + 2; i++) {\n const path = input[i].split(\" \").map((val) => parseInt(val, 10));\n\n if (heightList[path[0] - 1] <= heightList[path[1] - 1]) {\n goodPlaceList[path[0] - 1] = false;\n }\n\n if (heightList[path[1] - 1] <= heightList[path[0] - 1]) {\n goodPlaceList[path[1] - 1] = false;\n }\n}\n\nconsole.log(goodPlaceList.filter((isGood) => isGood === true).length);\n", "language": "JavaScript", "metadata": {"date": 1588555511, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02689.html", "problem_id": "p02689", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02689/input.txt", "sample_output_relpath": "derived/input_output/data/p02689/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02689/JavaScript/s486545689.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s486545689", "user_id": "u445747215"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split(\"\\n\");\n\nconst firstLine = input[0].split(\" \").map((val) => parseInt(val, 10));\n\nconst N = firstLine[0];\nconst M = firstLine[1];\n\nconst heightList = input[1].split(\" \").map((val) => parseInt(val, 10));\nconst goodPlaceList = Array(N).fill(true);\n\nfor (let i = 2; i < M + 2; i++) {\n const path = input[i].split(\" \").map((val) => parseInt(val, 10));\n\n if (heightList[path[0] - 1] <= heightList[path[1] - 1]) {\n goodPlaceList[path[0] - 1] = false;\n }\n\n if (heightList[path[1] - 1] <= heightList[path[0] - 1]) {\n goodPlaceList[path[1] - 1] = false;\n }\n}\n\nconsole.log(goodPlaceList.filter((isGood) => isGood === true).length);\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "sample_input": "4 3\n1 2 3 4\n1 3\n2 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02689", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i.\nThere are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j.\n\nObs. i is said to be good when its elevation is higher than those of all observatories that can be reached from Obs. i using just one road.\nNote that Obs. i is also good when no observatory can be reached from Obs. i using just one road.\n\nHow many good observatories are there?\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\n1 \\leq A_i,B_i \\leq N\n\nA_i \\neq B_i\n\nMultiple roads may connect the same pair of observatories.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nH_1 H_2 ... H_N\nA_1 B_1\nA_2 B_2\n:\nA_M B_M\n\nOutput\n\nPrint the number of good observatories.\n\nSample Input 1\n\n4 3\n1 2 3 4\n1 3\n2 3\n2 4\n\nSample Output 1\n\n2\n\nFrom Obs. 1, you can reach Obs. 3 using just one road. The elevation of Obs. 1 is not higher than that of Obs. 3, so Obs. 1 is not good.\n\nFrom Obs. 2, you can reach Obs. 3 and 4 using just one road. The elevation of Obs. 2 is not higher than that of Obs. 3, so Obs. 2 is not good.\n\nFrom Obs. 3, you can reach Obs. 1 and 2 using just one road. The elevation of Obs. 3 is higher than those of Obs. 1 and 2, so Obs. 3 is good.\n\nFrom Obs. 4, you can reach Obs. 2 using just one road. The elevation of Obs. 4 is higher than that of Obs. 2, so Obs. 4 is good.\n\nThus, the good observatories are Obs. 3 and 4, so there are two good observatories.\n\nSample Input 2\n\n6 5\n8 6 9 1 2 1\n1 3\n4 2\n4 3\n4 6\n4 6\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 740, "cpu_time_ms": 173, "memory_kb": 62588}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s426198722", "group_id": "codeNet:p02690", "input_text": "\"use strict\";\n\nconst main = arg => {\n const input = arg.trim().split(\"\\n\");\n\n const x = parseInt(input[0]);\n for(let a = -120; a<= 120; a++){\n for(let b = -120; b<= 120; b++){\n let tmp = a*a*a*a*a - b*b*b*b*b\n if(x === tmp){\n console.log(`${a} ${b}`)\n return\n }\n } \n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "language": "JavaScript", "metadata": {"date": 1591498903, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02690.html", "problem_id": "p02690", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02690/input.txt", "sample_output_relpath": "derived/input_output/data/p02690/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02690/JavaScript/s426198722.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s426198722", "user_id": "u267235552"}, "prompt_components": {"gold_output": "2 -1\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n const input = arg.trim().split(\"\\n\");\n\n const x = parseInt(input[0]);\n for(let a = -120; a<= 120; a++){\n for(let b = -120; b<= 120; b++){\n let tmp = a*a*a*a*a - b*b*b*b*b\n if(x === tmp){\n console.log(`${a} ${b}`)\n return\n }\n } \n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "sample_input": "33\n"}, "reference_outputs": ["2 -1\n"], "source_document_id": "p02690", "source_text": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 417, "cpu_time_ms": 49, "memory_kb": 32592}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s546011651", "group_id": "codeNet:p02690", "input_text": "\"use strict\";\nvar input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nvar cin = input.trim().split(/ |\\n/), cid = 0;\n\nfunction main() {\n let X = +cin.shift();\n let s = 0;\n while (s <= 200) {\n for (let a = 0; a <= s; a++) {\n let b = s - a;\n let ma = -a;\n let mb = -b;\n if (a ** 5 - b ** 5 == X) {\n console.log(a, b);\n return;\n }\n if (a ** 5 - mb ** 5 == X) {\n console.log(a, mb);\n return;\n }\n if (ma ** 5 - b ** 5 == X) {\n console.log(ma, b);\n return;\n }\n if (ma ** 5 - mb ** 5 == X) {\n console.log(ma, mb);\n return;\n }\n }\n s++;\n }\n}\nmain();\n", "language": "JavaScript", "metadata": {"date": 1588568110, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02690.html", "problem_id": "p02690", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02690/input.txt", "sample_output_relpath": "derived/input_output/data/p02690/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02690/JavaScript/s546011651.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s546011651", "user_id": "u499179030"}, "prompt_components": {"gold_output": "2 -1\n", "input_to_evaluate": "\"use strict\";\nvar input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nvar cin = input.trim().split(/ |\\n/), cid = 0;\n\nfunction main() {\n let X = +cin.shift();\n let s = 0;\n while (s <= 200) {\n for (let a = 0; a <= s; a++) {\n let b = s - a;\n let ma = -a;\n let mb = -b;\n if (a ** 5 - b ** 5 == X) {\n console.log(a, b);\n return;\n }\n if (a ** 5 - mb ** 5 == X) {\n console.log(a, mb);\n return;\n }\n if (ma ** 5 - b ** 5 == X) {\n console.log(ma, b);\n return;\n }\n if (ma ** 5 - mb ** 5 == X) {\n console.log(ma, mb);\n return;\n }\n }\n s++;\n }\n}\nmain();\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "sample_input": "33\n"}, "reference_outputs": ["2 -1\n"], "source_document_id": "p02690", "source_text": "Score : 400 points\n\nProblem Statement\n\nGive a pair of integers (A, B) such that A^5-B^5 = X.\nIt is guaranteed that there exists such a pair for the given integer X.\n\nConstraints\n\n1 \\leq X \\leq 10^9\n\nX is an integer.\n\nThere exists a pair of integers (A, B) satisfying the condition in Problem Statement.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint A and B, with space in between.\nIf there are multiple pairs of integers (A, B) satisfying the condition, you may print any of them.\n\nA B\n\nSample Input 1\n\n33\n\nSample Output 1\n\n2 -1\n\nFor A=2 and B=-1, A^5-B^5 = 33.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n0 -1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 821, "cpu_time_ms": 57, "memory_kb": 32300}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s406279202", "group_id": "codeNet:p02693", "input_text": "\"use strict\";\n\nfunction main(input) {\n input = input.split(\"\\n\");\n let tmp = input[1].split(\" \");\n let a = tmp[0];\n let b = tmp[1];\n for (a; a <= b; a++) {\n const res = a % input[0];\n if (res === 0) {\n console.log(\"OK\");\n return;\n }\n }\n console.log(\"NG\");\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf-8\"));\n", "language": "JavaScript", "metadata": {"date": 1589415710, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/JavaScript/s406279202.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s406279202", "user_id": "u479559778"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "\"use strict\";\n\nfunction main(input) {\n input = input.split(\"\\n\");\n let tmp = input[1].split(\" \");\n let a = tmp[0];\n let b = tmp[1];\n for (a; a <= b; a++) {\n const res = a % input[0];\n if (res === 0) {\n console.log(\"OK\");\n return;\n }\n }\n console.log(\"NG\");\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf-8\"));\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 342, "cpu_time_ms": 45, "memory_kb": 29572}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s613045040", "group_id": "codeNet:p02693", "input_text": "const Main = input => {\n const inp = input.split(\"\\n\");//[\"K\", \"A B\"]\n const ab = inp[1].split(\" \");//[\"A\", \"B\"]\n const k = parseInt(inp[0], 10);\n const a = parseInt(ab[0], 10);\n const b = parseInt(ab[1], 10);\n\n let result = \"NG\";\n const min = Math.ceil(a / k);\n if(a <= k*min && k*min <= b) result = \"OK\";\n console.log(result);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1588472247, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02693.html", "problem_id": "p02693", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02693/input.txt", "sample_output_relpath": "derived/input_output/data/p02693/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02693/JavaScript/s613045040.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s613045040", "user_id": "u765734095"}, "prompt_components": {"gold_output": "OK\n", "input_to_evaluate": "const Main = input => {\n const inp = input.split(\"\\n\");//[\"K\", \"A B\"]\n const ab = inp[1].split(\" \");//[\"A\", \"B\"]\n const k = parseInt(inp[0], 10);\n const a = parseInt(ab[0], 10);\n const b = parseInt(ab[1], 10);\n\n let result = \"NG\";\n const min = Math.ceil(a / k);\n if(a <= k*min && k*min <= b) result = \"OK\";\n console.log(result);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "sample_input": "7\n500 600\n"}, "reference_outputs": ["OK\n"], "source_document_id": "p02693", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi the Jumbo will practice golf.\n\nHis objective is to get a carry distance that is a multiple of K, while he can only make a carry distance of between A and B (inclusive).\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A \\leq B \\leq 1000\n\n1 \\leq K \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\nA B\n\nOutput\n\nIf he can achieve the objective, print OK; if he cannot, print NG.\n\nSample Input 1\n\n7\n500 600\n\nSample Output 1\n\nOK\n\nAmong the multiples of 7, for example, 567 lies between 500 and 600.\n\nSample Input 2\n\n4\n5 7\n\nSample Output 2\n\nNG\n\nNo multiple of 4 lies between 5 and 7.\n\nSample Input 3\n\n1\n11 11\n\nSample Output 3\n\nOK", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 414, "cpu_time_ms": 45, "memory_kb": 29632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s007104670", "group_id": "codeNet:p02695", "input_text": "\"use strict\";\n\nconst main = arg => {\n const input = arg.trim().split(\"\\n\");\n\n const [N, M, Q] = input[0].split(\" \").map(el => parseInt(el));\n let list = []\n for(let i = 1; i<=Q; i++){\n list.push(input[i].split(\" \").map(el => parseInt(el)))\n }\n let ans = 0\n const dfs = function(parent, sub){\n if(sub.length == N){\n let tmp = 0\n for(let i = 0; i {\n const input = arg.trim().split(\"\\n\");\n\n const [N, M, Q] = input[0].split(\" \").map(el => parseInt(el));\n let list = []\n for(let i = 1; i<=Q; i++){\n list.push(input[i].split(\" \").map(el => parseInt(el)))\n }\n let ans = 0\n const dfs = function(parent, sub){\n if(sub.length == N){\n let tmp = 0\n for(let i = 0; i {\n const n = i.toString(len),\n padStr = \"0\".repeat(comb - n.length);\n return (padStr + n).split(\"\");\n };\n return [...Array(num).keys()].map(makeArr);\n //console.log(getCombArr(3, 2)); // [['0','0'],['0','1'],['0','2'],['1','0'],['1','1'],['1','2'],['2','0'],['2','1'],['2','2']]\n}\nfunction getCombArrNoSame(len = 2, comb = 1) {\n //重複を許さない組み合わせ\n const num = Math.pow(len, comb),\n makeArr = (v, i) => {\n const n = i.toString(len),\n padStr = \"0\".repeat(comb - n.length);\n return (padStr + n).split(\"\");\n };\n const fil = (v, i) => {\n const n = v.toString(len),\n padStr = \"0\".repeat(comb - n.length);\n const arr = (padStr + n).split(\"\").map((n) => parseInt(n, 10));\n var frag = true;\n for (var i = 1; i < arr.length; i++) {\n if (arr[i - 1] > arr[i]) {\n frag = false;\n break;\n }\n }\n return frag;\n };\n return [...Array(num).keys()].filter(fil).map(makeArr);\n //console.log(getCombArrNoSame(3, 2)); // [['0','0'],['0','1'],['0','2'],['1','1'],['1','2'],['2','2']]\n}\n\n// 上記関数を利用しつつ、組み合わせを作成\nfunction getComb(arr = [], comb = 1) {\n const base = getCombArr(arr.length, comb),\n convert = (v) => arr[v],\n makeArr = (comb) => comb.map(convert);\n return base.map(makeArr);\n //console.log(getComb(['a', 'b', 'c'], 2));\n // [ 'a', 'a' ],\n // [ 'a', 'b' ],\n // [ 'a', 'c' ],\n // [ 'b', 'a' ],\n // [ 'b', 'b' ],\n // [ 'b', 'c' ],\n // [ 'c', 'a' ],\n // [ 'c', 'b' ],\n // [ 'c', 'c' ]\n // ]\n}\n// 上記関数を利用しつつ、組み合わせを作成\nfunction getCombNoSame(arr = [], comb = 1) {\n const base = getCombArrNoSame(arr.length, comb),\n convert = (v) => arr[v],\n makeArr = (comb) => comb.map(convert);\n return base.map(makeArr);\n //console.log(getComb(['a', 'b', 'c'], 2));\n // [ 'a', 'a' ],\n // [ 'a', 'b' ],\n // [ 'a', 'c' ],\n // [ 'b', 'b' ],\n // [ 'b', 'c' ],\n // [ 'c', 'c' ]\n // ]\n}\n\nfunction Main(input) {\n input = input.trim().split(\"\\n\");\n const NMQ = input[0].split(\" \");\n var N = parseInt(NMQ[0], 10);\n var M = parseInt(NMQ[1], 10);\n var Q = parseInt(NMQ[2], 10);\n var a = [];\n var b = [];\n var c = [];\n var d = [];\n var aaa = [];\n var max = 0;\n\n for (var i = 0; i < Q; i++) {\n var abcd = input[i + 1].split(\" \");\n a = a.concat(parseInt(abcd[0], 10));\n b = b.concat(parseInt(abcd[1], 10));\n c = c.concat(parseInt(abcd[2], 10));\n d = d.concat(parseInt(abcd[3], 10));\n }\n for (var i = 0; i < M; i++) {\n aaa = aaa.concat(i + 1);\n }\n var comb = getCombNoSame(aaa, N);\n\n for (var i = 0; i < comb.length; i++) {\n var score = 0;\n for (var q = 0; q < Q; q++) {\n if (comb[i][b[q] - 1] - comb[i][a[q] - 1] == c[q]) {\n score += d[q];\n }\n }\n if (score > max) {\n max = score;\n }\n }\n console.log(max);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1589748835, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02695.html", "problem_id": "p02695", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02695/input.txt", "sample_output_relpath": "derived/input_output/data/p02695/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02695/JavaScript/s700926919.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s700926919", "user_id": "u867200256"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "function getCombArr(len = 2, comb = 1) {\n //10進数まで 重複を許す組み合わせ\n const num = Math.pow(len, comb),\n makeArr = (v, i) => {\n const n = i.toString(len),\n padStr = \"0\".repeat(comb - n.length);\n return (padStr + n).split(\"\");\n };\n return [...Array(num).keys()].map(makeArr);\n //console.log(getCombArr(3, 2)); // [['0','0'],['0','1'],['0','2'],['1','0'],['1','1'],['1','2'],['2','0'],['2','1'],['2','2']]\n}\nfunction getCombArrNoSame(len = 2, comb = 1) {\n //重複を許さない組み合わせ\n const num = Math.pow(len, comb),\n makeArr = (v, i) => {\n const n = i.toString(len),\n padStr = \"0\".repeat(comb - n.length);\n return (padStr + n).split(\"\");\n };\n const fil = (v, i) => {\n const n = v.toString(len),\n padStr = \"0\".repeat(comb - n.length);\n const arr = (padStr + n).split(\"\").map((n) => parseInt(n, 10));\n var frag = true;\n for (var i = 1; i < arr.length; i++) {\n if (arr[i - 1] > arr[i]) {\n frag = false;\n break;\n }\n }\n return frag;\n };\n return [...Array(num).keys()].filter(fil).map(makeArr);\n //console.log(getCombArrNoSame(3, 2)); // [['0','0'],['0','1'],['0','2'],['1','1'],['1','2'],['2','2']]\n}\n\n// 上記関数を利用しつつ、組み合わせを作成\nfunction getComb(arr = [], comb = 1) {\n const base = getCombArr(arr.length, comb),\n convert = (v) => arr[v],\n makeArr = (comb) => comb.map(convert);\n return base.map(makeArr);\n //console.log(getComb(['a', 'b', 'c'], 2));\n // [ 'a', 'a' ],\n // [ 'a', 'b' ],\n // [ 'a', 'c' ],\n // [ 'b', 'a' ],\n // [ 'b', 'b' ],\n // [ 'b', 'c' ],\n // [ 'c', 'a' ],\n // [ 'c', 'b' ],\n // [ 'c', 'c' ]\n // ]\n}\n// 上記関数を利用しつつ、組み合わせを作成\nfunction getCombNoSame(arr = [], comb = 1) {\n const base = getCombArrNoSame(arr.length, comb),\n convert = (v) => arr[v],\n makeArr = (comb) => comb.map(convert);\n return base.map(makeArr);\n //console.log(getComb(['a', 'b', 'c'], 2));\n // [ 'a', 'a' ],\n // [ 'a', 'b' ],\n // [ 'a', 'c' ],\n // [ 'b', 'b' ],\n // [ 'b', 'c' ],\n // [ 'c', 'c' ]\n // ]\n}\n\nfunction Main(input) {\n input = input.trim().split(\"\\n\");\n const NMQ = input[0].split(\" \");\n var N = parseInt(NMQ[0], 10);\n var M = parseInt(NMQ[1], 10);\n var Q = parseInt(NMQ[2], 10);\n var a = [];\n var b = [];\n var c = [];\n var d = [];\n var aaa = [];\n var max = 0;\n\n for (var i = 0; i < Q; i++) {\n var abcd = input[i + 1].split(\" \");\n a = a.concat(parseInt(abcd[0], 10));\n b = b.concat(parseInt(abcd[1], 10));\n c = c.concat(parseInt(abcd[2], 10));\n d = d.concat(parseInt(abcd[3], 10));\n }\n for (var i = 0; i < M; i++) {\n aaa = aaa.concat(i + 1);\n }\n var comb = getCombNoSame(aaa, N);\n\n for (var i = 0; i < comb.length; i++) {\n var score = 0;\n for (var q = 0; q < Q; q++) {\n if (comb[i][b[q] - 1] - comb[i][a[q] - 1] == c[q]) {\n score += d[q];\n }\n }\n if (score > max) {\n max = score;\n }\n }\n console.log(max);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "sample_input": "3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n"}, "reference_outputs": ["110\n"], "source_document_id": "p02695", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven are positive integers N, M, Q, and Q quadruples of integers ( a_i , b_i , c_i , d_i ).\n\nConsider a sequence A satisfying the following conditions:\n\nA is a sequence of N positive integers.\n\n1 \\leq A_1 \\leq A_2 \\le \\cdots \\leq A_N \\leq M.\n\nLet us define a score of this sequence as follows:\n\nThe score is the sum of d_i over all indices i such that A_{b_i} - A_{a_i} = c_i. (If there is no such i, the score is 0.)\n\nFind the maximum possible score of A.\n\nConstraints\n\nAll values in input are integers.\n\n2 ≤ N ≤ 10\n\n1 \\leq M \\leq 10\n\n1 \\leq Q \\leq 50\n\n1 \\leq a_i < b_i \\leq N ( i = 1, 2, ..., Q )\n\n0 \\leq c_i \\leq M - 1 ( i = 1, 2, ..., Q )\n\n(a_i, b_i, c_i) \\neq (a_j, b_j, c_j) (where i \\neq j)\n\n1 \\leq d_i \\leq 10^5 ( i = 1, 2, ..., Q )\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M Q\na_1 b_1 c_1 d_1\n:\na_Q b_Q c_Q d_Q\n\nOutput\n\nPrint the maximum possible score of A.\n\nSample Input 1\n\n3 4 3\n1 3 3 100\n1 2 2 10\n2 3 2 10\n\nSample Output 1\n\n110\n\nWhen A = \\{1, 3, 4\\}, its score is 110. Under these conditions, no sequence has a score greater than 110, so the answer is 110.\n\nSample Input 2\n\n4 6 10\n2 4 1 86568\n1 4 0 90629\n2 3 0 90310\n3 4 1 29211\n3 4 3 78537\n3 4 2 8580\n1 2 1 96263\n1 4 2 2156\n1 2 0 94325\n1 4 3 94328\n\nSample Output 2\n\n357500\n\nSample Input 3\n\n10 10 1\n1 10 9 1\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3135, "cpu_time_ms": 2224, "memory_kb": 667540}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s504555418", "group_id": "codeNet:p02696", "input_text": "const Main = (input) => {\n const tmp = input.trim().split(' ').map(n => parseInt(n))\n const A = tmp[0]\n const B = tmp[1]\n const N = tmp[2]\n\n let x = Math.min(B - 1, N)\n\n const result = Math.floor(A * x / B) - (A * Math.floor(x / B))\n\n console.log(result)\n return result\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1588551793, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/JavaScript/s504555418.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s504555418", "user_id": "u471854610"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "const Main = (input) => {\n const tmp = input.trim().split(' ').map(n => parseInt(n))\n const A = tmp[0]\n const B = tmp[1]\n const N = tmp[2]\n\n let x = Math.min(B - 1, N)\n\n const result = Math.floor(A * x / B) - (A * Math.floor(x / B))\n\n console.log(result)\n return result\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 336, "cpu_time_ms": 49, "memory_kb": 29500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s610644730", "group_id": "codeNet:p02696", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const A = parseInt(arg[0].split(\" \")[0]);\n const B = parseInt(arg[0].split(\" \")[1]);\n const N = parseInt(arg[0].split(\" \")[2]);\n \n // for(let i=1; i<=N; i++) {\n // let temp = Math.floor((A * i) / B) - (A * Math.floor(i / B));\n // console.log(temp)\n // }\n \n let answer = -10e5;\n \n // 0が2回出た時点でループ\n if(A < B) {\n let cnt = 0;\n \n for(let i=1; i<=N; i++) {\n let temp = Math.floor((A * i) / B) - (A * Math.floor(i / B));\n \n answer = Math.max(answer, temp);\n \n if(temp === 0) cnt++;\n if(cnt === 2) break;\n }\n } else {\n // 0が初めて出た時点でループ\n for(let i=1; i<=N; i++) {\n let temp = Math.floor((A * i) / B) - (A * Math.floor(i / B));\n \n answer = Math.max(answer, temp);\n \n if(temp === 0) break;\n }\n }\n \n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1588473489, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/JavaScript/s610644730.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s610644730", "user_id": "u598795006"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const A = parseInt(arg[0].split(\" \")[0]);\n const B = parseInt(arg[0].split(\" \")[1]);\n const N = parseInt(arg[0].split(\" \")[2]);\n \n // for(let i=1; i<=N; i++) {\n // let temp = Math.floor((A * i) / B) - (A * Math.floor(i / B));\n // console.log(temp)\n // }\n \n let answer = -10e5;\n \n // 0が2回出た時点でループ\n if(A < B) {\n let cnt = 0;\n \n for(let i=1; i<=N; i++) {\n let temp = Math.floor((A * i) / B) - (A * Math.floor(i / B));\n \n answer = Math.max(answer, temp);\n \n if(temp === 0) cnt++;\n if(cnt === 2) break;\n }\n } else {\n // 0が初めて出た時点でループ\n for(let i=1; i<=N; i++) {\n let temp = Math.floor((A * i) / B) - (A * Math.floor(i / B));\n \n answer = Math.max(answer, temp);\n \n if(temp === 0) break;\n }\n }\n \n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1113, "cpu_time_ms": 49, "memory_kb": 30332}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s809781814", "group_id": "codeNet:p02696", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\tvar ans = 0\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.trim().split(\"\\n\")\n\t// var arr = input.trim().split(\"\\n\")\n\tvar n = input[0].split(' ').map(n => parseInt(n))\n\tvar A = n[0]\n\tvar B = n[1]\n\tvar N = n[2]\n\tvar cnt = N\n\tvar p = 0\n\twhile ( 0 < cnt) {\n\t\tvar t = Math.floor(A * cnt / B) - A * Math.floor(cnt / B)\n\t\tif (ans < t ) {\n\t\t\tans = t\n\t\t\tbreak\n\t\t} else if (t === 0 ) {\n\t\t\tp++\n\t\t\tif (p > 30) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tcnt--\n\t}\n\n\t//出力\n\tconsole.log(ans)\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// Main(require('fs').readFileSync('./input.txt', 'utf-8'));", "language": "JavaScript", "metadata": {"date": 1588473052, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/JavaScript/s809781814.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s809781814", "user_id": "u795511254"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\tvar ans = 0\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.trim().split(\"\\n\")\n\t// var arr = input.trim().split(\"\\n\")\n\tvar n = input[0].split(' ').map(n => parseInt(n))\n\tvar A = n[0]\n\tvar B = n[1]\n\tvar N = n[2]\n\tvar cnt = N\n\tvar p = 0\n\twhile ( 0 < cnt) {\n\t\tvar t = Math.floor(A * cnt / B) - A * Math.floor(cnt / B)\n\t\tif (ans < t ) {\n\t\t\tans = t\n\t\t\tbreak\n\t\t} else if (t === 0 ) {\n\t\t\tp++\n\t\t\tif (p > 30) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tcnt--\n\t}\n\n\t//出力\n\tconsole.log(ans)\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// Main(require('fs').readFileSync('./input.txt', 'utf-8'));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 797, "cpu_time_ms": 44, "memory_kb": 29620}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s500613231", "group_id": "codeNet:p02696", "input_text": "function main(input) {\n const parsedInput = parser(input);\n console.log(minX(parsedInput.a, parsedInput.b, parsedInput.n));\n}\n\nfunction parser(inputStr) {\n const splitInput = inputStr.split(' ');\n return {\n a: Number(splitInput[0]),\n b: Number(splitInput[1]),\n n: Number(splitInput[2]),\n };\n}\n\nfunction minX(a, b, n) {\n const results = [];\n for (var x = 1; x <= n; x++ ){\n results.push(Math.floor((a * x) / b) - a * Math.floor(x / b));\n }\n return Math.max(...results);\n}\n// test\n// const Q1 = '5 7 4'\n// const Q2 = '11 10 9';\n// main(Q1);\n// main(Q2);\n// main(Q2);\n// main(Q3);\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1588473019, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02696.html", "problem_id": "p02696", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02696/input.txt", "sample_output_relpath": "derived/input_output/data/p02696/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02696/JavaScript/s500613231.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s500613231", "user_id": "u850671763"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function main(input) {\n const parsedInput = parser(input);\n console.log(minX(parsedInput.a, parsedInput.b, parsedInput.n));\n}\n\nfunction parser(inputStr) {\n const splitInput = inputStr.split(' ');\n return {\n a: Number(splitInput[0]),\n b: Number(splitInput[1]),\n n: Number(splitInput[2]),\n };\n}\n\nfunction minX(a, b, n) {\n const results = [];\n for (var x = 1; x <= n; x++ ){\n results.push(Math.floor((a * x) / b) - a * Math.floor(x / b));\n }\n return Math.max(...results);\n}\n// test\n// const Q1 = '5 7 4'\n// const Q2 = '11 10 9';\n// main(Q1);\n// main(Q2);\n// main(Q2);\n// main(Q3);\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "sample_input": "5 7 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02696", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are integers A, B, and N.\n\nFind the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N.\n\nHere floor(t) denotes the greatest integer not greater than the real number t.\n\nConstraints\n\n1 ≤ A ≤ 10^{6}\n\n1 ≤ B ≤ 10^{12}\n\n1 ≤ N ≤ 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B N\n\nOutput\n\nPrint the maximum possible value of floor(Ax/B) - A × floor(x/B) for a non-negative integer x not greater than N, as an integer.\n\nSample Input 1\n\n5 7 4\n\nSample Output 1\n\n2\n\nWhen x=3, floor(Ax/B)-A×floor(x/B) = floor(15/7) - 5×floor(3/7) = 2. This is the maximum value possible.\n\nSample Input 2\n\n11 10 9\n\nSample Output 2\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 689, "cpu_time_ms": 2251, "memory_kb": 1795568}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s543410941", "group_id": "codeNet:p02697", "input_text": "function Scanner(input) {\n\tvar self = this;\n\tself.itemNo = 0;\n\tself.orgStr = input;\n\tself.splitedStrs = (function(target) {\n\t\tvar result = [];\n\t\tvar target = target.replace(/[\\n \\t]+/g, \" \");\n\t\tvar strs = target.split(\" \");\n\t\tfor (var i = 0, len = strs.length; i < len; i++) {\n\t\t\tresult.push(strs[i]);\n\t\t}\n\t\treturn result;\n\t}(input));\n\n\tself.next = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? result : null;\n\t}\n\n\tself.nextInt = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? parseInt(result) : null;\n\t}\n\n\tself.nextBigDecimal = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? parseFloat(result) : null;\n\t}\n\t\n\tself.nextByte = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? new Int8Array(result) : null;\n\t}\n\n}\n\nfunction Main(sc) {\n\n\tvar N = sc.nextInt();\n\tvar M = sc.nextInt();\n\tvar anss = [];\n\t\n\tif (N == M * 2 + 1) {\n\t\tfor (var i = 0; i < M; i++) {\n\t\t\tvar ans = (Math.floor(N / 2) - i) + \" \" + (Math.floor(N / 2) + i + 1);\n\t\t\tanss.push(ans);\n\t\t}\n\t} else {\n\t\tfor (var i = 0; i < M; i++) {\n\t\t\tvar start = 0;\n\t\t\tvar skip = 0;\n\t\t\tif (i % 2 == 0) {\n\t\t\t\tstart = parseInt(i / 2);\n\t\t\t\tskip = M - i;\n\t\t\t} else {\n\t\t\t\tstart = parseInt(i / 2) + parseInt(N / 2) + 1;\n\t\t\t\tskip = M - i;\n\t\t\t}\n\t\t\tvar ans = start + \" \" + (start + skip);\n\t\t\tanss.push(ans);\n\t\t}\n\t}\n\t\n\tconsole.log(anss.join(\"\\n\"));\n}\nMain(new Scanner(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")));\n// Main(new Scanner(\"33\"));\n\n// var str1 = sc.next(); // Stringで取得\n// var int1 = sc.nextInt(); // intで取得\n// var bd1 = sc.nextBigDecimal(); // BigDecimalで取得\n// var byte1 = sc.nextByte(); // byteで取得\n// for (var i = 0; i < 1000000000; i++) var toDelay = \"aaa\"; // 1000msくらいの遅延\n", "language": "JavaScript", "metadata": {"date": 1588734293, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02697.html", "problem_id": "p02697", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02697/input.txt", "sample_output_relpath": "derived/input_output/data/p02697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02697/JavaScript/s543410941.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s543410941", "user_id": "u840920983"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "function Scanner(input) {\n\tvar self = this;\n\tself.itemNo = 0;\n\tself.orgStr = input;\n\tself.splitedStrs = (function(target) {\n\t\tvar result = [];\n\t\tvar target = target.replace(/[\\n \\t]+/g, \" \");\n\t\tvar strs = target.split(\" \");\n\t\tfor (var i = 0, len = strs.length; i < len; i++) {\n\t\t\tresult.push(strs[i]);\n\t\t}\n\t\treturn result;\n\t}(input));\n\n\tself.next = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? result : null;\n\t}\n\n\tself.nextInt = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? parseInt(result) : null;\n\t}\n\n\tself.nextBigDecimal = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? parseFloat(result) : null;\n\t}\n\t\n\tself.nextByte = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? new Int8Array(result) : null;\n\t}\n\n}\n\nfunction Main(sc) {\n\n\tvar N = sc.nextInt();\n\tvar M = sc.nextInt();\n\tvar anss = [];\n\t\n\tif (N == M * 2 + 1) {\n\t\tfor (var i = 0; i < M; i++) {\n\t\t\tvar ans = (Math.floor(N / 2) - i) + \" \" + (Math.floor(N / 2) + i + 1);\n\t\t\tanss.push(ans);\n\t\t}\n\t} else {\n\t\tfor (var i = 0; i < M; i++) {\n\t\t\tvar start = 0;\n\t\t\tvar skip = 0;\n\t\t\tif (i % 2 == 0) {\n\t\t\t\tstart = parseInt(i / 2);\n\t\t\t\tskip = M - i;\n\t\t\t} else {\n\t\t\t\tstart = parseInt(i / 2) + parseInt(N / 2) + 1;\n\t\t\t\tskip = M - i;\n\t\t\t}\n\t\t\tvar ans = start + \" \" + (start + skip);\n\t\t\tanss.push(ans);\n\t\t}\n\t}\n\t\n\tconsole.log(anss.join(\"\\n\"));\n}\nMain(new Scanner(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")));\n// Main(new Scanner(\"33\"));\n\n// var str1 = sc.next(); // Stringで取得\n// var int1 = sc.nextInt(); // intで取得\n// var bd1 = sc.nextBigDecimal(); // BigDecimalで取得\n// var byte1 = sc.nextByte(); // byteで取得\n// for (var i = 0; i < 1000000000; i++) var toDelay = \"aaa\"; // 1000msくらいの遅延\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "sample_input": "4 1\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02697", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1889, "cpu_time_ms": 97, "memory_kb": 47836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s234597029", "group_id": "codeNet:p02697", "input_text": "const processData = (lines) => {\n let [n, m] = lines[0].split(' ').map(x => +x)\n if (n%2 === 1) {\n let end = n - 1\n let start = 1\n while (m) {\n console.log(`${start++} ${end--}`)\n m--\n }\n } else {\n let end = n/2+1\n let start = n/2\n while (m) {\n console.log(`${start--} ${end++}`)\n m--\n }\n }\n}\n\nlet i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n processData(lines)\n})\n", "language": "JavaScript", "metadata": {"date": 1588619171, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02697.html", "problem_id": "p02697", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02697/input.txt", "sample_output_relpath": "derived/input_output/data/p02697/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02697/JavaScript/s234597029.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s234597029", "user_id": "u268857806"}, "prompt_components": {"gold_output": "2 3\n", "input_to_evaluate": "const processData = (lines) => {\n let [n, m] = lines[0].split(' ').map(x => +x)\n if (n%2 === 1) {\n let end = n - 1\n let start = 1\n while (m) {\n console.log(`${start++} ${end--}`)\n m--\n }\n } else {\n let end = n/2+1\n let start = n/2\n while (m) {\n console.log(`${start--} ${end++}`)\n m--\n }\n }\n}\n\nlet i = ''\nprocess.stdin.on('data', c => i += c)\nprocess.stdin.on('end', () => {\n const {EOL} = require('os')\n const lines = i.split(EOL) /*your input text, split by lines*/\n processData(lines)\n})\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "sample_input": "4 1\n"}, "reference_outputs": ["2 3\n"], "source_document_id": "p02697", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are going to hold a competition of one-to-one game called AtCoder Janken. (Janken is the Japanese name for Rock-paper-scissors.)\nN players will participate in this competition, and they are given distinct integers from 1 through N.\nThe arena has M playing fields for two players. You need to assign each playing field two distinct integers between 1 and N (inclusive).\nYou cannot assign the same integer to multiple playing fields.\nThe competition consists of N rounds, each of which proceeds as follows:\n\nFor each player, if there is a playing field that is assigned the player's integer, the player goes to that field and fight the other player who comes there.\n\nThen, each player adds 1 to its integer. If it becomes N+1, change it to 1.\n\nYou want to ensure that no player fights the same opponent more than once during the N rounds.\nPrint an assignment of integers to the playing fields satisfying this condition.\nIt can be proved that such an assignment always exists under the constraints given.\n\nConstraints\n\n1 \\leq M\n\nM \\times 2 +1 \\leq N \\leq 200000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint M lines in the format below.\nThe i-th line should contain the two integers a_i and b_i assigned to the i-th playing field.\n\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nSample Input 1\n\n4 1\n\nSample Output 1\n\n2 3\n\nLet us call the four players A, B, C, and D, and assume that they are initially given the integers 1, 2, 3, and 4, respectively.\n\nThe 1-st round is fought by B and C, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 2, 3, 4, and 1, respectively.\n\nThe 2-nd round is fought by A and B, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 3, 4, 1, and 2, respectively.\n\nThe 3-rd round is fought by D and A, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 4, 1, 2, and 3, respectively.\n\nThe 4-th round is fought by C and D, who has the integers 2 and 3, respectively. After this round, A, B, C, and D have the integers 1, 2, 3, and 4, respectively.\n\nNo player fights the same opponent more than once during the four rounds, so this solution will be accepted.\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n1 6\n2 5\n3 4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 542, "cpu_time_ms": 389, "memory_kb": 41564}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s005778903", "group_id": "codeNet:p02698", "input_text": "function Scanner(input) {\n\tvar self = this;\n\tself.itemNo = 0;\n\tself.orgStr = input;\n\tself.splitedStrs = (function(target) {\n\t\tvar result = [];\n\t\tvar target = target.replace(/[\\n \\t]+/g, \" \");\n\t\tvar strs = target.split(\" \");\n\t\tfor (var i = 0, len = strs.length; i < len; i++) {\n\t\t\tresult.push(strs[i]);\n\t\t}\n\t\treturn result;\n\t}(input));\n\n\tself.next = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? result : null;\n\t}\n\n\tself.nextInt = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? parseInt(result) : null;\n\t}\n\n\tself.nextBigDecimal = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? parseFloat(result) : null;\n\t}\n\t\n\tself.nextByte = function() {\n\t\tvar result = self.splitedStrs[self.itemNo];\n\t\tself.itemNo++;\n\t\treturn (result != null) ? new Int8Array(result) : null;\n\t}\n\n}\n\nfunction Main(sc) {\n\n\tvar N = sc.nextInt();\n\tvar anss = [];\n\t\n\twrtnObj = {};\n\tfor (var i = 0; i < N; i++) {\n\t\twrtnObj[i + 1] = sc.nextInt();\n\t}\n\t\n\torderedSubTree = {};\n\tfor (var i = 0; i < N - 1; i++) {\n\t\tvar n1 = sc.nextInt();\n\t\tvar n2 = sc.nextInt();\n\t\tif (!orderedSubTree[n1]) orderedSubTree[n1] = [n2];\n\t\telse orderedSubTree[n1].push(n2);\n\t\tif (!orderedSubTree[n2]) orderedSubTree[n2] = [n1];\n\t\telse orderedSubTree[n2].push(n1);\n\t}\n\t\n\t// 木をたどって要素を順に取得していく\n\twrtnNoLists = {};\n\tnexts = [];\n\tcrawlNode = function (tgtNo, fromNo) {\n\t\twrtnNos = (wrtnNoLists[fromNo]) ? wrtnNoLists[fromNo].concat() : [];\n\t\t// 自分の数字を詰め込んで、確定\n\t\twrtnNos.push(wrtnObj[tgtNo]);\n\t\twrtnNoLists[tgtNo] = wrtnNos;\n\t\tvar directionObj = orderedSubTree[tgtNo];\n\t\tif (directionObj) {\n\t\t\tfor (var i = 0; i < directionObj.length; i++) {\n\t\t\t\tvar nextNo = directionObj[i];\n\t\t\t\tif (fromNo != nextNo) {\n\t\t\t\t\tnexts.push([nextNo, tgtNo]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tnexts.push([1, -1]);\n\tfor (var dbg = 0; dbg < 10000000; dbg++) {\n\t\tvar next = nexts.shift();\n\t\tcrawlNode(next[0], next[1]);\n\t\tif (nexts.length == 0) break;\n\t}\n\tconsole.log(wrtnNos);\n\treturn;\n\t\n\tfor (var i = 1; i <= N; i++) {\n\t\t\n\t\tvar list = wrtnNoLists[i];\n\t\tvar list2 = [];\n\n\t\tfor (var j = 0; j < list.length; j++) {\n\t\t\tvar wk = list[j];\n\t\t\tif (list2.length == 0) {\n\t\t\t\tlist2.push(wk);\n\t\t\t}\n\t\t\t// 最終より大きい場合push\n\t\t\telse if (wk > list2[list2.length - 1]) {\n\t\t\t\tlist2.push(wk);\n\t\t\t}\n\t\t\t// 最初より同じか小さい場合\n\t\t\telse if (wk <= list2[0]) {\n\t\t\t\tlist2[0] = wk;\n\t\t\t}\n\t\t\t// 最初より大きくて最終より小さい場合、l[i-1] list2[list2.length - 1]) {\n\t\t\t\tlist2.push(wk);\n\t\t\t}\n\t\t\t// 最初より同じか小さい場合\n\t\t\telse if (wk <= list2[0]) {\n\t\t\t\tlist2[0] = wk;\n\t\t\t}\n\t\t\t// 最初より大きくて最終より小さい場合、l[i-1]=S) console.log(\"unsafe\");\n else console.log(\"safe\");\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1591042563, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/JavaScript/s641119506.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s641119506", "user_id": "u089230684"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "\"use strict\";\nfunction main(input) {\n var line = input.split(\" \");\n let S = parseInt(line[0]);\n let W = parseInt(line[1]);\n if(W>=S) console.log(\"unsafe\");\n else console.log(\"safe\");\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 255, "cpu_time_ms": 48, "memory_kb": 29452}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s227433241", "group_id": "codeNet:p02699", "input_text": "const main = (input) => {\n const args = input.split(' ');\n const s = parseInt(args[0], 10);\n const w = parseInt(args[1], 10);\n\n if (s > w) {\n console.log('safe');\n } else {\n console.log('unsafe');\n }\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1589245818, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/JavaScript/s227433241.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s227433241", "user_id": "u474297428"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "const main = (input) => {\n const args = input.split(' ');\n const s = parseInt(args[0], 10);\n const w = parseInt(args[1], 10);\n\n if (s > w) {\n console.log('safe');\n } else {\n console.log('unsafe');\n }\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 271, "memory_kb": 30164}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s116990159", "group_id": "codeNet:p02699", "input_text": "const main = input => {\n const i = input.split(\" \").map(e => parseInt(e))\n const s = i[0]\n const w = i[1]\n return s <= w ? \"unsafe\" : \"safe\"\n}\n\nconsole.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1589133206, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/JavaScript/s116990159.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s116990159", "user_id": "u959036715"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "const main = input => {\n const i = input.split(\" \").map(e => parseInt(e))\n const s = i[0]\n const w = i[1]\n return s <= w ? \"unsafe\" : \"safe\"\n}\n\nconsole.log(main(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 216, "cpu_time_ms": 45, "memory_kb": 29608}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s222307726", "group_id": "codeNet:p02699", "input_text": "function Main(input) {\n input = input.split(' ');\n const sheeps = parseInt(input[0]);\n const wolves = parseInt(input[1]);\n console.log('%s', sheeps > wolves ? 'safe' : 'unsafe');\n}\n \n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1588557410, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/JavaScript/s222307726.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s222307726", "user_id": "u516087870"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "function Main(input) {\n input = input.split(' ');\n const sheeps = parseInt(input[0]);\n const wolves = parseInt(input[1]);\n console.log('%s', sheeps > wolves ? 'safe' : 'unsafe');\n}\n \n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 370, "cpu_time_ms": 48, "memory_kb": 29620}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s849389136", "group_id": "codeNet:p02699", "input_text": "var obj = init();\nMain();\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");}\nfunction init(){\n var inputFile = myin();\n var returnObj = {\n \"list\" : inputFile, \"index\" : 0, \"max\" : inputFile.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){if(!this.hasNext()){throw \"ArrayIndexOutOfBoundsException これ以上ないよ\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var one = nextIntArray();\n\tif(one[0] <= one[1]){\n\t\tmyout(\"unsafe\");\n\t}else{\n\t\tmyout(\"safe\");\n\t}\n}", "language": "JavaScript", "metadata": {"date": 1587949274, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02699.html", "problem_id": "p02699", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02699/input.txt", "sample_output_relpath": "derived/input_output/data/p02699/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02699/JavaScript/s849389136.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s849389136", "user_id": "u222822036"}, "prompt_components": {"gold_output": "unsafe\n", "input_to_evaluate": "var obj = init();\nMain();\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");}\nfunction init(){\n var inputFile = myin();\n var returnObj = {\n \"list\" : inputFile, \"index\" : 0, \"max\" : inputFile.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){if(!this.hasNext()){throw \"ArrayIndexOutOfBoundsException これ以上ないよ\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var one = nextIntArray();\n\tif(one[0] <= one[1]){\n\t\tmyout(\"unsafe\");\n\t}else{\n\t\tmyout(\"safe\");\n\t}\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "sample_input": "4 5\n"}, "reference_outputs": ["unsafe\n"], "source_document_id": "p02699", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are S sheep and W wolves.\n\nIf the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nConstraints\n\n1 \\leq S \\leq 100\n\n1 \\leq W \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS W\n\nOutput\n\nIf the wolves will attack the sheep, print unsafe; otherwise, print safe.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\nunsafe\n\nThere are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.\n\nSample Input 2\n\n100 2\n\nSample Output 2\n\nsafe\n\nMany a sheep drive away two wolves.\n\nSample Input 3\n\n10 10\n\nSample Output 3\n\nunsafe", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1710, "cpu_time_ms": 48, "memory_kb": 29632}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s152960559", "group_id": "codeNet:p02701", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n \n input.splice(0, 1);\n \n input = new Set(input);\n input = Array.from(input);\n console.log(input.length);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1587954247, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02701.html", "problem_id": "p02701", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02701/input.txt", "sample_output_relpath": "derived/input_output/data/p02701/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02701/JavaScript/s152960559.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s152960559", "user_id": "u370134461"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n \n input.splice(0, 1);\n \n input = new Set(input);\n input = Array.from(input);\n console.log(input.length);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint the number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "sample_input": "3\napple\norange\napple\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02701", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint the number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 236, "cpu_time_ms": 117, "memory_kb": 56184}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s813524213", "group_id": "codeNet:p02701", "input_text": "function main(input) {\n const lines = input.split(\"\\n\");\n const N = lines[0];\n\n const items = {}\n for(let i = 1; i <= N; i++) {\n const name = lines[i];\n items[name] = 1;\n }\n const res = Object.keys(items).length;\n\n console.log(res);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1587952500, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02701.html", "problem_id": "p02701", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02701/input.txt", "sample_output_relpath": "derived/input_output/data/p02701/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02701/JavaScript/s813524213.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s813524213", "user_id": "u686930335"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function main(input) {\n const lines = input.split(\"\\n\");\n const N = lines[0];\n\n const items = {}\n for(let i = 1; i <= N; i++) {\n const name = lines[i];\n items[name] = 1;\n }\n const res = Object.keys(items).length;\n\n console.log(res);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint the number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "sample_input": "3\napple\norange\napple\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02701", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou drew lottery N times. In the i-th draw, you got an item of the kind represented by a string S_i.\n\nHow many kinds of items did you get?\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS_i consists of lowercase English letters and has a length between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint the number of kinds of items you got.\n\nSample Input 1\n\n3\napple\norange\napple\n\nSample Output 1\n\n2\n\nYou got two kinds of items: apple and orange.\n\nSample Input 2\n\n5\ngrape\ngrape\ngrape\ngrape\ngrape\n\nSample Output 2\n\n1\n\nSample Input 3\n\n4\naaaa\na\naaa\naa\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 304, "cpu_time_ms": 241, "memory_kb": 83300}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s745589983", "group_id": "codeNet:p02706", "input_text": "/**\n * @param {String} raw_input 入力\n */\nfunction Main(raw_input) {\n\tconst [ first, ...trail ] = raw_input.split(\"\\n\");\n\tconst [n, m] = toNumArray(first);\n\tconst aList = toNumArray(trail[0]);\n\n\tconsole.log(Math.max(-1, n - sum(aList)));\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n////////// ユーティリティ関数\n\n/**\n * 文字列を数値配列\n * @param {String} str 文字列\n */\nfunction toNumArray(str, delimitor = ' ') {\n\treturn str.split(delimitor).map(s => parseInt(s, 10));\n}\n\n/**\n * 文字列をVigInt配列に変換する\n * @param {String} str 文字列\n */\nfunction toBitIntArray(str, delimitor = ' ') {\n\treturn str.split(delimitor).map(s => BigInt(s));\n}\n\n/**\n * 合計を出す\n * @param {Array} n 数値配列\n */\nfunction sum(n) {\n\treturn n.reduce((a, b) => a + b);\n}", "language": "JavaScript", "metadata": {"date": 1598336625, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02706.html", "problem_id": "p02706", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02706/input.txt", "sample_output_relpath": "derived/input_output/data/p02706/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02706/JavaScript/s745589983.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s745589983", "user_id": "u146684408"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "/**\n * @param {String} raw_input 入力\n */\nfunction Main(raw_input) {\n\tconst [ first, ...trail ] = raw_input.split(\"\\n\");\n\tconst [n, m] = toNumArray(first);\n\tconst aList = toNumArray(trail[0]);\n\n\tconsole.log(Math.max(-1, n - sum(aList)));\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n////////// ユーティリティ関数\n\n/**\n * 文字列を数値配列\n * @param {String} str 文字列\n */\nfunction toNumArray(str, delimitor = ' ') {\n\treturn str.split(delimitor).map(s => parseInt(s, 10));\n}\n\n/**\n * 文字列をVigInt配列に変換する\n * @param {String} str 文字列\n */\nfunction toBitIntArray(str, delimitor = ' ') {\n\treturn str.split(delimitor).map(s => BigInt(s));\n}\n\n/**\n * 合計を出す\n * @param {Array} n 数値配列\n */\nfunction sum(n) {\n\treturn n.reduce((a, b) => a + b);\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "sample_input": "41 2\n5 6\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02706", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 946, "cpu_time_ms": 222, "memory_kb": 30600}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s412849329", "group_id": "codeNet:p02706", "input_text": "function main(input) {\n const args = input.split('\\n')\n const nm = args[0].split(' ')\n const n = Number(nm[0])\n const m = Number(nm[1])\n const works = args[1].split(' ').map(v => Number(v))\n const sum = works.reduce((prev, curr) => prev + curr)\n if (n < sum) {\n console.log(-1)\n } else {\n console.log(n - sum)\n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))", "language": "JavaScript", "metadata": {"date": 1589753250, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02706.html", "problem_id": "p02706", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02706/input.txt", "sample_output_relpath": "derived/input_output/data/p02706/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02706/JavaScript/s412849329.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s412849329", "user_id": "u474297428"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "function main(input) {\n const args = input.split('\\n')\n const nm = args[0].split(' ')\n const n = Number(nm[0])\n const m = Number(nm[1])\n const works = args[1].split(' ').map(v => Number(v))\n const sum = works.reduce((prev, curr) => prev + curr)\n if (n < sum) {\n console.log(-1)\n } else {\n console.log(n - sum)\n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "sample_input": "41 2\n5 6\n"}, "reference_outputs": ["30\n"], "source_document_id": "p02706", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has N days of summer vacation.\n\nHis teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.\n\nHe cannot do multiple assignments on the same day, or hang out on a day he does an assignment.\n\nWhat is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?\n\nIf Takahashi cannot finish all the assignments during the vacation, print -1 instead.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\n1 \\leq M \\leq 10^4\n\n1 \\leq A_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 ... A_M\n\nOutput\n\nPrint the maximum number of days Takahashi can hang out during the vacation, or -1.\n\nSample Input 1\n\n41 2\n5 6\n\nSample Output 1\n\n30\n\nFor example, he can do the first assignment on the first 5 days, hang out on the next 30 days, and do the second assignment on the last 6 days of the vacation. In this way, he can safely spend 30 days hanging out.\n\nSample Input 2\n\n10 2\n5 6\n\nSample Output 2\n\n-1\n\nHe cannot finish his assignments.\n\nSample Input 3\n\n11 2\n5 6\n\nSample Output 3\n\n0\n\nHe can finish his assignments, but he will have no time to hang out.\n\nSample Input 4\n\n314 15\n9 26 5 35 8 9 79 3 23 8 46 2 6 43 3\n\nSample Output 4\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 384, "cpu_time_ms": 49, "memory_kb": 30692}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s247683940", "group_id": "codeNet:p02707", "input_text": "function compareNumber(a, b) {\n return Number(a) < Number(b);\n}\n\nfunction Main(input) {\n var lines = input.split('\\n');\n var N = Number(lines[0]);\n var A = lines[1].split(' ');\n A.sort(compareNumber);\n var index = 0;\n var count;\n for (var i = 1; i <= N; i ++) {\n count = 0;\n while (Number(A[index]) == i && index < N) {\n index ++;\n count ++;\n }\n console.log(count);\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1587347723, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02707.html", "problem_id": "p02707", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02707/input.txt", "sample_output_relpath": "derived/input_output/data/p02707/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02707/JavaScript/s247683940.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s247683940", "user_id": "u953863592"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\n", "input_to_evaluate": "function compareNumber(a, b) {\n return Number(a) < Number(b);\n}\n\nfunction Main(input) {\n var lines = input.split('\\n');\n var N = Number(lines[0]);\n var A = lines[1].split(' ');\n A.sort(compareNumber);\n var index = 0;\n var count;\n for (var i = 1; i <= N; i ++) {\n count = 0;\n while (Number(A[index]) == i && index < N) {\n index ++;\n count ++;\n }\n console.log(count);\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "sample_input": "5\n1 1 2 2\n"}, "reference_outputs": ["2\n2\n0\n0\n0\n"], "source_document_id": "p02707", "source_text": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 461, "cpu_time_ms": 741, "memory_kb": 58832}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s083022065", "group_id": "codeNet:p02707", "input_text": "'use strict';\nconst p = s => console.log(s);\n\n// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n input = input.split(\"\\n\");\n let N = input[0].split(\" \")[0];\n let A = input[1].split(\" \");\n let map = new Map();\n\n for(let i =0; i < N; i++) {\n map[i+1] = 0;\n }\n for(let i =0; i < A.length; i++) {\n map[A[i]]++;\n }\n\n for(let i =0; i < N; i++) {\n p(map[i + 1]);\n }\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1587346186, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02707.html", "problem_id": "p02707", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02707/input.txt", "sample_output_relpath": "derived/input_output/data/p02707/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02707/JavaScript/s083022065.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s083022065", "user_id": "u662414183"}, "prompt_components": {"gold_output": "2\n2\n0\n0\n0\n", "input_to_evaluate": "'use strict';\nconst p = s => console.log(s);\n\n// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n input = input.split(\"\\n\");\n let N = input[0].split(\" \")[0];\n let A = input[1].split(\" \");\n let map = new Map();\n\n for(let i =0; i < N; i++) {\n map[i+1] = 0;\n }\n for(let i =0; i < A.length; i++) {\n map[A[i]]++;\n }\n\n for(let i =0; i < N; i++) {\n p(map[i + 1]);\n }\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "sample_input": "5\n1 1 2 2\n"}, "reference_outputs": ["2\n2\n0\n0\n0\n"], "source_document_id": "p02707", "source_text": "Score : 300 points\n\nProblem Statement\n\nA company has N members, who are assigned ID numbers 1, ..., N.\n\nEvery member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.\n\nWhen a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.\n\nYou are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.\n\nConstraints\n\n2 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i < i\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_2 ... A_N\n\nOutput\n\nFor each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.\n\nSample Input 1\n\n5\n1 1 2 2\n\nSample Output 1\n\n2\n2\n0\n0\n0\n\nThe member numbered 1 has two immediate subordinates: the members numbered 2 and 3.\n\nThe member numbered 2 has two immediate subordinates: the members numbered 4 and 5.\n\nThe members numbered 3, 4, and 5 do not have immediate subordinates.\n\nSample Input 2\n\n10\n1 1 1 1 1 1 1 1 1\n\nSample Output 2\n\n9\n0\n0\n0\n0\n0\n0\n0\n0\n0\n\nSample Input 3\n\n7\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n1\n1\n1\n1\n1\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 638, "cpu_time_ms": 753, "memory_kb": 62092}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s587483236", "group_id": "codeNet:p02708", "input_text": "function main(input) {\n let n,k = 0;\n [n, k] = input[0].trim().split(\" \").map(i => parseInt(i));\n\n let sum = 0;\n\n function sum1toN(n) {\n return n*(n+1)/2;\n }\n\n for(let i=k;i<=n+1;i++){\n const min = sum1toN(i-1);\n const max = sum1toN(n) - sum1toN(n-i);\n sum = (sum+(max-min+1))%(10**9+7);\n }\n console.log(sum);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split(\"\\n\"));", "language": "JavaScript", "metadata": {"date": 1587355718, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02708.html", "problem_id": "p02708", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02708/input.txt", "sample_output_relpath": "derived/input_output/data/p02708/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02708/JavaScript/s587483236.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s587483236", "user_id": "u084498522"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "function main(input) {\n let n,k = 0;\n [n, k] = input[0].trim().split(\" \").map(i => parseInt(i));\n\n let sum = 0;\n\n function sum1toN(n) {\n return n*(n+1)/2;\n }\n\n for(let i=k;i<=n+1;i++){\n const min = sum1toN(i-1);\n const max = sum1toN(n) - sum1toN(n-i);\n sum = (sum+(max-min+1))%(10**9+7);\n }\n console.log(sum);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split(\"\\n\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "sample_input": "3 2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02708", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 408, "cpu_time_ms": 53, "memory_kb": 33192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s938631672", "group_id": "codeNet:p02708", "input_text": "\"use strict\"\nfunction main(arg) {\n var tmp = arg.trim().split(\"\\n\")[0].split(\" \").map(Number)\n var N = tmp[0]\n var K = tmp[1]\n var counter = 0\n for (let i = K; i <= N + 1; i++) {\n var min = 0\n var max = 0\n for (var j = 0; j < i; j++) {\n min+=j\n }\n for (var j = N; j > N - i; j--) {\n max+=j\n }\n counter += (max-min) + 1\n }\n console.log(counter)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1587348189, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02708.html", "problem_id": "p02708", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02708/input.txt", "sample_output_relpath": "derived/input_output/data/p02708/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02708/JavaScript/s938631672.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s938631672", "user_id": "u063969814"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "\"use strict\"\nfunction main(arg) {\n var tmp = arg.trim().split(\"\\n\")[0].split(\" \").map(Number)\n var N = tmp[0]\n var K = tmp[1]\n var counter = 0\n for (let i = K; i <= N + 1; i++) {\n var min = 0\n var max = 0\n for (var j = 0; j < i; j++) {\n min+=j\n }\n for (var j = N; j > N - i; j--) {\n max+=j\n }\n counter += (max-min) + 1\n }\n console.log(counter)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "sample_input": "3 2\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02708", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.\n\nWe will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq K \\leq N+1\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of possible values of the sum, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n10\n\nThe sum can take 10 values, as follows:\n\n(10^{100})+(10^{100}+1)=2\\times 10^{100}+1\n\n(10^{100})+(10^{100}+2)=2\\times 10^{100}+2\n\n(10^{100})+(10^{100}+3)=(10^{100}+1)+(10^{100}+2)=2\\times 10^{100}+3\n\n(10^{100}+1)+(10^{100}+3)=2\\times 10^{100}+4\n\n(10^{100}+2)+(10^{100}+3)=2\\times 10^{100}+5\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)=3\\times 10^{100}+3\n\n(10^{100})+(10^{100}+1)+(10^{100}+3)=3\\times 10^{100}+4\n\n(10^{100})+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+5\n\n(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=3\\times 10^{100}+6\n\n(10^{100})+(10^{100}+1)+(10^{100}+2)+(10^{100}+3)=4\\times 10^{100}+6\n\nSample Input 2\n\n200000 200001\n\nSample Output 2\n\n1\n\nWe must choose all of the integers, so the sum can take just 1 value.\n\nSample Input 3\n\n141421 35623\n\nSample Output 3\n\n220280457", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 493, "cpu_time_ms": 2206, "memory_kb": 33180}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s027451255", "group_id": "codeNet:p02709", "input_text": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var n = next();\n var a = [];\n for(var i = 0; i < n; i++){\n a.push([next(),i]);\n }\n a.sort((a,b)=>b[0]-a[0]);\n var dp = xArray(0,n+1);\n for(var i = 0; i < n; i++){\n dp[i+1] = dp[i] + (n-i-a[i][1]-1) * a[i][0];\n for(var j = i; j; j--){\n dp[j] += (a[i][1]-(i-j)) * a[i][0];\n var t = dp[j-1] + (n-j-a[i][1]) * a[i][0];\n if(dp[j] < t)dp[j] = t;\n }\n dp[0] += (a[i][1]-i) * a[i][0];\n }\n return Math.max(...dp);\n}", "language": "JavaScript", "metadata": {"date": 1587920886, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02709.html", "problem_id": "p02709", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02709/input.txt", "sample_output_relpath": "derived/input_output/data/p02709/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02709/JavaScript/s027451255.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s027451255", "user_id": "u643613120"}, "prompt_components": {"gold_output": "20\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var n = next();\n var a = [];\n for(var i = 0; i < n; i++){\n a.push([next(),i]);\n }\n a.sort((a,b)=>b[0]-a[0]);\n var dp = xArray(0,n+1);\n for(var i = 0; i < n; i++){\n dp[i+1] = dp[i] + (n-i-a[i][1]-1) * a[i][0];\n for(var j = i; j; j--){\n dp[j] += (a[i][1]-(i-j)) * a[i][0];\n var t = dp[j-1] + (n-j-a[i][1]) * a[i][0];\n if(dp[j] < t)dp[j] = t;\n }\n dp[0] += (a[i][1]-i) * a[i][0];\n }\n return Math.max(...dp);\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N children standing in a line from left to right. The activeness of the i-th child from the left is A_i.\n\nYou can rearrange these children just one time in any order you like.\n\nWhen a child who originally occupies the x-th position from the left in the line moves to the y-th position from the left, that child earns A_x \\times |x-y| happiness points.\n\nFind the maximum total happiness points the children can earn.\n\nConstraints\n\n2 \\leq N \\leq 2000\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum total happiness points the children can earn.\n\nSample Input 1\n\n4\n1 3 4 2\n\nSample Output 1\n\n20\n\nIf we move the 1-st child from the left to the 3-rd position from the left, the 2-nd child to the 4-th position, the 3-rd child to the 1-st position, and the 4-th child to the 2-nd position, the children earns 1 \\times |1-3|+3 \\times |2-4|+4 \\times |3-1|+2 \\times |4-2|=20 happiness points in total.\n\nSample Input 2\n\n6\n5 5 6 1 1 1\n\nSample Output 2\n\n58\n\nSample Input 3\n\n6\n8 6 9 1 2 1\n\nSample Output 3\n\n85", "sample_input": "4\n1 3 4 2\n"}, "reference_outputs": ["20\n"], "source_document_id": "p02709", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N children standing in a line from left to right. The activeness of the i-th child from the left is A_i.\n\nYou can rearrange these children just one time in any order you like.\n\nWhen a child who originally occupies the x-th position from the left in the line moves to the y-th position from the left, that child earns A_x \\times |x-y| happiness points.\n\nFind the maximum total happiness points the children can earn.\n\nConstraints\n\n2 \\leq N \\leq 2000\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum total happiness points the children can earn.\n\nSample Input 1\n\n4\n1 3 4 2\n\nSample Output 1\n\n20\n\nIf we move the 1-st child from the left to the 3-rd position from the left, the 2-nd child to the 4-th position, the 3-rd child to the 1-st position, and the 4-th child to the 2-nd position, the children earns 1 \\times |1-3|+3 \\times |2-4|+4 \\times |3-1|+2 \\times |4-2|=20 happiness points in total.\n\nSample Input 2\n\n6\n5 5 6 1 1 1\n\nSample Output 2\n\n58\n\nSample Input 3\n\n6\n8 6 9 1 2 1\n\nSample Output 3\n\n85", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1092, "cpu_time_ms": 65, "memory_kb": 33588}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s603908224", "group_id": "codeNet:p02712", "input_text": "function Main(input) {\n let sum = 0;\n for(let i = 0; i < parseInt(input) + 1; i++) {\n if(i % 3 !== 0 && i % 5 !== 0) {\n sum += i;\n }\n }\n console.log(sum);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1586752890, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02712/input.txt", "sample_output_relpath": "derived/input_output/data/p02712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02712/JavaScript/s603908224.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s603908224", "user_id": "u387870994"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "function Main(input) {\n let sum = 0;\n for(let i = 0; i < parseInt(input) + 1; i++) {\n if(i % 3 !== 0 && i % 5 !== 0) {\n sum += i;\n }\n }\n console.log(sum);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "sample_input": "15\n"}, "reference_outputs": ["60\n"], "source_document_id": "p02712", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 355, "cpu_time_ms": 116, "memory_kb": 35244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s419837754", "group_id": "codeNet:p02712", "input_text": "function Main(input) {\n let sum = 0;\n\n for(let i = 0; i < parseInt(input) + 1; i++) {\n if(i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n console.log(sum);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1586752800, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02712/input.txt", "sample_output_relpath": "derived/input_output/data/p02712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02712/JavaScript/s419837754.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s419837754", "user_id": "u387870994"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "function Main(input) {\n let sum = 0;\n\n for(let i = 0; i < parseInt(input) + 1; i++) {\n if(i % 3 === 0 || i % 5 === 0) {\n sum += i;\n }\n }\n console.log(sum);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "sample_input": "15\n"}, "reference_outputs": ["60\n"], "source_document_id": "p02712", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 356, "cpu_time_ms": 116, "memory_kb": 35152}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s586212913", "group_id": "codeNet:p02712", "input_text": "// B ***\n\n// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n inputs = input.split(\"\\n\");\n \n const N = Number(inputs[0]);\n const arr = [];\n for( let i = 1 ; i <= N ; i++ ){\n if( i % 3 !== 0 && i % 5 !== 0){\n arr.push(i);\n }\n }\n\n const sum = arr.reduce( (prev,current) => {\n return BigInt(prev) + BigInt(current);\n });\n\n console.log(`${sum}`);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1586740344, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02712.html", "problem_id": "p02712", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02712/input.txt", "sample_output_relpath": "derived/input_output/data/p02712/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02712/JavaScript/s586212913.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s586212913", "user_id": "u183308534"}, "prompt_components": {"gold_output": "60\n", "input_to_evaluate": "// B ***\n\n// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n inputs = input.split(\"\\n\");\n \n const N = Number(inputs[0]);\n const arr = [];\n for( let i = 1 ; i <= N ; i++ ){\n if( i % 3 !== 0 && i % 5 !== 0){\n arr.push(i);\n }\n }\n\n const sum = arr.reduce( (prev,current) => {\n return BigInt(prev) + BigInt(current);\n });\n\n console.log(`${sum}`);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "sample_input": "15\n"}, "reference_outputs": ["60\n"], "source_document_id": "p02712", "source_text": "Score : 200 points\n\nProblem Statement\n\nLet us define the FizzBuzz sequence a_1,a_2,... as follows:\n\nIf both 3 and 5 divides i, a_i=\\mbox{FizzBuzz}.\n\nIf the above does not hold but 3 divides i, a_i=\\mbox{Fizz}.\n\nIf none of the above holds but 5 divides i, a_i=\\mbox{Buzz}.\n\nIf none of the above holds, a_i=i.\n\nFind the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the sum of all numbers among the first N terms of the FizzBuzz sequence.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n60\n\nThe first 15 terms of the FizzBuzz sequence are:\n\n1,2,\\mbox{Fizz},4,\\mbox{Buzz},\\mbox{Fizz},7,8,\\mbox{Fizz},\\mbox{Buzz},11,\\mbox{Fizz},13,14,\\mbox{FizzBuzz}\n\nAmong them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.\n\nSample Input 2\n\n1000000\n\nSample Output 2\n\n266666333332\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 623, "cpu_time_ms": 113, "memory_kb": 60040}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s538478730", "group_id": "codeNet:p02715", "input_text": "\n\"use strict\";\n\nconst main = arg => {\n var count = 0\n const input = arg.trim().split(\"\\n\");\n const N = parseInt(input[0].split(\" \")[0]);\n const K = parseInt(input[0].split(\" \")[1]);\n\n var a = K;\n for (var s = 1;s<=N;s++){\n a *= K;\n }\n console.log(a);\n\n\n for(var i = 1;i <= a;i++){\n for(var j = 1;j <= a;j++){\n for(var k = 1;k <= a;k++){\n count+=gcd(i,j,k); \n }\n }\n }\n console.log(count/10000000007);\n}\n \nfunction gcd() {\n var f = (a, b) => b ? f(b, a % b) : a\n var ans = arguments[0]\n for (var i = 1; i < arguments.length; i++) {\n ans = f(ans, arguments[i]); \n }\n return ans \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1586745324, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02715.html", "problem_id": "p02715", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02715/input.txt", "sample_output_relpath": "derived/input_output/data/p02715/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02715/JavaScript/s538478730.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s538478730", "user_id": "u848025660"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "\n\"use strict\";\n\nconst main = arg => {\n var count = 0\n const input = arg.trim().split(\"\\n\");\n const N = parseInt(input[0].split(\" \")[0]);\n const K = parseInt(input[0].split(\" \")[1]);\n\n var a = K;\n for (var s = 1;s<=N;s++){\n a *= K;\n }\n console.log(a);\n\n\n for(var i = 1;i <= a;i++){\n for(var j = 1;j <= a;j++){\n for(var k = 1;k <= a;k++){\n count+=gcd(i,j,k); \n }\n }\n }\n console.log(count/10000000007);\n}\n \nfunction gcd() {\n var f = (a, b) => b ? f(b, a % b) : a\n var ans = arguments[0]\n for (var i = 1; i < arguments.length; i++) {\n ans = f(ans, arguments[i]); \n }\n return ans \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 500 points\n\nProblem Statement\n\nConsider sequences \\{A_1,...,A_N\\} of length N consisting of integers between 1 and K (inclusive).\n\nThere are K^N such sequences. Find the sum of \\gcd(A_1, ..., A_N) over all of them.\n\nSince this sum can be enormous, print the value modulo (10^9+7).\n\nHere \\gcd(A_1, ..., A_N) denotes the greatest common divisor of A_1, ..., A_N.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the sum of \\gcd(A_1, ..., A_N) over all K^N sequences, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n3 200\n\nSample Output 2\n\n10813692\n\nSample Input 3\n\n100000 100000\n\nSample Output 3\n\n742202979\n\nBe sure to print the sum modulo (10^9+7).", "sample_input": "3 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02715", "source_text": "Score : 500 points\n\nProblem Statement\n\nConsider sequences \\{A_1,...,A_N\\} of length N consisting of integers between 1 and K (inclusive).\n\nThere are K^N such sequences. Find the sum of \\gcd(A_1, ..., A_N) over all of them.\n\nSince this sum can be enormous, print the value modulo (10^9+7).\n\nHere \\gcd(A_1, ..., A_N) denotes the greatest common divisor of A_1, ..., A_N.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the sum of \\gcd(A_1, ..., A_N) over all K^N sequences, modulo (10^9+7).\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n\\gcd(1,1,1)+\\gcd(1,1,2)+\\gcd(1,2,1)+\\gcd(1,2,2)\n+\\gcd(2,1,1)+\\gcd(2,1,2)+\\gcd(2,2,1)+\\gcd(2,2,2)\n=1+1+1+1+1+1+1+2=9\n\nThus, the answer is 9.\n\nSample Input 2\n\n3 200\n\nSample Output 2\n\n10813692\n\nSample Input 3\n\n100000 100000\n\nSample Output 3\n\n742202979\n\nBe sure to print the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 694, "cpu_time_ms": 2206, "memory_kb": 35924}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s748659531", "group_id": "codeNet:p02720", "input_text": "/*!\n * path: atcoder/abc161/d\n * URL: https://github.com/koukimetal/procomvis/tree/master/src/contest/atcoder/abc161/d\n */!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,\"a\",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=\"\",n(n.s=0)}([function(e,t,n){\"use strict\";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};t.__esModule=!0;var o=r(n(1)),u=n(2);o.default.readFile(\"/dev/stdin\",\"utf8\",(function(e,t){!function(e){var t=new u.Solver,n=t.parse(e),r=t.solve(n);t.print(r)}(t)}))},function(e,t){e.exports=require(\"fs\")},function(e,t,n){\"use strict\";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});t.__esModule=!0;var u=n(3),i=n(4);function a(e,t){if(e.num.length===t){var n=new Array(e.num.length+1);n.fill(0),n[n.length-1]=1,e.num=n}else e.num.length-1===t?9===e.num[t]?a(e,t+1):e.num[t]++:e.num[t]<9&&Math.abs(e.num[t]+1-e.num[t+1])<=1?e.num[t]++:(a(e,t+1),e.num[t]=Math.max(0,e.num[t+1]-1))}var l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.solve=function(e){for(var t=e.K,n={num:[]},r=0;r0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]1){\n p=false;\n }\n }\n if(p==true){\n c++;\n }\n }\n console.log(i);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1586116871, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02720.html", "problem_id": "p02720", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02720/input.txt", "sample_output_relpath": "derived/input_output/data/p02720/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02720/JavaScript/s724462022.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s724462022", "user_id": "u705765200"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "function Main(input){\n k=parseInt(input);\n i=0;\n c=0;\n while(c1){\n p=false;\n }\n }\n if(p==true){\n c++;\n }\n }\n console.log(i);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "sample_input": "15\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02720", "source_text": "Score : 400 points\n\nProblem Statement\n\nA positive integer X is said to be a lunlun number if and only if the following condition is satisfied:\n\nIn the base ten representation of X (without leading zeros), for every pair of two adjacent digits, the absolute difference of those digits is at most 1.\n\nFor example, 1234, 1, and 334 are lunlun numbers, while none of 31415, 119, or 13579 is.\n\nYou are given a positive integer K. Find the K-th smallest lunlun number.\n\nConstraints\n\n1 \\leq K \\leq 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n15\n\nSample Output 1\n\n23\n\nWe will list the 15 smallest lunlun numbers in ascending order:\n\n1,\n2,\n3,\n4,\n5,\n6,\n7,\n8,\n9,\n10,\n11,\n12,\n21,\n22,\n23.\n\nThus, the answer is 23.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n13\n\nSample Output 3\n\n21\n\nSample Input 4\n\n100000\n\nSample Output 4\n\n3234566667\n\nNote that the answer may not fit into the 32-bit signed integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 466, "cpu_time_ms": 2113, "memory_kb": 92968}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s237995695", "group_id": "codeNet:p02723", "input_text": "\"use strict\";\n\nconst main = arg => {\n \n console.log(\"No\");\n \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1585533618, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/JavaScript/s237995695.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s237995695", "user_id": "u797516623"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n \n console.log(\"No\");\n \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 123, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s955833730", "group_id": "codeNet:p02723", "input_text": "\"use strict\";\n\nconst main = arg => {\n \n return \"No\";\n \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1585533572, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/JavaScript/s955833730.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s955833730", "user_id": "u797516623"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n \n return \"No\";\n \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 117, "cpu_time_ms": 48, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s403439228", "group_id": "codeNet:p02723", "input_text": "function Main(arg) {\n var n = arg.split(\"\\n\")[0];\n\n if (n[2] == n[3] && n[4] == n[5]) {\n console.log(\"Yes\");\n }\n else {\n console.log(\"No\");\n \n }\n\n return;\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1585443721, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02723.html", "problem_id": "p02723", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02723/input.txt", "sample_output_relpath": "derived/input_output/data/p02723/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02723/JavaScript/s403439228.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s403439228", "user_id": "u303297838"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(arg) {\n var n = arg.split(\"\\n\")[0];\n\n if (n[2] == n[3] && n[4] == n[5]) {\n console.log(\"Yes\");\n }\n else {\n console.log(\"No\");\n \n }\n\n return;\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "sample_input": "sippuu\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02723", "source_text": "Score : 100 points\n\nProblem Statement\n\nA string of length 6 consisting of lowercase English letters is said to be coffee-like if and only if its 3-rd and 4-th characters are equal and its 5-th and 6-th characters are also equal.\n\nGiven a string S, determine whether it is coffee-like.\n\nConstraints\n\nS is a string of length 6 consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is coffee-like, print Yes; otherwise, print No.\n\nSample Input 1\n\nsippuu\n\nSample Output 1\n\nYes\n\nIn sippuu, the 3-rd and 4-th characters are equal, and the 5-th and 6-th characters are also equal.\n\nSample Input 2\n\niphone\n\nSample Output 2\n\nNo\n\nSample Input 3\n\ncoffee\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 228, "cpu_time_ms": 1053, "memory_kb": 22080}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s280100197", "group_id": "codeNet:p02724", "input_text": "function main(input){\n tmp=0;\n while(tmp<=input){ \n tmp+=500;\n }\n a=tmp*2;\n tmp2=0;\n while(tmp2<=input-tmp){\n tmp2+=5;\n }\n a+=tmp2;\n console.log(\"%d\",a);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1585949391, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02724.html", "problem_id": "p02724", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02724/input.txt", "sample_output_relpath": "derived/input_output/data/p02724/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02724/JavaScript/s280100197.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s280100197", "user_id": "u705765200"}, "prompt_components": {"gold_output": "2020\n", "input_to_evaluate": "function main(input){\n tmp=0;\n while(tmp<=input){ \n tmp+=500;\n }\n a=tmp*2;\n tmp2=0;\n while(tmp2<=input-tmp){\n tmp2+=5;\n }\n a+=tmp2;\n console.log(\"%d\",a);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "sample_input": "1024\n"}, "reference_outputs": ["2020\n"], "source_document_id": "p02724", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves gold coins. He gains 1000 happiness points for each 500-yen coin he has and gains 5 happiness points for each 5-yen coin he has. (Yen is the currency of Japan.)\n\nTakahashi has X yen. If he exchanges his money so that he will gain the most happiness points, how many happiness points will he earn?\n\n(We assume that there are six kinds of coins available: 500-yen, 100-yen, 50-yen, 10-yen, 5-yen, and 1-yen coins.)\n\nConstraints\n\n0 \\leq X \\leq 10^9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the maximum number of happiness points that can be earned.\n\nSample Input 1\n\n1024\n\nSample Output 1\n\n2020\n\nBy exchanging his money so that he gets two 500-yen coins and four 5-yen coins, he gains 2020 happiness points, which is the maximum number of happiness points that can be earned.\n\nSample Input 2\n\n0\n\nSample Output 2\n\n0\n\nHe is penniless - or yenless.\n\nSample Input 3\n\n1000000000\n\nSample Output 3\n\n2000000000\n\nHe is a billionaire - in yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 339, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s367605050", "group_id": "codeNet:p02725", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var kandn = lines[0].split(' ');\n var k = Number(kandn[0]);\n var n = Number(kandn[1]);\n var a = lines[1].split(' ');\n var sa = [];\n\n var a = a.map(function(str) { return Number(str)});\n if(a === 0){\n a = k;\n }\n for(i=1; i<=a.length; i++){\n if(i === a.length){\n if(a[0] === 0){\n a[0] = k;\n }\n sa.push(Math.abs(a[i-1] - a[0]));\n break;\n }\n sa.push(Math.abs(a[i-1] - a[i]));\n }\n\n var max = Math.max(...sa);\n var index = sa.indexOf(max);\n sa.splice(index,index);\n\n var ans = sa.reduce(function(a, x){return a + x;});\n console.log(ans);\n\n \n});process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var kandn = lines[0].split(' ');\n var k = Number(kandn[0]);\n var n = Number(kandn[1]);\n var a = lines[1].split(' ');\n var sa = [];\n\n var a = a.map(function(str) { return Number(str)});\n if(a === 0){\n a = k;\n }\n for(i=1; i<=a.length; i++){\n if(i === a.length){\n if(a[0] === 0){\n a[0] = k;\n }\n sa.push(Math.abs(a[i-1] - a[0]));\n break;\n }\n sa.push(Math.abs(a[i-1] - a[i]));\n }\n\n var max = Math.max(...sa);\n var index = sa.indexOf(max);\n sa.splice(index,index);\n\n var ans = sa.reduce(function(a, x){return a + x;});\n console.log(ans);\n\n \n});", "language": "JavaScript", "metadata": {"date": 1587976587, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02725.html", "problem_id": "p02725", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02725/input.txt", "sample_output_relpath": "derived/input_output/data/p02725/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02725/JavaScript/s367605050.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s367605050", "user_id": "u253481827"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var kandn = lines[0].split(' ');\n var k = Number(kandn[0]);\n var n = Number(kandn[1]);\n var a = lines[1].split(' ');\n var sa = [];\n\n var a = a.map(function(str) { return Number(str)});\n if(a === 0){\n a = k;\n }\n for(i=1; i<=a.length; i++){\n if(i === a.length){\n if(a[0] === 0){\n a[0] = k;\n }\n sa.push(Math.abs(a[i-1] - a[0]));\n break;\n }\n sa.push(Math.abs(a[i-1] - a[i]));\n }\n\n var max = Math.max(...sa);\n var index = sa.indexOf(max);\n sa.splice(index,index);\n\n var ans = sa.reduce(function(a, x){return a + x;});\n console.log(ans);\n\n \n});process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var kandn = lines[0].split(' ');\n var k = Number(kandn[0]);\n var n = Number(kandn[1]);\n var a = lines[1].split(' ');\n var sa = [];\n\n var a = a.map(function(str) { return Number(str)});\n if(a === 0){\n a = k;\n }\n for(i=1; i<=a.length; i++){\n if(i === a.length){\n if(a[0] === 0){\n a[0] = k;\n }\n sa.push(Math.abs(a[i-1] - a[0]));\n break;\n }\n sa.push(Math.abs(a[i-1] - a[i]));\n }\n\n var max = Math.max(...sa);\n var index = sa.indexOf(max);\n sa.splice(index,index);\n\n var ans = sa.reduce(function(a, x){return a + x;});\n console.log(ans);\n\n \n});", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "sample_input": "20 3\n5 10 15\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02725", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a circular pond with a perimeter of K meters, and N houses around them.\n\nThe i-th house is built at a distance of A_i meters from the northmost point of the pond, measured clockwise around the pond.\n\nWhen traveling between these houses, you can only go around the pond.\n\nFind the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nConstraints\n\n2 \\leq K \\leq 10^6\n\n2 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq A_1 < ... < A_N < K\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK N\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum distance that needs to be traveled when you start at one of the houses and visit all the N houses.\n\nSample Input 1\n\n20 3\n5 10 15\n\nSample Output 1\n\n10\n\nIf you start at the 1-st house and go to the 2-nd and 3-rd houses in this order, the total distance traveled will be 10.\n\nSample Input 2\n\n20 3\n0 5 15\n\nSample Output 2\n\n10\n\nIf you start at the 2-nd house and go to the 1-st and 3-rd houses in this order, the total distance traveled will be 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1662, "cpu_time_ms": 76, "memory_kb": 15180}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s841867312", "group_id": "codeNet:p02729", "input_text": "'use strict';\nfunction main(input) {\n input = input.split(' ');\n const a = parseInt(input[0], 10);\n const b = parseInt(input[1], 10);\n\n sum = (a > 1 ? a * (a - 1) / 2 : 0) + (b > 1 ? b * (b - 1) / 2 : 0)\n\n console.log(sum);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1587490983, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/JavaScript/s841867312.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s841867312", "user_id": "u215341636"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "'use strict';\nfunction main(input) {\n input = input.split(' ');\n const a = parseInt(input[0], 10);\n const b = parseInt(input[1], 10);\n\n sum = (a > 1 ? a * (a - 1) / 2 : 0) + (b > 1 ? b * (b - 1) / 2 : 0)\n\n console.log(sum);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 287, "cpu_time_ms": 51, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s788326415", "group_id": "codeNet:p02729", "input_text": "\"use strict\"\nfunction main(arg) {\n var b = arg.trim().split(' ')[0];\n var c = arg.trim().split(' ')[1];\n\n\n\n console.log(combination(b,2) + combination(c,2)) \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction permutation(n, r) {\nfor(var i = 0, res = 1; i < r; i++) {\nres *= n - i;\n}\n\n\nreturn res;\n}\n\nfunction combination(n, r) {\n\n \nreturn permutation(n, r) / permutation(r, r);\n}", "language": "JavaScript", "metadata": {"date": 1584926933, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/JavaScript/s788326415.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s788326415", "user_id": "u511339236"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\"use strict\"\nfunction main(arg) {\n var b = arg.trim().split(' ')[0];\n var c = arg.trim().split(' ')[1];\n\n\n\n console.log(combination(b,2) + combination(c,2)) \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction permutation(n, r) {\nfor(var i = 0, res = 1; i < r; i++) {\nres *= n - i;\n}\n\n\nreturn res;\n}\n\nfunction combination(n, r) {\n\n \nreturn permutation(n, r) / permutation(r, r);\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 410, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s940394643", "group_id": "codeNet:p02729", "input_text": "\"use strict\";\nconst Main = (input) =>{\n let xs = input.trim().split(' ').map(v=>parseInt(v,10));\n  let N = xs[0];\n let M = xs[1];\n let ans = 0;\n \n for(let i=0; N>i; i++){\n ans += i;\n }\n //console.log(ans);\n \n let ans1=0;\n if(M>1){\n ans1=M;\n }else{\n ans1=0;\n }\n //console.log(ans1);\n console.log(ans+ans1);\n}\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "language": "JavaScript", "metadata": {"date": 1584926869, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/JavaScript/s940394643.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s940394643", "user_id": "u720390023"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\"use strict\";\nconst Main = (input) =>{\n let xs = input.trim().split(' ').map(v=>parseInt(v,10));\n  let N = xs[0];\n let M = xs[1];\n let ans = 0;\n \n for(let i=0; N>i; i++){\n ans += i;\n }\n //console.log(ans);\n \n let ans1=0;\n if(M>1){\n ans1=M;\n }else{\n ans1=0;\n }\n //console.log(ans1);\n console.log(ans+ans1);\n}\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 402, "cpu_time_ms": 202, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s957522133", "group_id": "codeNet:p02729", "input_text": "function Main(input) {\n\tinput = input.split(\" \");\n\tvar N = parseInt(input[0]);\n\tvar M = parseInt(input[1]);\n\n\tvar comb_N = (N * (N - 1)) / 2;\n\tvar comb_M = (M * (M - 1)) / 2;\n\n\tconsole.log(comb_N + comb_M);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1584926284, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02729.html", "problem_id": "p02729", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02729/input.txt", "sample_output_relpath": "derived/input_output/data/p02729/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02729/JavaScript/s957522133.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s957522133", "user_id": "u257920571"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n\tinput = input.split(\" \");\n\tvar N = parseInt(input[0]);\n\tvar M = parseInt(input[1]);\n\n\tvar comb_N = (N * (N - 1)) / 2;\n\tvar comb_M = (M * (M - 1)) / 2;\n\n\tconsole.log(comb_N + comb_M);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "sample_input": "2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02729", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have N+M balls, each of which has an integer written on it.\n\nIt is known that:\n\nThe numbers written on N of the balls are even.\n\nThe numbers written on M of the balls are odd.\n\nFind the number of ways to choose two of the N+M balls (disregarding order) so that the sum of the numbers written on them is even.\n\nIt can be shown that this count does not depend on the actual values written on the balls.\n\nConstraints\n\n0 \\leq N,M \\leq 100\n\n2 \\leq N+M\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 1\n\nSample Output 1\n\n1\n\nFor example, let us assume that the numbers written on the three balls are 1,2,4.\n\nIf we choose the two balls with 1 and 2, the sum is odd;\n\nIf we choose the two balls with 1 and 4, the sum is odd;\n\nIf we choose the two balls with 2 and 4, the sum is even.\n\nThus, the answer is 1.\n\nSample Input 2\n\n4 3\n\nSample Output 2\n\n9\n\nSample Input 3\n\n1 1\n\nSample Output 3\n\n0\n\nSample Input 4\n\n13 3\n\nSample Output 4\n\n81\n\nSample Input 5\n\n0 3\n\nSample Output 5\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 264, "cpu_time_ms": 235, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s275113266", "group_id": "codeNet:p02730", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n var ans = \"No\";\n input = input.trim().split(\"\\n\");\n // const [X] = input[0].split(\" \").map((n) => parseInt(n));\n\tvar S = input[0];\n\tif (kaibun(S) && \n\tkaibun(S.slice(0, Math.floor(S.length / 2))) &&\n\tkaibun(S.slice(Math.ceil(S.length / 2)))) {\n\t\tans = 'Yes'\n\t}\n\t\n\n function kaibun(str) {\n\t\tflg = true\n for (var i = 0; i < str.length /2; i++) {\n if (str[i] != str[str.length - i - 1]) {\n\t\t\t\tflg = false\n break;\n }\n\t\t}\n\t\treturn flg\n }\n\n //出力\n console.log(ans);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// Main(require(\"fs\").readFileSync(\"./input.txt\", \"utf-8\"));\n", "language": "JavaScript", "metadata": {"date": 1593934866, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/JavaScript/s275113266.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s275113266", "user_id": "u795511254"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n var ans = \"No\";\n input = input.trim().split(\"\\n\");\n // const [X] = input[0].split(\" \").map((n) => parseInt(n));\n\tvar S = input[0];\n\tif (kaibun(S) && \n\tkaibun(S.slice(0, Math.floor(S.length / 2))) &&\n\tkaibun(S.slice(Math.ceil(S.length / 2)))) {\n\t\tans = 'Yes'\n\t}\n\t\n\n function kaibun(str) {\n\t\tflg = true\n for (var i = 0; i < str.length /2; i++) {\n if (str[i] != str[str.length - i - 1]) {\n\t\t\t\tflg = false\n break;\n }\n\t\t}\n\t\treturn flg\n }\n\n //出力\n console.log(ans);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// Main(require(\"fs\").readFileSync(\"./input.txt\", \"utf-8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 861, "cpu_time_ms": 116, "memory_kb": 29496}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s713243729", "group_id": "codeNet:p02730", "input_text": "\"use strict\";\nconst Main = (input) =>{\n let xs = input.trim().split('');\n let len = Math.floor(xs.length/2);\n let len1 = xs.length;\n \n let ans ='';\n for(let i=0; ilen; i--){\n ans1 +=xs[i];\n }\n \n if(ans==ans1&&ans.length>2){\n console.log('Yes');\n }else{\n console.log('No');\n }\n}\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "language": "JavaScript", "metadata": {"date": 1584929229, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/JavaScript/s713243729.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s713243729", "user_id": "u720390023"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\nconst Main = (input) =>{\n let xs = input.trim().split('');\n let len = Math.floor(xs.length/2);\n let len1 = xs.length;\n \n let ans ='';\n for(let i=0; ilen; i--){\n ans1 +=xs[i];\n }\n \n if(ans==ans1&&ans.length>2){\n console.log('Yes');\n }else{\n console.log('No');\n }\n}\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 448, "cpu_time_ms": 208, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s330704246", "group_id": "codeNet:p02730", "input_text": "function main(input) {\n const S = input;\n\n for (var i = 0; i < Math.floor(S.length / 2); i++) {\n if (S[i] !== S[S.length - (i + 1)]) {\n console.log(\"No\");\n return;\n }\n }\n const firstS = S.slice(0, (S.length - 1) / 2);\n const lastS = S.slice((S.length + 3) / 2 - 1);\n\n for (var i = 0; i < Math.floor(firstS.length / 2); i++) {\n if (firstS[i] !== firstS[firstS.length - (i + 1)]) {\n console.log(\"No\");\n return;\n }\n }\n\n for (var i = 0; i < Math.floor(lastS.length / 2); i++) {\n if (lastS[i] !== lastS[lastS.length - (i + 1)]) {\n console.log(\"No\");\n return;\n }\n }\n\n console.log(\"Yes\");\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1584927945, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02730.html", "problem_id": "p02730", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02730/input.txt", "sample_output_relpath": "derived/input_output/data/p02730/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02730/JavaScript/s330704246.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s330704246", "user_id": "u413021823"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function main(input) {\n const S = input;\n\n for (var i = 0; i < Math.floor(S.length / 2); i++) {\n if (S[i] !== S[S.length - (i + 1)]) {\n console.log(\"No\");\n return;\n }\n }\n const firstS = S.slice(0, (S.length - 1) / 2);\n const lastS = S.slice((S.length + 3) / 2 - 1);\n\n for (var i = 0; i < Math.floor(firstS.length / 2); i++) {\n if (firstS[i] !== firstS[firstS.length - (i + 1)]) {\n console.log(\"No\");\n return;\n }\n }\n\n for (var i = 0; i < Math.floor(lastS.length / 2); i++) {\n if (lastS[i] !== lastS[lastS.length - (i + 1)]) {\n console.log(\"No\");\n return;\n }\n }\n\n console.log(\"Yes\");\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "sample_input": "akasaka\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02730", "source_text": "Score : 200 points\n\nProblem Statement\n\nA string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied:\n\nS is a palindrome.\n\nLet N be the length of S. The string formed by the 1-st through ((N-1)/2)-th characters of S is a palindrome.\n\nThe string consisting of the (N+3)/2-st through N-th characters of S is a palindrome.\n\nDetermine whether S is a strong palindrome.\n\nConstraints\n\nS consists of lowercase English letters.\n\nThe length of S is an odd number between 3 and 99 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S is a strong palindrome, print Yes;\notherwise, print No.\n\nSample Input 1\n\nakasaka\n\nSample Output 1\n\nYes\n\nS is akasaka.\n\nThe string formed by the 1-st through the 3-rd characters is aka.\n\nThe string formed by the 5-th through the 7-th characters is aka.\nAll of these are palindromes, so S is a strong palindrome.\n\nSample Input 2\n\nlevel\n\nSample Output 2\n\nNo\n\nSample Input 3\n\natcoder\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 699, "cpu_time_ms": 251, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s425482128", "group_id": "codeNet:p02732", "input_text": "\"use strict\";\nlet inp = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim();\nlet max = Number(inp.split('\\n')[0]);\nlet nums = inp.split('\\n')[1].split(' ').map(Number);\nlet formed_nums = (new Array(max)).fill(0);\nfor (let i = 0; i < max; i++) {\n formed_nums[nums[i]]++\n}\nlet sum = 0;\nformed_nums.forEach(elm => {\n if (elm >= 2) {\n sum += elm * (elm - 1) / 2\n }\n});\nnums.forEach(elm => {\n console.log(sum - formed_nums[elm] + 1)\n})", "language": "JavaScript", "metadata": {"date": 1585634027, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/JavaScript/s425482128.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s425482128", "user_id": "u703141727"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "\"use strict\";\nlet inp = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim();\nlet max = Number(inp.split('\\n')[0]);\nlet nums = inp.split('\\n')[1].split(' ').map(Number);\nlet formed_nums = (new Array(max)).fill(0);\nfor (let i = 0; i < max; i++) {\n formed_nums[nums[i]]++\n}\nlet sum = 0;\nformed_nums.forEach(elm => {\n if (elm >= 2) {\n sum += elm * (elm - 1) / 2\n }\n});\nnums.forEach(elm => {\n console.log(sum - formed_nums[elm] + 1)\n})", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 453, "cpu_time_ms": 1988, "memory_kb": 39704}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s755479264", "group_id": "codeNet:p02732", "input_text": "\"use strict\";\nlet inp = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").slice(0, -1);\nlet max = inp.split('\\n')[0]\nlet nums = inp.split('\\n')[1].split(' ')\nlet formed_nums = [];\nfor (let i = 0; i < max; i++) {\n formed_nums.push(nums.filter(elm => i + 1 == elm).length || 0)\n}\nformed_nums.forEach((elm, i) => {\n let ans = 0;\n let arr = formed_nums.slice();\n arr[nums[i]-1]--;\n arr.forEach(elm => {\n if (elm >= 2) {\n ans += elm * (elm - 1) / 2\n }\n });\n console.log(ans)\n})", "language": "JavaScript", "metadata": {"date": 1585631569, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02732.html", "problem_id": "p02732", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02732/input.txt", "sample_output_relpath": "derived/input_output/data/p02732/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02732/JavaScript/s755479264.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s755479264", "user_id": "u703141727"}, "prompt_components": {"gold_output": "2\n2\n3\n2\n3\n", "input_to_evaluate": "\"use strict\";\nlet inp = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").slice(0, -1);\nlet max = inp.split('\\n')[0]\nlet nums = inp.split('\\n')[1].split(' ')\nlet formed_nums = [];\nfor (let i = 0; i < max; i++) {\n formed_nums.push(nums.filter(elm => i + 1 == elm).length || 0)\n}\nformed_nums.forEach((elm, i) => {\n let ans = 0;\n let arr = formed_nums.slice();\n arr[nums[i]-1]--;\n arr.forEach(elm => {\n if (elm >= 2) {\n ans += elm * (elm - 1) / 2\n }\n });\n console.log(ans)\n})", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "sample_input": "5\n1 1 2 1 2\n"}, "reference_outputs": ["2\n2\n3\n2\n3\n"], "source_document_id": "p02732", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N balls. The i-th ball has an integer A_i written on it.\n\nFor each k=1, 2, ..., N, solve the following problem and print the answer.\n\nFind the number of ways to choose two distinct balls (disregarding order) from the N-1 balls other than the k-th ball so that the integers written on them are equal.\n\nConstraints\n\n3 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nFor each k=1,2,...,N, print a line containing the answer.\n\nSample Input 1\n\n5\n1 1 2 1 2\n\nSample Output 1\n\n2\n2\n3\n2\n3\n\nConsider the case k=1 for example. The numbers written on the remaining balls are 1,2,1,2.\n\nFrom these balls, there are two ways to choose two distinct balls so that the integers written on them are equal.\n\nThus, the answer for k=1 is 2.\n\nSample Input 2\n\n4\n1 2 3 4\n\nSample Output 2\n\n0\n0\n0\n0\n\nNo two balls have equal numbers written on them.\n\nSample Input 3\n\n5\n3 3 3 3 3\n\nSample Output 3\n\n6\n6\n6\n6\n6\n\nAny two balls have equal numbers written on them.\n\nSample Input 4\n\n8\n1 2 1 4 2 1 4 1\n\nSample Output 4\n\n5\n7\n5\n7\n7\n5\n7\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 517, "cpu_time_ms": 2109, "memory_kb": 23136}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s428432524", "group_id": "codeNet:p02741", "input_text": "\n// inputに入力データ全体が入る\nfunction Main(input) {\n input = parseInt(input.split(\"\\n\"))\n var arg = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]\n console.log(arg[input - 1]);\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1584235821, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02741.html", "problem_id": "p02741", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02741/input.txt", "sample_output_relpath": "derived/input_output/data/p02741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02741/JavaScript/s428432524.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s428432524", "user_id": "u556815202"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n// inputに入力データ全体が入る\nfunction Main(input) {\n input = parseInt(input.split(\"\\n\"))\n var arg = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]\n console.log(arg[input - 1]);\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "sample_input": "6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02741", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 434, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s394322245", "group_id": "codeNet:p02741", "input_text": "\nfunction Main(K) {\n \n \n \n \nvar L = parseInt(K, 10);\nvar aiu = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51];\n \n \n //出力\nconsole.log(aiu[L]);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1584235159, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02741.html", "problem_id": "p02741", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02741/input.txt", "sample_output_relpath": "derived/input_output/data/p02741/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02741/JavaScript/s394322245.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s394322245", "user_id": "u871647586"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\nfunction Main(K) {\n \n \n \n \nvar L = parseInt(K, 10);\nvar aiu = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51];\n \n \n //出力\nconsole.log(aiu[L]);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "sample_input": "6\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02741", "source_text": "Score : 100 points\n\nProblem Statement\n\nPrint the K-th element of the following sequence of length 32:\n\n1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51\n\nConstraints\n\n1 \\leq K \\leq 32\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK\n\nOutput\n\nPrint the K-th element.\n\nSample Input 1\n\n6\n\nSample Output 1\n\n2\n\nThe 6-th element is 2.\n\nSample Input 2\n\n27\n\nSample Output 2\n\n5\n\nThe 27-th element is 5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 387, "cpu_time_ms": 788, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s258758390", "group_id": "codeNet:p02742", "input_text": "function Main(input){\n\tvar input= input.split(' '),\n\t\tH = input[0],\n\t\tW = input[1];\n\n\tvar result;\n\n\tif(H * W % 2 == 0){\n\t\tconsole.log(H*W/2);\n\t}else{\n\t\tconsole.log((H*W+1)/2)\n\t}\n\n}", "language": "JavaScript", "metadata": {"date": 1584377505, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02742.html", "problem_id": "p02742", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02742/input.txt", "sample_output_relpath": "derived/input_output/data/p02742/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02742/JavaScript/s258758390.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s258758390", "user_id": "u302267058"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "function Main(input){\n\tvar input= input.split(' '),\n\t\tH = input[0],\n\t\tW = input[1];\n\n\tvar result;\n\n\tif(H * W % 2 == 0){\n\t\tconsole.log(H*W/2);\n\t}else{\n\t\tconsole.log((H*W+1)/2)\n\t}\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "sample_input": "4 5\n"}, "reference_outputs": ["10\n"], "source_document_id": "p02742", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a board with H horizontal rows and W vertical columns of squares.\nThere is a bishop at the top-left square on this board.\nHow many squares can this bishop reach by zero or more movements?\n\nHere the bishop can only move diagonally.\nMore formally, the bishop can move from the square at the r_1-th row (from the top) and the c_1-th column (from the left) to the square at the r_2-th row and the c_2-th column if and only if exactly one of the following holds:\n\nr_1 + c_1 = r_2 + c_2\n\nr_1 - c_1 = r_2 - c_2\n\nFor example, in the following figure, the bishop can move to any of the red squares in one move:\n\nConstraints\n\n1 \\leq H, W \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH \\ W\n\nOutput\n\nPrint the number of squares the bishop can reach.\n\nSample Input 1\n\n4 5\n\nSample Output 1\n\n10\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 2\n\n7 3\n\nSample Output 2\n\n11\n\nThe bishop can reach the cyan squares in the following figure:\n\nSample Input 3\n\n1000000000 1000000000\n\nSample Output 3\n\n500000000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 47, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s383418418", "group_id": "codeNet:p02748", "input_text": "'use strict'\n\nconst Main = (input) => {\n const M = parseInt(input.split('\\n')[0].split(' ')[2])\n const a = input.split('\\n')[1].split(' ').map((n) => parseInt(n))\n const b = input.split('\\n')[2].split(' ').map((n) => parseInt(n))\n const aryMin = (x, y) => {return Math.min(x, y)}\n let min = a.reduce(aryMin) + b.reduce(aryMin)\n for (let i = 0; i < M; i++) {\n \tconst c = input.split('\\n')[i + 3].split(' ').map((n) => parseInt(n))\n if (a[c[0] - 1] + b[c[1] - 1] - c[2] < min) {\n min = a[c[0] - 1] + b[c[1] - 1] - c[2]\n }\n }\n console.log(min)\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1583718188, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02748.html", "problem_id": "p02748", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02748/input.txt", "sample_output_relpath": "derived/input_output/data/p02748/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02748/JavaScript/s383418418.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s383418418", "user_id": "u612071939"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "'use strict'\n\nconst Main = (input) => {\n const M = parseInt(input.split('\\n')[0].split(' ')[2])\n const a = input.split('\\n')[1].split(' ').map((n) => parseInt(n))\n const b = input.split('\\n')[2].split(' ').map((n) => parseInt(n))\n const aryMin = (x, y) => {return Math.min(x, y)}\n let min = a.reduce(aryMin) + b.reduce(aryMin)\n for (let i = 0; i < M; i++) {\n \tconst c = input.split('\\n')[i + 3].split(' ').map((n) => parseInt(n))\n if (a[c[0] - 1] + b[c[1] - 1] - c[2] < min) {\n min = a[c[0] - 1] + b[c[1] - 1] - c[2]\n }\n }\n console.log(min)\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "sample_input": "2 3 1\n3 3\n3 3 3\n1 2 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02748", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 619, "cpu_time_ms": 2109, "memory_kb": 55504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s897121590", "group_id": "codeNet:p02748", "input_text": "/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/hitachi2020/B.js\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/big-integer/BigInteger.js\":\n/*!************************************************!*\\\n !*** ./node_modules/big-integer/BigInteger.js ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;var bigInt = (function (undefined) {\\r\\n \\\"use strict\\\";\\r\\n\\r\\n var BASE = 1e7,\\r\\n LOG_BASE = 7,\\r\\n MAX_INT = 9007199254740992,\\r\\n MAX_INT_ARR = smallToArray(MAX_INT),\\r\\n DEFAULT_ALPHABET = \\\"0123456789abcdefghijklmnopqrstuvwxyz\\\";\\r\\n\\r\\n var supportsNativeBigInt = typeof BigInt === \\\"function\\\";\\r\\n\\r\\n function Integer(v, radix, alphabet, caseSensitive) {\\r\\n if (typeof v === \\\"undefined\\\") return Integer[0];\\r\\n if (typeof radix !== \\\"undefined\\\") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);\\r\\n return parseValue(v);\\r\\n }\\r\\n\\r\\n function BigInteger(value, sign) {\\r\\n this.value = value;\\r\\n this.sign = sign;\\r\\n this.isSmall = false;\\r\\n }\\r\\n BigInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function SmallInteger(value) {\\r\\n this.value = value;\\r\\n this.sign = value < 0;\\r\\n this.isSmall = true;\\r\\n }\\r\\n SmallInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function NativeBigInt(value) {\\r\\n this.value = value;\\r\\n }\\r\\n NativeBigInt.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function isPrecise(n) {\\r\\n return -MAX_INT < n && n < MAX_INT;\\r\\n }\\r\\n\\r\\n function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes\\r\\n if (n < 1e7)\\r\\n return [n];\\r\\n if (n < 1e14)\\r\\n return [n % 1e7, Math.floor(n / 1e7)];\\r\\n return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];\\r\\n }\\r\\n\\r\\n function arrayToSmall(arr) { // If BASE changes this function may need to change\\r\\n trim(arr);\\r\\n var length = arr.length;\\r\\n if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {\\r\\n switch (length) {\\r\\n case 0: return 0;\\r\\n case 1: return arr[0];\\r\\n case 2: return arr[0] + arr[1] * BASE;\\r\\n default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;\\r\\n }\\r\\n }\\r\\n return arr;\\r\\n }\\r\\n\\r\\n function trim(v) {\\r\\n var i = v.length;\\r\\n while (v[--i] === 0);\\r\\n v.length = i + 1;\\r\\n }\\r\\n\\r\\n function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger\\r\\n var x = new Array(length);\\r\\n var i = -1;\\r\\n while (++i < length) {\\r\\n x[i] = 0;\\r\\n }\\r\\n return x;\\r\\n }\\r\\n\\r\\n function truncate(n) {\\r\\n if (n > 0) return Math.floor(n);\\r\\n return Math.ceil(n);\\r\\n }\\r\\n\\r\\n function add(a, b) { // assumes a and b are arrays with a.length >= b.length\\r\\n var l_a = a.length,\\r\\n l_b = b.length,\\r\\n r = new Array(l_a),\\r\\n carry = 0,\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l_b; i++) {\\r\\n sum = a[i] + b[i] + carry;\\r\\n carry = sum >= base ? 1 : 0;\\r\\n r[i] = sum - carry * base;\\r\\n }\\r\\n while (i < l_a) {\\r\\n sum = a[i] + carry;\\r\\n carry = sum === base ? 1 : 0;\\r\\n r[i++] = sum - carry * base;\\r\\n }\\r\\n if (carry > 0) r.push(carry);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function addAny(a, b) {\\r\\n if (a.length >= b.length) return add(a, b);\\r\\n return add(b, a);\\r\\n }\\r\\n\\r\\n function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n sum = a[i] - base + carry;\\r\\n carry = Math.floor(sum / base);\\r\\n r[i] = sum - carry * base;\\r\\n carry += 1;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new BigInteger(addSmall(a, Math.abs(b)), this.sign);\\r\\n }\\r\\n return new BigInteger(addAny(a, b), this.sign);\\r\\n };\\r\\n BigInteger.prototype.plus = BigInteger.prototype.add;\\r\\n\\r\\n SmallInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n if (isPrecise(a + b)) return new SmallInteger(a + b);\\r\\n b = smallToArray(Math.abs(b));\\r\\n }\\r\\n return new BigInteger(addSmall(b, Math.abs(a)), a < 0);\\r\\n };\\r\\n SmallInteger.prototype.plus = SmallInteger.prototype.add;\\r\\n\\r\\n NativeBigInt.prototype.add = function (v) {\\r\\n return new NativeBigInt(this.value + parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.plus = NativeBigInt.prototype.add;\\r\\n\\r\\n function subtract(a, b) { // assumes a and b are arrays with a >= b\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n r = new Array(a_l),\\r\\n borrow = 0,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < b_l; i++) {\\r\\n difference = a[i] - borrow - b[i];\\r\\n if (difference < 0) {\\r\\n difference += base;\\r\\n borrow = 1;\\r\\n } else borrow = 0;\\r\\n r[i] = difference;\\r\\n }\\r\\n for (i = b_l; i < a_l; i++) {\\r\\n difference = a[i] - borrow;\\r\\n if (difference < 0) difference += base;\\r\\n else {\\r\\n r[i++] = difference;\\r\\n break;\\r\\n }\\r\\n r[i] = difference;\\r\\n }\\r\\n for (; i < a_l; i++) {\\r\\n r[i] = a[i];\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function subtractAny(a, b, sign) {\\r\\n var value;\\r\\n if (compareAbs(a, b) >= 0) {\\r\\n value = subtract(a, b);\\r\\n } else {\\r\\n value = subtract(b, a);\\r\\n sign = !sign;\\r\\n }\\r\\n value = arrayToSmall(value);\\r\\n if (typeof value === \\\"number\\\") {\\r\\n if (sign) value = -value;\\r\\n return new SmallInteger(value);\\r\\n }\\r\\n return new BigInteger(value, sign);\\r\\n }\\r\\n\\r\\n function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n carry = -b,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < l; i++) {\\r\\n difference = a[i] + carry;\\r\\n carry = Math.floor(difference / base);\\r\\n difference %= base;\\r\\n r[i] = difference < 0 ? difference + base : difference;\\r\\n }\\r\\n r = arrayToSmall(r);\\r\\n if (typeof r === \\\"number\\\") {\\r\\n if (sign) r = -r;\\r\\n return new SmallInteger(r);\\r\\n } return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall)\\r\\n return subtractSmall(a, Math.abs(b), this.sign);\\r\\n return subtractAny(a, b, this.sign);\\r\\n };\\r\\n BigInteger.prototype.minus = BigInteger.prototype.subtract;\\r\\n\\r\\n SmallInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new SmallInteger(a - b);\\r\\n }\\r\\n return subtractSmall(b, Math.abs(a), a >= 0);\\r\\n };\\r\\n SmallInteger.prototype.minus = SmallInteger.prototype.subtract;\\r\\n\\r\\n NativeBigInt.prototype.subtract = function (v) {\\r\\n return new NativeBigInt(this.value - parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;\\r\\n\\r\\n BigInteger.prototype.negate = function () {\\r\\n return new BigInteger(this.value, !this.sign);\\r\\n };\\r\\n SmallInteger.prototype.negate = function () {\\r\\n var sign = this.sign;\\r\\n var small = new SmallInteger(-this.value);\\r\\n small.sign = !sign;\\r\\n return small;\\r\\n };\\r\\n NativeBigInt.prototype.negate = function () {\\r\\n return new NativeBigInt(-this.value);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.abs = function () {\\r\\n return new BigInteger(this.value, false);\\r\\n };\\r\\n SmallInteger.prototype.abs = function () {\\r\\n return new SmallInteger(Math.abs(this.value));\\r\\n };\\r\\n NativeBigInt.prototype.abs = function () {\\r\\n return new NativeBigInt(this.value >= 0 ? this.value : -this.value);\\r\\n }\\r\\n\\r\\n\\r\\n function multiplyLong(a, b) {\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n l = a_l + b_l,\\r\\n r = createArray(l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, b_j;\\r\\n for (i = 0; i < a_l; ++i) {\\r\\n a_i = a[i];\\r\\n for (var j = 0; j < b_l; ++j) {\\r\\n b_j = b[j];\\r\\n product = a_i * b_j + r[i + j];\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n r[i + j + 1] += carry;\\r\\n }\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n carry = 0,\\r\\n product, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n product = a[i] * b + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i] = product - carry * base;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n function shiftLeft(x, n) {\\r\\n var r = [];\\r\\n while (n-- > 0) r.push(0);\\r\\n return r.concat(x);\\r\\n }\\r\\n\\r\\n function multiplyKaratsuba(x, y) {\\r\\n var n = Math.max(x.length, y.length);\\r\\n\\r\\n if (n <= 30) return multiplyLong(x, y);\\r\\n n = Math.ceil(n / 2);\\r\\n\\r\\n var b = x.slice(n),\\r\\n a = x.slice(0, n),\\r\\n d = y.slice(n),\\r\\n c = y.slice(0, n);\\r\\n\\r\\n var ac = multiplyKaratsuba(a, c),\\r\\n bd = multiplyKaratsuba(b, d),\\r\\n abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));\\r\\n\\r\\n var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));\\r\\n trim(product);\\r\\n return product;\\r\\n }\\r\\n\\r\\n // The following function is derived from a surface fit of a graph plotting the performance difference\\r\\n // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.\\r\\n function useKaratsuba(l1, l2) {\\r\\n return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.multiply = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value, b = n.value,\\r\\n sign = this.sign !== n.sign,\\r\\n abs;\\r\\n if (n.isSmall) {\\r\\n if (b === 0) return Integer[0];\\r\\n if (b === 1) return this;\\r\\n if (b === -1) return this.negate();\\r\\n abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n return new BigInteger(multiplySmall(a, abs), sign);\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes\\r\\n return new BigInteger(multiplyKaratsuba(a, b), sign);\\r\\n return new BigInteger(multiplyLong(a, b), sign);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.times = BigInteger.prototype.multiply;\\r\\n\\r\\n function multiplySmallAndArray(a, b, sign) { // a >= 0\\r\\n if (a < BASE) {\\r\\n return new BigInteger(multiplySmall(b, a), sign);\\r\\n }\\r\\n return new BigInteger(multiplyLong(b, smallToArray(a)), sign);\\r\\n }\\r\\n SmallInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (isPrecise(a.value * this.value)) {\\r\\n return new SmallInteger(a.value * this.value);\\r\\n }\\r\\n return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);\\r\\n };\\r\\n BigInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (a.value === 0) return Integer[0];\\r\\n if (a.value === 1) return this;\\r\\n if (a.value === -1) return this.negate();\\r\\n return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);\\r\\n };\\r\\n SmallInteger.prototype.multiply = function (v) {\\r\\n return parseValue(v)._multiplyBySmall(this);\\r\\n };\\r\\n SmallInteger.prototype.times = SmallInteger.prototype.multiply;\\r\\n\\r\\n NativeBigInt.prototype.multiply = function (v) {\\r\\n return new NativeBigInt(this.value * parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;\\r\\n\\r\\n function square(a) {\\r\\n //console.assert(2 * BASE * BASE < MAX_INT);\\r\\n var l = a.length,\\r\\n r = createArray(l + l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, a_j;\\r\\n for (i = 0; i < l; i++) {\\r\\n a_i = a[i];\\r\\n carry = 0 - a_i * a_i;\\r\\n for (var j = i; j < l; j++) {\\r\\n a_j = a[j];\\r\\n product = 2 * (a_i * a_j) + r[i + j] + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n }\\r\\n r[i + l] = carry;\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.square = function () {\\r\\n return new BigInteger(square(this.value), false);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.square = function () {\\r\\n var value = this.value * this.value;\\r\\n if (isPrecise(value)) return new SmallInteger(value);\\r\\n return new BigInteger(square(smallToArray(Math.abs(this.value))), false);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.square = function (v) {\\r\\n return new NativeBigInt(this.value * this.value);\\r\\n }\\r\\n\\r\\n function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n base = BASE,\\r\\n result = createArray(b.length),\\r\\n divisorMostSignificantDigit = b[b_l - 1],\\r\\n // normalization\\r\\n lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),\\r\\n remainder = multiplySmall(a, lambda),\\r\\n divisor = multiplySmall(b, lambda),\\r\\n quotientDigit, shift, carry, borrow, i, l, q;\\r\\n if (remainder.length <= a_l) remainder.push(0);\\r\\n divisor.push(0);\\r\\n divisorMostSignificantDigit = divisor[b_l - 1];\\r\\n for (shift = a_l - b_l; shift >= 0; shift--) {\\r\\n quotientDigit = base - 1;\\r\\n if (remainder[shift + b_l] !== divisorMostSignificantDigit) {\\r\\n quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);\\r\\n }\\r\\n // quotientDigit <= base - 1\\r\\n carry = 0;\\r\\n borrow = 0;\\r\\n l = divisor.length;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += quotientDigit * divisor[i];\\r\\n q = Math.floor(carry / base);\\r\\n borrow += remainder[shift + i] - (carry - q * base);\\r\\n carry = q;\\r\\n if (borrow < 0) {\\r\\n remainder[shift + i] = borrow + base;\\r\\n borrow = -1;\\r\\n } else {\\r\\n remainder[shift + i] = borrow;\\r\\n borrow = 0;\\r\\n }\\r\\n }\\r\\n while (borrow !== 0) {\\r\\n quotientDigit -= 1;\\r\\n carry = 0;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += remainder[shift + i] - base + divisor[i];\\r\\n if (carry < 0) {\\r\\n remainder[shift + i] = carry + base;\\r\\n carry = 0;\\r\\n } else {\\r\\n remainder[shift + i] = carry;\\r\\n carry = 1;\\r\\n }\\r\\n }\\r\\n borrow += carry;\\r\\n }\\r\\n result[shift] = quotientDigit;\\r\\n }\\r\\n // denormalization\\r\\n remainder = divModSmall(remainder, lambda)[0];\\r\\n return [arrayToSmall(result), arrayToSmall(remainder)];\\r\\n }\\r\\n\\r\\n function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/\\r\\n // Performs faster than divMod1 on larger input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n result = [],\\r\\n part = [],\\r\\n base = BASE,\\r\\n guess, xlen, highx, highy, check;\\r\\n while (a_l) {\\r\\n part.unshift(a[--a_l]);\\r\\n trim(part);\\r\\n if (compareAbs(part, b) < 0) {\\r\\n result.push(0);\\r\\n continue;\\r\\n }\\r\\n xlen = part.length;\\r\\n highx = part[xlen - 1] * base + part[xlen - 2];\\r\\n highy = b[b_l - 1] * base + b[b_l - 2];\\r\\n if (xlen > b_l) {\\r\\n highx = (highx + 1) * base;\\r\\n }\\r\\n guess = Math.ceil(highx / highy);\\r\\n do {\\r\\n check = multiplySmall(b, guess);\\r\\n if (compareAbs(check, part) <= 0) break;\\r\\n guess--;\\r\\n } while (guess);\\r\\n result.push(guess);\\r\\n part = subtract(part, check);\\r\\n }\\r\\n result.reverse();\\r\\n return [arrayToSmall(result), arrayToSmall(part)];\\r\\n }\\r\\n\\r\\n function divModSmall(value, lambda) {\\r\\n var length = value.length,\\r\\n quotient = createArray(length),\\r\\n base = BASE,\\r\\n i, q, remainder, divisor;\\r\\n remainder = 0;\\r\\n for (i = length - 1; i >= 0; --i) {\\r\\n divisor = remainder * base + value[i];\\r\\n q = truncate(divisor / lambda);\\r\\n remainder = divisor - q * lambda;\\r\\n quotient[i] = q | 0;\\r\\n }\\r\\n return [quotient, remainder | 0];\\r\\n }\\r\\n\\r\\n function divModAny(self, v) {\\r\\n var value, n = parseValue(v);\\r\\n if (supportsNativeBigInt) {\\r\\n return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)];\\r\\n }\\r\\n var a = self.value, b = n.value;\\r\\n var quotient;\\r\\n if (b === 0) throw new Error(\\\"Cannot divide by zero\\\");\\r\\n if (self.isSmall) {\\r\\n if (n.isSmall) {\\r\\n return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];\\r\\n }\\r\\n return [Integer[0], self];\\r\\n }\\r\\n if (n.isSmall) {\\r\\n if (b === 1) return [self, Integer[0]];\\r\\n if (b == -1) return [self.negate(), Integer[0]];\\r\\n var abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n value = divModSmall(a, abs);\\r\\n quotient = arrayToSmall(value[0]);\\r\\n var remainder = value[1];\\r\\n if (self.sign) remainder = -remainder;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (self.sign !== n.sign) quotient = -quotient;\\r\\n return [new SmallInteger(quotient), new SmallInteger(remainder)];\\r\\n }\\r\\n return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n var comparison = compareAbs(a, b);\\r\\n if (comparison === -1) return [Integer[0], self];\\r\\n if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];\\r\\n\\r\\n // divMod1 is faster on smaller input sizes\\r\\n if (a.length + b.length <= 200)\\r\\n value = divMod1(a, b);\\r\\n else value = divMod2(a, b);\\r\\n\\r\\n quotient = value[0];\\r\\n var qSign = self.sign !== n.sign,\\r\\n mod = value[1],\\r\\n mSign = self.sign;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (qSign) quotient = -quotient;\\r\\n quotient = new SmallInteger(quotient);\\r\\n } else quotient = new BigInteger(quotient, qSign);\\r\\n if (typeof mod === \\\"number\\\") {\\r\\n if (mSign) mod = -mod;\\r\\n mod = new SmallInteger(mod);\\r\\n } else mod = new BigInteger(mod, mSign);\\r\\n return [quotient, mod];\\r\\n }\\r\\n\\r\\n BigInteger.prototype.divmod = function (v) {\\r\\n var result = divModAny(this, v);\\r\\n return {\\r\\n quotient: result[0],\\r\\n remainder: result[1]\\r\\n };\\r\\n };\\r\\n NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;\\r\\n\\r\\n\\r\\n BigInteger.prototype.divide = function (v) {\\r\\n return divModAny(this, v)[0];\\r\\n };\\r\\n NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {\\r\\n return new NativeBigInt(this.value / parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;\\r\\n\\r\\n BigInteger.prototype.mod = function (v) {\\r\\n return divModAny(this, v)[1];\\r\\n };\\r\\n NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {\\r\\n return new NativeBigInt(this.value % parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;\\r\\n\\r\\n BigInteger.prototype.pow = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value,\\r\\n value, x, y;\\r\\n if (b === 0) return Integer[1];\\r\\n if (a === 0) return Integer[0];\\r\\n if (a === 1) return Integer[1];\\r\\n if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.sign) {\\r\\n return Integer[0];\\r\\n }\\r\\n if (!n.isSmall) throw new Error(\\\"The exponent \\\" + n.toString() + \\\" is too large.\\\");\\r\\n if (this.isSmall) {\\r\\n if (isPrecise(value = Math.pow(a, b)))\\r\\n return new SmallInteger(truncate(value));\\r\\n }\\r\\n x = this;\\r\\n y = Integer[1];\\r\\n while (true) {\\r\\n if (b & 1 === 1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === 0) break;\\r\\n b /= 2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n };\\r\\n SmallInteger.prototype.pow = BigInteger.prototype.pow;\\r\\n\\r\\n NativeBigInt.prototype.pow = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value, b = n.value;\\r\\n var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);\\r\\n if (b === _0) return Integer[1];\\r\\n if (a === _0) return Integer[0];\\r\\n if (a === _1) return Integer[1];\\r\\n if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.isNegative()) return new NativeBigInt(_0);\\r\\n var x = this;\\r\\n var y = Integer[1];\\r\\n while (true) {\\r\\n if ((b & _1) === _1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === _0) break;\\r\\n b /= _2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.modPow = function (exp, mod) {\\r\\n exp = parseValue(exp);\\r\\n mod = parseValue(mod);\\r\\n if (mod.isZero()) throw new Error(\\\"Cannot take modPow with modulus 0\\\");\\r\\n var r = Integer[1],\\r\\n base = this.mod(mod);\\r\\n if (exp.isNegative()) {\\r\\n exp = exp.multiply(Integer[-1]);\\r\\n base = base.modInv(mod);\\r\\n }\\r\\n while (exp.isPositive()) {\\r\\n if (base.isZero()) return Integer[0];\\r\\n if (exp.isOdd()) r = r.multiply(base).mod(mod);\\r\\n exp = exp.divide(2);\\r\\n base = base.square().mod(mod);\\r\\n }\\r\\n return r;\\r\\n };\\r\\n NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;\\r\\n\\r\\n function compareAbs(a, b) {\\r\\n if (a.length !== b.length) {\\r\\n return a.length > b.length ? 1 : -1;\\r\\n }\\r\\n for (var i = a.length - 1; i >= 0; i--) {\\r\\n if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;\\r\\n }\\r\\n return 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) return 1;\\r\\n return compareAbs(a, b);\\r\\n };\\r\\n SmallInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = Math.abs(this.value),\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n b = Math.abs(b);\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n return -1;\\r\\n };\\r\\n NativeBigInt.prototype.compareAbs = function (v) {\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n a = a >= 0 ? a : -a;\\r\\n b = b >= 0 ? b : -b;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compare = function (v) {\\r\\n // See discussion about comparison with Infinity:\\r\\n // https://github.com/peterolson/BigInteger.js/issues/61\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (this.sign !== n.sign) {\\r\\n return n.sign ? 1 : -1;\\r\\n }\\r\\n if (n.isSmall) {\\r\\n return this.sign ? -1 : 1;\\r\\n }\\r\\n return compareAbs(a, b) * (this.sign ? -1 : 1);\\r\\n };\\r\\n BigInteger.prototype.compareTo = BigInteger.prototype.compare;\\r\\n\\r\\n SmallInteger.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n return a == b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n if (a < 0 !== n.sign) {\\r\\n return a < 0 ? -1 : 1;\\r\\n }\\r\\n return a < 0 ? 1 : -1;\\r\\n };\\r\\n SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;\\r\\n\\r\\n NativeBigInt.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;\\r\\n\\r\\n BigInteger.prototype.equals = function (v) {\\r\\n return this.compare(v) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;\\r\\n\\r\\n BigInteger.prototype.notEquals = function (v) {\\r\\n return this.compare(v) !== 0;\\r\\n };\\r\\n NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;\\r\\n\\r\\n BigInteger.prototype.greater = function (v) {\\r\\n return this.compare(v) > 0;\\r\\n };\\r\\n NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;\\r\\n\\r\\n BigInteger.prototype.lesser = function (v) {\\r\\n return this.compare(v) < 0;\\r\\n };\\r\\n NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;\\r\\n\\r\\n BigInteger.prototype.greaterOrEquals = function (v) {\\r\\n return this.compare(v) >= 0;\\r\\n };\\r\\n NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;\\r\\n\\r\\n BigInteger.prototype.lesserOrEquals = function (v) {\\r\\n return this.compare(v) <= 0;\\r\\n };\\r\\n NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;\\r\\n\\r\\n BigInteger.prototype.isEven = function () {\\r\\n return (this.value[0] & 1) === 0;\\r\\n };\\r\\n SmallInteger.prototype.isEven = function () {\\r\\n return (this.value & 1) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isEven = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isOdd = function () {\\r\\n return (this.value[0] & 1) === 1;\\r\\n };\\r\\n SmallInteger.prototype.isOdd = function () {\\r\\n return (this.value & 1) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isOdd = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isPositive = function () {\\r\\n return !this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isPositive = function () {\\r\\n return this.value > 0;\\r\\n };\\r\\n NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;\\r\\n\\r\\n BigInteger.prototype.isNegative = function () {\\r\\n return this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isNegative = function () {\\r\\n return this.value < 0;\\r\\n };\\r\\n NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;\\r\\n\\r\\n BigInteger.prototype.isUnit = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isUnit = function () {\\r\\n return Math.abs(this.value) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isUnit = function () {\\r\\n return this.abs().value === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isZero = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isZero = function () {\\r\\n return this.value === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isZero = function () {\\r\\n return this.value === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isDivisibleBy = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (n.isZero()) return false;\\r\\n if (n.isUnit()) return true;\\r\\n if (n.compareAbs(2) === 0) return this.isEven();\\r\\n return this.mod(n).isZero();\\r\\n };\\r\\n NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;\\r\\n\\r\\n function isBasicPrime(v) {\\r\\n var n = v.abs();\\r\\n if (n.isUnit()) return false;\\r\\n if (n.equals(2) || n.equals(3) || n.equals(5)) return true;\\r\\n if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;\\r\\n if (n.lesser(49)) return true;\\r\\n // we don't know if it's prime: let the other functions figure it out\\r\\n }\\r\\n\\r\\n function millerRabinTest(n, a) {\\r\\n var nPrev = n.prev(),\\r\\n b = nPrev,\\r\\n r = 0,\\r\\n d, t, i, x;\\r\\n while (b.isEven()) b = b.divide(2), r++;\\r\\n next: for (i = 0; i < a.length; i++) {\\r\\n if (n.lesser(a[i])) continue;\\r\\n x = bigInt(a[i]).modPow(b, n);\\r\\n if (x.isUnit() || x.equals(nPrev)) continue;\\r\\n for (d = r - 1; d != 0; d--) {\\r\\n x = x.square().mod(n);\\r\\n if (x.isUnit()) return false;\\r\\n if (x.equals(nPrev)) continue next;\\r\\n }\\r\\n return false;\\r\\n }\\r\\n return true;\\r\\n }\\r\\n\\r\\n // Set \\\"strict\\\" to true to force GRH-supported lower bound of 2*log(N)^2\\r\\n BigInteger.prototype.isPrime = function (strict) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var bits = n.bitLength();\\r\\n if (bits <= 64)\\r\\n return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);\\r\\n var logN = Math.log(2) * bits.toJSNumber();\\r\\n var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt(i + 2));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;\\r\\n\\r\\n BigInteger.prototype.isProbablePrime = function (iterations, rng) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var t = iterations === undefined ? 5 : iterations;\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt.randBetween(2, n.minus(2), rng));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;\\r\\n\\r\\n BigInteger.prototype.modInv = function (n) {\\r\\n var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;\\r\\n while (!newR.isZero()) {\\r\\n q = r.divide(newR);\\r\\n lastT = t;\\r\\n lastR = r;\\r\\n t = newT;\\r\\n r = newR;\\r\\n newT = lastT.subtract(q.multiply(newT));\\r\\n newR = lastR.subtract(q.multiply(newR));\\r\\n }\\r\\n if (!r.isUnit()) throw new Error(this.toString() + \\\" and \\\" + n.toString() + \\\" are not co-prime\\\");\\r\\n if (t.compare(0) === -1) {\\r\\n t = t.add(n);\\r\\n }\\r\\n if (this.isNegative()) {\\r\\n return t.negate();\\r\\n }\\r\\n return t;\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;\\r\\n\\r\\n BigInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n }\\r\\n return new BigInteger(addSmall(value, 1), this.sign);\\r\\n };\\r\\n SmallInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (value + 1 < MAX_INT) return new SmallInteger(value + 1);\\r\\n return new BigInteger(MAX_INT_ARR, false);\\r\\n };\\r\\n NativeBigInt.prototype.next = function () {\\r\\n return new NativeBigInt(this.value + BigInt(1));\\r\\n }\\r\\n\\r\\n BigInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return new BigInteger(addSmall(value, 1), true);\\r\\n }\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n };\\r\\n SmallInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);\\r\\n return new BigInteger(MAX_INT_ARR, true);\\r\\n };\\r\\n NativeBigInt.prototype.prev = function () {\\r\\n return new NativeBigInt(this.value - BigInt(1));\\r\\n }\\r\\n\\r\\n var powersOfTwo = [1];\\r\\n while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);\\r\\n var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];\\r\\n\\r\\n function shift_isSmall(n) {\\r\\n return Math.abs(n) <= BASE;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.shiftLeft = function (v) {\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftRight(-n);\\r\\n var result = this;\\r\\n if (result.isZero()) return result;\\r\\n while (n >= powers2Length) {\\r\\n result = result.multiply(highestPower2);\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n return result.multiply(powersOfTwo[n]);\\r\\n };\\r\\n NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;\\r\\n\\r\\n BigInteger.prototype.shiftRight = function (v) {\\r\\n var remQuo;\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftLeft(-n);\\r\\n var result = this;\\r\\n while (n >= powers2Length) {\\r\\n if (result.isZero() || (result.isNegative() && result.isUnit())) return result;\\r\\n remQuo = divModAny(result, highestPower2);\\r\\n result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n remQuo = divModAny(result, powersOfTwo[n]);\\r\\n return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n };\\r\\n NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;\\r\\n\\r\\n function bitwise(x, y, fn) {\\r\\n y = parseValue(y);\\r\\n var xSign = x.isNegative(), ySign = y.isNegative();\\r\\n var xRem = xSign ? x.not() : x,\\r\\n yRem = ySign ? y.not() : y;\\r\\n var xDigit = 0, yDigit = 0;\\r\\n var xDivMod = null, yDivMod = null;\\r\\n var result = [];\\r\\n while (!xRem.isZero() || !yRem.isZero()) {\\r\\n xDivMod = divModAny(xRem, highestPower2);\\r\\n xDigit = xDivMod[1].toJSNumber();\\r\\n if (xSign) {\\r\\n xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n yDivMod = divModAny(yRem, highestPower2);\\r\\n yDigit = yDivMod[1].toJSNumber();\\r\\n if (ySign) {\\r\\n yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n xRem = xDivMod[0];\\r\\n yRem = yDivMod[0];\\r\\n result.push(fn(xDigit, yDigit));\\r\\n }\\r\\n var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);\\r\\n for (var i = result.length - 1; i >= 0; i -= 1) {\\r\\n sum = sum.multiply(highestPower2).add(bigInt(result[i]));\\r\\n }\\r\\n return sum;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.not = function () {\\r\\n return this.negate().prev();\\r\\n };\\r\\n NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;\\r\\n\\r\\n BigInteger.prototype.and = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a & b; });\\r\\n };\\r\\n NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;\\r\\n\\r\\n BigInteger.prototype.or = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a | b; });\\r\\n };\\r\\n NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;\\r\\n\\r\\n BigInteger.prototype.xor = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a ^ b; });\\r\\n };\\r\\n NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;\\r\\n\\r\\n var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;\\r\\n function roughLOB(n) { // get lowestOneBit (rough)\\r\\n // SmallInteger: return Min(lowestOneBit(n), 1 << 30)\\r\\n // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]\\r\\n var v = n.value,\\r\\n x = typeof v === \\\"number\\\" ? v | LOBMASK_I :\\r\\n typeof v === \\\"bigint\\\" ? v | BigInt(LOBMASK_I) :\\r\\n v[0] + v[1] * BASE | LOBMASK_BI;\\r\\n return x & -x;\\r\\n }\\r\\n\\r\\n function integerLogarithm(value, base) {\\r\\n if (base.compareTo(value) <= 0) {\\r\\n var tmp = integerLogarithm(value, base.square(base));\\r\\n var p = tmp.p;\\r\\n var e = tmp.e;\\r\\n var t = p.multiply(base);\\r\\n return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };\\r\\n }\\r\\n return { p: bigInt(1), e: 0 };\\r\\n }\\r\\n\\r\\n BigInteger.prototype.bitLength = function () {\\r\\n var n = this;\\r\\n if (n.compareTo(bigInt(0)) < 0) {\\r\\n n = n.negate().subtract(bigInt(1));\\r\\n }\\r\\n if (n.compareTo(bigInt(0)) === 0) {\\r\\n return bigInt(0);\\r\\n }\\r\\n return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));\\r\\n }\\r\\n NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;\\r\\n\\r\\n function max(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.greater(b) ? a : b;\\r\\n }\\r\\n function min(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.lesser(b) ? a : b;\\r\\n }\\r\\n function gcd(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n if (a.equals(b)) return a;\\r\\n if (a.isZero()) return b;\\r\\n if (b.isZero()) return a;\\r\\n var c = Integer[1], d, t;\\r\\n while (a.isEven() && b.isEven()) {\\r\\n d = min(roughLOB(a), roughLOB(b));\\r\\n a = a.divide(d);\\r\\n b = b.divide(d);\\r\\n c = c.multiply(d);\\r\\n }\\r\\n while (a.isEven()) {\\r\\n a = a.divide(roughLOB(a));\\r\\n }\\r\\n do {\\r\\n while (b.isEven()) {\\r\\n b = b.divide(roughLOB(b));\\r\\n }\\r\\n if (a.greater(b)) {\\r\\n t = b; b = a; a = t;\\r\\n }\\r\\n b = b.subtract(a);\\r\\n } while (!b.isZero());\\r\\n return c.isUnit() ? a : a.multiply(c);\\r\\n }\\r\\n function lcm(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n return a.divide(gcd(a, b)).multiply(b);\\r\\n }\\r\\n function randBetween(a, b, rng) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n var usedRNG = rng || Math.random;\\r\\n var low = min(a, b), high = max(a, b);\\r\\n var range = high.subtract(low).add(1);\\r\\n if (range.isSmall) return low.add(Math.floor(usedRNG() * range));\\r\\n var digits = toBase(range, BASE).value;\\r\\n var result = [], restricted = true;\\r\\n for (var i = 0; i < digits.length; i++) {\\r\\n var top = restricted ? digits[i] : BASE;\\r\\n var digit = truncate(usedRNG() * top);\\r\\n result.push(digit);\\r\\n if (digit < top) restricted = false;\\r\\n }\\r\\n return low.add(Integer.fromArray(result, BASE, false));\\r\\n }\\r\\n\\r\\n var parseBase = function (text, base, alphabet, caseSensitive) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n text = String(text);\\r\\n if (!caseSensitive) {\\r\\n text = text.toLowerCase();\\r\\n alphabet = alphabet.toLowerCase();\\r\\n }\\r\\n var length = text.length;\\r\\n var i;\\r\\n var absBase = Math.abs(base);\\r\\n var alphabetValues = {};\\r\\n for (i = 0; i < alphabet.length; i++) {\\r\\n alphabetValues[alphabet[i]] = i;\\r\\n }\\r\\n for (i = 0; i < length; i++) {\\r\\n var c = text[i];\\r\\n if (c === \\\"-\\\") continue;\\r\\n if (c in alphabetValues) {\\r\\n if (alphabetValues[c] >= absBase) {\\r\\n if (c === \\\"1\\\" && absBase === 1) continue;\\r\\n throw new Error(c + \\\" is not a valid digit in base \\\" + base + \\\".\\\");\\r\\n }\\r\\n }\\r\\n }\\r\\n base = parseValue(base);\\r\\n var digits = [];\\r\\n var isNegative = text[0] === \\\"-\\\";\\r\\n for (i = isNegative ? 1 : 0; i < text.length; i++) {\\r\\n var c = text[i];\\r\\n if (c in alphabetValues) digits.push(parseValue(alphabetValues[c]));\\r\\n else if (c === \\\"<\\\") {\\r\\n var start = i;\\r\\n do { i++; } while (text[i] !== \\\">\\\" && i < text.length);\\r\\n digits.push(parseValue(text.slice(start + 1, i)));\\r\\n }\\r\\n else throw new Error(c + \\\" is not a valid character\\\");\\r\\n }\\r\\n return parseBaseFromArray(digits, base, isNegative);\\r\\n };\\r\\n\\r\\n function parseBaseFromArray(digits, base, isNegative) {\\r\\n var val = Integer[0], pow = Integer[1], i;\\r\\n for (i = digits.length - 1; i >= 0; i--) {\\r\\n val = val.add(digits[i].times(pow));\\r\\n pow = pow.times(base);\\r\\n }\\r\\n return isNegative ? val.negate() : val;\\r\\n }\\r\\n\\r\\n function stringify(digit, alphabet) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n if (digit < alphabet.length) {\\r\\n return alphabet[digit];\\r\\n }\\r\\n return \\\"<\\\" + digit + \\\">\\\";\\r\\n }\\r\\n\\r\\n function toBase(n, base) {\\r\\n base = bigInt(base);\\r\\n if (base.isZero()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n throw new Error(\\\"Cannot convert nonzero numbers to base 0.\\\");\\r\\n }\\r\\n if (base.equals(-1)) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n if (n.isNegative())\\r\\n return {\\r\\n value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber()))\\r\\n .map(Array.prototype.valueOf, [1, 0])\\r\\n ),\\r\\n isNegative: false\\r\\n };\\r\\n\\r\\n var arr = Array.apply(null, Array(n.toJSNumber() - 1))\\r\\n .map(Array.prototype.valueOf, [0, 1]);\\r\\n arr.unshift([1]);\\r\\n return {\\r\\n value: [].concat.apply([], arr),\\r\\n isNegative: false\\r\\n };\\r\\n }\\r\\n\\r\\n var neg = false;\\r\\n if (n.isNegative() && base.isPositive()) {\\r\\n neg = true;\\r\\n n = n.abs();\\r\\n }\\r\\n if (base.isUnit()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n\\r\\n return {\\r\\n value: Array.apply(null, Array(n.toJSNumber()))\\r\\n .map(Number.prototype.valueOf, 1),\\r\\n isNegative: neg\\r\\n };\\r\\n }\\r\\n var out = [];\\r\\n var left = n, divmod;\\r\\n while (left.isNegative() || left.compareAbs(base) >= 0) {\\r\\n divmod = left.divmod(base);\\r\\n left = divmod.quotient;\\r\\n var digit = divmod.remainder;\\r\\n if (digit.isNegative()) {\\r\\n digit = base.minus(digit).abs();\\r\\n left = left.next();\\r\\n }\\r\\n out.push(digit.toJSNumber());\\r\\n }\\r\\n out.push(left.toJSNumber());\\r\\n return { value: out.reverse(), isNegative: neg };\\r\\n }\\r\\n\\r\\n function toBaseString(n, base, alphabet) {\\r\\n var arr = toBase(n, base);\\r\\n return (arr.isNegative ? \\\"-\\\" : \\\"\\\") + arr.value.map(function (x) {\\r\\n return stringify(x, alphabet);\\r\\n }).join('');\\r\\n }\\r\\n\\r\\n BigInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix !== 10) return toBaseString(this, radix, alphabet);\\r\\n var v = this.value, l = v.length, str = String(v[--l]), zeros = \\\"0000000\\\", digit;\\r\\n while (--l >= 0) {\\r\\n digit = String(v[l]);\\r\\n str += zeros.slice(digit.length) + digit;\\r\\n }\\r\\n var sign = this.sign ? \\\"-\\\" : \\\"\\\";\\r\\n return sign + str;\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix != 10) return toBaseString(this, radix, alphabet);\\r\\n return String(this.value);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toString = SmallInteger.prototype.toString;\\r\\n\\r\\n NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }\\r\\n\\r\\n BigInteger.prototype.valueOf = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n };\\r\\n BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;\\r\\n\\r\\n SmallInteger.prototype.valueOf = function () {\\r\\n return this.value;\\r\\n };\\r\\n SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;\\r\\n NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n }\\r\\n\\r\\n function parseStringValue(v) {\\r\\n if (isPrecise(+v)) {\\r\\n var x = +v;\\r\\n if (x === truncate(x))\\r\\n return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);\\r\\n throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n }\\r\\n var sign = v[0] === \\\"-\\\";\\r\\n if (sign) v = v.slice(1);\\r\\n var split = v.split(/e/i);\\r\\n if (split.length > 2) throw new Error(\\\"Invalid integer: \\\" + split.join(\\\"e\\\"));\\r\\n if (split.length === 2) {\\r\\n var exp = split[1];\\r\\n if (exp[0] === \\\"+\\\") exp = exp.slice(1);\\r\\n exp = +exp;\\r\\n if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error(\\\"Invalid integer: \\\" + exp + \\\" is not a valid exponent.\\\");\\r\\n var text = split[0];\\r\\n var decimalPlace = text.indexOf(\\\".\\\");\\r\\n if (decimalPlace >= 0) {\\r\\n exp -= text.length - decimalPlace - 1;\\r\\n text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);\\r\\n }\\r\\n if (exp < 0) throw new Error(\\\"Cannot include negative exponent part for integers\\\");\\r\\n text += (new Array(exp + 1)).join(\\\"0\\\");\\r\\n v = text;\\r\\n }\\r\\n var isValid = /^([0-9][0-9]*)$/.test(v);\\r\\n if (!isValid) throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(sign ? \\\"-\\\" + v : v));\\r\\n }\\r\\n var r = [], max = v.length, l = LOG_BASE, min = max - l;\\r\\n while (max > 0) {\\r\\n r.push(+v.slice(min, max));\\r\\n min -= l;\\r\\n if (min < 0) min = 0;\\r\\n max -= l;\\r\\n }\\r\\n trim(r);\\r\\n return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n function parseNumberValue(v) {\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(v));\\r\\n }\\r\\n if (isPrecise(v)) {\\r\\n if (v !== truncate(v)) throw new Error(v + \\\" is not an integer.\\\");\\r\\n return new SmallInteger(v);\\r\\n }\\r\\n return parseStringValue(v.toString());\\r\\n }\\r\\n\\r\\n function parseValue(v) {\\r\\n if (typeof v === \\\"number\\\") {\\r\\n return parseNumberValue(v);\\r\\n }\\r\\n if (typeof v === \\\"string\\\") {\\r\\n return parseStringValue(v);\\r\\n }\\r\\n if (typeof v === \\\"bigint\\\") {\\r\\n return new NativeBigInt(v);\\r\\n }\\r\\n return v;\\r\\n }\\r\\n // Pre-define numbers in range [-999,999]\\r\\n for (var i = 0; i < 1000; i++) {\\r\\n Integer[i] = parseValue(i);\\r\\n if (i > 0) Integer[-i] = parseValue(-i);\\r\\n }\\r\\n // Backwards compatibility\\r\\n Integer.one = Integer[1];\\r\\n Integer.zero = Integer[0];\\r\\n Integer.minusOne = Integer[-1];\\r\\n Integer.max = max;\\r\\n Integer.min = min;\\r\\n Integer.gcd = gcd;\\r\\n Integer.lcm = lcm;\\r\\n Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; };\\r\\n Integer.randBetween = randBetween;\\r\\n\\r\\n Integer.fromArray = function (digits, base, isNegative) {\\r\\n return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);\\r\\n };\\r\\n\\r\\n return Integer;\\r\\n})();\\r\\n\\r\\n// Node.js check\\r\\nif ( true && module.hasOwnProperty(\\\"exports\\\")) {\\r\\n module.exports = bigInt;\\r\\n}\\r\\n\\r\\n//amd check\\r\\nif (true) {\\r\\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\\r\\n return bigInt;\\r\\n }).call(exports, __webpack_require__, exports, module),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\r\\n}\\r\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \\\"./node_modules/webpack/buildin/module.js\\\")(module)))\\n\\n//# sourceURL=webpack:///./node_modules/big-integer/BigInteger.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/webpack/buildin/module.js\":\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = function(module) {\\n\\tif (!module.webpackPolyfill) {\\n\\t\\tmodule.deprecate = function() {};\\n\\t\\tmodule.paths = [];\\n\\t\\t// module.parent = undefined by default\\n\\t\\tif (!module.children) module.children = [];\\n\\t\\tObject.defineProperty(module, \\\"loaded\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.l;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tObject.defineProperty(module, \\\"id\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.i;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tmodule.webpackPolyfill = 1;\\n\\t}\\n\\treturn module;\\n};\\n\\n\\n//# sourceURL=webpack:///(webpack)/buildin/module.js?\");\n\n/***/ }),\n\n/***/ \"./src/hitachi2020/B.js\":\n/*!******************************!*\\\n !*** ./src/hitachi2020/B.js ***!\n \\******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\\n\\nfunction _nonIterableRest() { throw new TypeError(\\\"Invalid attempt to destructure non-iterable instance\\\"); }\\n\\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \\\"[object Arguments]\\\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\\\"return\\\"] != null) _i[\\\"return\\\"](); } finally { if (_d) throw _e; } } return _arr; }\\n\\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\\n\\nvar fs = __webpack_require__(/*! fs */ \\\"fs\\\");\\n\\nvar bigint = __webpack_require__(/*! big-integer */ \\\"./node_modules/big-integer/BigInteger.js\\\");\\n\\nvar main = function main(input) {\\n var lines = input.split('\\\\n');\\n\\n var _lines$shift$split$ma = lines.shift().split(' ').map(function (i) {\\n return i - 0;\\n }),\\n _lines$shift$split$ma2 = _slicedToArray(_lines$shift$split$ma, 3),\\n A = _lines$shift$split$ma2[0],\\n B = _lines$shift$split$ma2[1],\\n M = _lines$shift$split$ma2[2];\\n\\n var APrice = lines.shift().split(' ').map(function (i) {\\n return i - 0;\\n });\\n var BPrice = lines.shift().split(' ').map(function (i) {\\n return i - 0;\\n });\\n var lower = {};\\n\\n for (var a = 0; a < APrice.length; a++) {\\n for (var b = 0; b < BPrice.length; b++) {\\n lower[`${a},${b}`] = APrice[a] + BPrice[b];\\n }\\n }\\n\\n for (var i = 0; i < M; i++) {\\n var _lines$i$split$map = lines[i].split(' ').map(function (i) {\\n return i - 0;\\n }),\\n _lines$i$split$map2 = _slicedToArray(_lines$i$split$map, 3),\\n x = _lines$i$split$map2[0],\\n y = _lines$i$split$map2[1],\\n c = _lines$i$split$map2[2];\\n\\n x -= 1;\\n y -= 1;\\n var ci = `${x},${y}`;\\n var discount = APrice[x] + BPrice[y] - c;\\n\\n if (lower[ci] > discount) {\\n lower[ci] = discount;\\n }\\n }\\n\\n var answer = null;\\n Object.keys(lower).forEach(function (key) {\\n if (!answer || lower[key] < answer) {\\n answer = lower[key];\\n }\\n });\\n console.log(answer);\\n};\\n\\nmain(fs.readFileSync('/dev/stdin', 'utf8'));\\n\\n//# sourceURL=webpack:///./src/hitachi2020/B.js?\");\n\n/***/ }),\n\n/***/ \"fs\":\n/*!*********************!*\\\n !*** external \"fs\" ***!\n \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = require(\\\"fs\\\");\\n\\n//# sourceURL=webpack:///external_%22fs%22?\");\n\n/***/ })\n\n/******/ });", "language": "JavaScript", "metadata": {"date": 1583716884, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02748.html", "problem_id": "p02748", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02748/input.txt", "sample_output_relpath": "derived/input_output/data/p02748/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02748/JavaScript/s897121590.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s897121590", "user_id": "u279835114"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/hitachi2020/B.js\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/big-integer/BigInteger.js\":\n/*!************************************************!*\\\n !*** ./node_modules/big-integer/BigInteger.js ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;var bigInt = (function (undefined) {\\r\\n \\\"use strict\\\";\\r\\n\\r\\n var BASE = 1e7,\\r\\n LOG_BASE = 7,\\r\\n MAX_INT = 9007199254740992,\\r\\n MAX_INT_ARR = smallToArray(MAX_INT),\\r\\n DEFAULT_ALPHABET = \\\"0123456789abcdefghijklmnopqrstuvwxyz\\\";\\r\\n\\r\\n var supportsNativeBigInt = typeof BigInt === \\\"function\\\";\\r\\n\\r\\n function Integer(v, radix, alphabet, caseSensitive) {\\r\\n if (typeof v === \\\"undefined\\\") return Integer[0];\\r\\n if (typeof radix !== \\\"undefined\\\") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);\\r\\n return parseValue(v);\\r\\n }\\r\\n\\r\\n function BigInteger(value, sign) {\\r\\n this.value = value;\\r\\n this.sign = sign;\\r\\n this.isSmall = false;\\r\\n }\\r\\n BigInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function SmallInteger(value) {\\r\\n this.value = value;\\r\\n this.sign = value < 0;\\r\\n this.isSmall = true;\\r\\n }\\r\\n SmallInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function NativeBigInt(value) {\\r\\n this.value = value;\\r\\n }\\r\\n NativeBigInt.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function isPrecise(n) {\\r\\n return -MAX_INT < n && n < MAX_INT;\\r\\n }\\r\\n\\r\\n function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes\\r\\n if (n < 1e7)\\r\\n return [n];\\r\\n if (n < 1e14)\\r\\n return [n % 1e7, Math.floor(n / 1e7)];\\r\\n return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];\\r\\n }\\r\\n\\r\\n function arrayToSmall(arr) { // If BASE changes this function may need to change\\r\\n trim(arr);\\r\\n var length = arr.length;\\r\\n if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {\\r\\n switch (length) {\\r\\n case 0: return 0;\\r\\n case 1: return arr[0];\\r\\n case 2: return arr[0] + arr[1] * BASE;\\r\\n default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;\\r\\n }\\r\\n }\\r\\n return arr;\\r\\n }\\r\\n\\r\\n function trim(v) {\\r\\n var i = v.length;\\r\\n while (v[--i] === 0);\\r\\n v.length = i + 1;\\r\\n }\\r\\n\\r\\n function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger\\r\\n var x = new Array(length);\\r\\n var i = -1;\\r\\n while (++i < length) {\\r\\n x[i] = 0;\\r\\n }\\r\\n return x;\\r\\n }\\r\\n\\r\\n function truncate(n) {\\r\\n if (n > 0) return Math.floor(n);\\r\\n return Math.ceil(n);\\r\\n }\\r\\n\\r\\n function add(a, b) { // assumes a and b are arrays with a.length >= b.length\\r\\n var l_a = a.length,\\r\\n l_b = b.length,\\r\\n r = new Array(l_a),\\r\\n carry = 0,\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l_b; i++) {\\r\\n sum = a[i] + b[i] + carry;\\r\\n carry = sum >= base ? 1 : 0;\\r\\n r[i] = sum - carry * base;\\r\\n }\\r\\n while (i < l_a) {\\r\\n sum = a[i] + carry;\\r\\n carry = sum === base ? 1 : 0;\\r\\n r[i++] = sum - carry * base;\\r\\n }\\r\\n if (carry > 0) r.push(carry);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function addAny(a, b) {\\r\\n if (a.length >= b.length) return add(a, b);\\r\\n return add(b, a);\\r\\n }\\r\\n\\r\\n function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n sum = a[i] - base + carry;\\r\\n carry = Math.floor(sum / base);\\r\\n r[i] = sum - carry * base;\\r\\n carry += 1;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new BigInteger(addSmall(a, Math.abs(b)), this.sign);\\r\\n }\\r\\n return new BigInteger(addAny(a, b), this.sign);\\r\\n };\\r\\n BigInteger.prototype.plus = BigInteger.prototype.add;\\r\\n\\r\\n SmallInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n if (isPrecise(a + b)) return new SmallInteger(a + b);\\r\\n b = smallToArray(Math.abs(b));\\r\\n }\\r\\n return new BigInteger(addSmall(b, Math.abs(a)), a < 0);\\r\\n };\\r\\n SmallInteger.prototype.plus = SmallInteger.prototype.add;\\r\\n\\r\\n NativeBigInt.prototype.add = function (v) {\\r\\n return new NativeBigInt(this.value + parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.plus = NativeBigInt.prototype.add;\\r\\n\\r\\n function subtract(a, b) { // assumes a and b are arrays with a >= b\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n r = new Array(a_l),\\r\\n borrow = 0,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < b_l; i++) {\\r\\n difference = a[i] - borrow - b[i];\\r\\n if (difference < 0) {\\r\\n difference += base;\\r\\n borrow = 1;\\r\\n } else borrow = 0;\\r\\n r[i] = difference;\\r\\n }\\r\\n for (i = b_l; i < a_l; i++) {\\r\\n difference = a[i] - borrow;\\r\\n if (difference < 0) difference += base;\\r\\n else {\\r\\n r[i++] = difference;\\r\\n break;\\r\\n }\\r\\n r[i] = difference;\\r\\n }\\r\\n for (; i < a_l; i++) {\\r\\n r[i] = a[i];\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function subtractAny(a, b, sign) {\\r\\n var value;\\r\\n if (compareAbs(a, b) >= 0) {\\r\\n value = subtract(a, b);\\r\\n } else {\\r\\n value = subtract(b, a);\\r\\n sign = !sign;\\r\\n }\\r\\n value = arrayToSmall(value);\\r\\n if (typeof value === \\\"number\\\") {\\r\\n if (sign) value = -value;\\r\\n return new SmallInteger(value);\\r\\n }\\r\\n return new BigInteger(value, sign);\\r\\n }\\r\\n\\r\\n function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n carry = -b,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < l; i++) {\\r\\n difference = a[i] + carry;\\r\\n carry = Math.floor(difference / base);\\r\\n difference %= base;\\r\\n r[i] = difference < 0 ? difference + base : difference;\\r\\n }\\r\\n r = arrayToSmall(r);\\r\\n if (typeof r === \\\"number\\\") {\\r\\n if (sign) r = -r;\\r\\n return new SmallInteger(r);\\r\\n } return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall)\\r\\n return subtractSmall(a, Math.abs(b), this.sign);\\r\\n return subtractAny(a, b, this.sign);\\r\\n };\\r\\n BigInteger.prototype.minus = BigInteger.prototype.subtract;\\r\\n\\r\\n SmallInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new SmallInteger(a - b);\\r\\n }\\r\\n return subtractSmall(b, Math.abs(a), a >= 0);\\r\\n };\\r\\n SmallInteger.prototype.minus = SmallInteger.prototype.subtract;\\r\\n\\r\\n NativeBigInt.prototype.subtract = function (v) {\\r\\n return new NativeBigInt(this.value - parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;\\r\\n\\r\\n BigInteger.prototype.negate = function () {\\r\\n return new BigInteger(this.value, !this.sign);\\r\\n };\\r\\n SmallInteger.prototype.negate = function () {\\r\\n var sign = this.sign;\\r\\n var small = new SmallInteger(-this.value);\\r\\n small.sign = !sign;\\r\\n return small;\\r\\n };\\r\\n NativeBigInt.prototype.negate = function () {\\r\\n return new NativeBigInt(-this.value);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.abs = function () {\\r\\n return new BigInteger(this.value, false);\\r\\n };\\r\\n SmallInteger.prototype.abs = function () {\\r\\n return new SmallInteger(Math.abs(this.value));\\r\\n };\\r\\n NativeBigInt.prototype.abs = function () {\\r\\n return new NativeBigInt(this.value >= 0 ? this.value : -this.value);\\r\\n }\\r\\n\\r\\n\\r\\n function multiplyLong(a, b) {\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n l = a_l + b_l,\\r\\n r = createArray(l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, b_j;\\r\\n for (i = 0; i < a_l; ++i) {\\r\\n a_i = a[i];\\r\\n for (var j = 0; j < b_l; ++j) {\\r\\n b_j = b[j];\\r\\n product = a_i * b_j + r[i + j];\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n r[i + j + 1] += carry;\\r\\n }\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n carry = 0,\\r\\n product, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n product = a[i] * b + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i] = product - carry * base;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n function shiftLeft(x, n) {\\r\\n var r = [];\\r\\n while (n-- > 0) r.push(0);\\r\\n return r.concat(x);\\r\\n }\\r\\n\\r\\n function multiplyKaratsuba(x, y) {\\r\\n var n = Math.max(x.length, y.length);\\r\\n\\r\\n if (n <= 30) return multiplyLong(x, y);\\r\\n n = Math.ceil(n / 2);\\r\\n\\r\\n var b = x.slice(n),\\r\\n a = x.slice(0, n),\\r\\n d = y.slice(n),\\r\\n c = y.slice(0, n);\\r\\n\\r\\n var ac = multiplyKaratsuba(a, c),\\r\\n bd = multiplyKaratsuba(b, d),\\r\\n abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));\\r\\n\\r\\n var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));\\r\\n trim(product);\\r\\n return product;\\r\\n }\\r\\n\\r\\n // The following function is derived from a surface fit of a graph plotting the performance difference\\r\\n // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.\\r\\n function useKaratsuba(l1, l2) {\\r\\n return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.multiply = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value, b = n.value,\\r\\n sign = this.sign !== n.sign,\\r\\n abs;\\r\\n if (n.isSmall) {\\r\\n if (b === 0) return Integer[0];\\r\\n if (b === 1) return this;\\r\\n if (b === -1) return this.negate();\\r\\n abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n return new BigInteger(multiplySmall(a, abs), sign);\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes\\r\\n return new BigInteger(multiplyKaratsuba(a, b), sign);\\r\\n return new BigInteger(multiplyLong(a, b), sign);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.times = BigInteger.prototype.multiply;\\r\\n\\r\\n function multiplySmallAndArray(a, b, sign) { // a >= 0\\r\\n if (a < BASE) {\\r\\n return new BigInteger(multiplySmall(b, a), sign);\\r\\n }\\r\\n return new BigInteger(multiplyLong(b, smallToArray(a)), sign);\\r\\n }\\r\\n SmallInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (isPrecise(a.value * this.value)) {\\r\\n return new SmallInteger(a.value * this.value);\\r\\n }\\r\\n return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);\\r\\n };\\r\\n BigInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (a.value === 0) return Integer[0];\\r\\n if (a.value === 1) return this;\\r\\n if (a.value === -1) return this.negate();\\r\\n return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);\\r\\n };\\r\\n SmallInteger.prototype.multiply = function (v) {\\r\\n return parseValue(v)._multiplyBySmall(this);\\r\\n };\\r\\n SmallInteger.prototype.times = SmallInteger.prototype.multiply;\\r\\n\\r\\n NativeBigInt.prototype.multiply = function (v) {\\r\\n return new NativeBigInt(this.value * parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;\\r\\n\\r\\n function square(a) {\\r\\n //console.assert(2 * BASE * BASE < MAX_INT);\\r\\n var l = a.length,\\r\\n r = createArray(l + l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, a_j;\\r\\n for (i = 0; i < l; i++) {\\r\\n a_i = a[i];\\r\\n carry = 0 - a_i * a_i;\\r\\n for (var j = i; j < l; j++) {\\r\\n a_j = a[j];\\r\\n product = 2 * (a_i * a_j) + r[i + j] + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n }\\r\\n r[i + l] = carry;\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.square = function () {\\r\\n return new BigInteger(square(this.value), false);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.square = function () {\\r\\n var value = this.value * this.value;\\r\\n if (isPrecise(value)) return new SmallInteger(value);\\r\\n return new BigInteger(square(smallToArray(Math.abs(this.value))), false);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.square = function (v) {\\r\\n return new NativeBigInt(this.value * this.value);\\r\\n }\\r\\n\\r\\n function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n base = BASE,\\r\\n result = createArray(b.length),\\r\\n divisorMostSignificantDigit = b[b_l - 1],\\r\\n // normalization\\r\\n lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),\\r\\n remainder = multiplySmall(a, lambda),\\r\\n divisor = multiplySmall(b, lambda),\\r\\n quotientDigit, shift, carry, borrow, i, l, q;\\r\\n if (remainder.length <= a_l) remainder.push(0);\\r\\n divisor.push(0);\\r\\n divisorMostSignificantDigit = divisor[b_l - 1];\\r\\n for (shift = a_l - b_l; shift >= 0; shift--) {\\r\\n quotientDigit = base - 1;\\r\\n if (remainder[shift + b_l] !== divisorMostSignificantDigit) {\\r\\n quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);\\r\\n }\\r\\n // quotientDigit <= base - 1\\r\\n carry = 0;\\r\\n borrow = 0;\\r\\n l = divisor.length;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += quotientDigit * divisor[i];\\r\\n q = Math.floor(carry / base);\\r\\n borrow += remainder[shift + i] - (carry - q * base);\\r\\n carry = q;\\r\\n if (borrow < 0) {\\r\\n remainder[shift + i] = borrow + base;\\r\\n borrow = -1;\\r\\n } else {\\r\\n remainder[shift + i] = borrow;\\r\\n borrow = 0;\\r\\n }\\r\\n }\\r\\n while (borrow !== 0) {\\r\\n quotientDigit -= 1;\\r\\n carry = 0;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += remainder[shift + i] - base + divisor[i];\\r\\n if (carry < 0) {\\r\\n remainder[shift + i] = carry + base;\\r\\n carry = 0;\\r\\n } else {\\r\\n remainder[shift + i] = carry;\\r\\n carry = 1;\\r\\n }\\r\\n }\\r\\n borrow += carry;\\r\\n }\\r\\n result[shift] = quotientDigit;\\r\\n }\\r\\n // denormalization\\r\\n remainder = divModSmall(remainder, lambda)[0];\\r\\n return [arrayToSmall(result), arrayToSmall(remainder)];\\r\\n }\\r\\n\\r\\n function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/\\r\\n // Performs faster than divMod1 on larger input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n result = [],\\r\\n part = [],\\r\\n base = BASE,\\r\\n guess, xlen, highx, highy, check;\\r\\n while (a_l) {\\r\\n part.unshift(a[--a_l]);\\r\\n trim(part);\\r\\n if (compareAbs(part, b) < 0) {\\r\\n result.push(0);\\r\\n continue;\\r\\n }\\r\\n xlen = part.length;\\r\\n highx = part[xlen - 1] * base + part[xlen - 2];\\r\\n highy = b[b_l - 1] * base + b[b_l - 2];\\r\\n if (xlen > b_l) {\\r\\n highx = (highx + 1) * base;\\r\\n }\\r\\n guess = Math.ceil(highx / highy);\\r\\n do {\\r\\n check = multiplySmall(b, guess);\\r\\n if (compareAbs(check, part) <= 0) break;\\r\\n guess--;\\r\\n } while (guess);\\r\\n result.push(guess);\\r\\n part = subtract(part, check);\\r\\n }\\r\\n result.reverse();\\r\\n return [arrayToSmall(result), arrayToSmall(part)];\\r\\n }\\r\\n\\r\\n function divModSmall(value, lambda) {\\r\\n var length = value.length,\\r\\n quotient = createArray(length),\\r\\n base = BASE,\\r\\n i, q, remainder, divisor;\\r\\n remainder = 0;\\r\\n for (i = length - 1; i >= 0; --i) {\\r\\n divisor = remainder * base + value[i];\\r\\n q = truncate(divisor / lambda);\\r\\n remainder = divisor - q * lambda;\\r\\n quotient[i] = q | 0;\\r\\n }\\r\\n return [quotient, remainder | 0];\\r\\n }\\r\\n\\r\\n function divModAny(self, v) {\\r\\n var value, n = parseValue(v);\\r\\n if (supportsNativeBigInt) {\\r\\n return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)];\\r\\n }\\r\\n var a = self.value, b = n.value;\\r\\n var quotient;\\r\\n if (b === 0) throw new Error(\\\"Cannot divide by zero\\\");\\r\\n if (self.isSmall) {\\r\\n if (n.isSmall) {\\r\\n return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];\\r\\n }\\r\\n return [Integer[0], self];\\r\\n }\\r\\n if (n.isSmall) {\\r\\n if (b === 1) return [self, Integer[0]];\\r\\n if (b == -1) return [self.negate(), Integer[0]];\\r\\n var abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n value = divModSmall(a, abs);\\r\\n quotient = arrayToSmall(value[0]);\\r\\n var remainder = value[1];\\r\\n if (self.sign) remainder = -remainder;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (self.sign !== n.sign) quotient = -quotient;\\r\\n return [new SmallInteger(quotient), new SmallInteger(remainder)];\\r\\n }\\r\\n return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n var comparison = compareAbs(a, b);\\r\\n if (comparison === -1) return [Integer[0], self];\\r\\n if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];\\r\\n\\r\\n // divMod1 is faster on smaller input sizes\\r\\n if (a.length + b.length <= 200)\\r\\n value = divMod1(a, b);\\r\\n else value = divMod2(a, b);\\r\\n\\r\\n quotient = value[0];\\r\\n var qSign = self.sign !== n.sign,\\r\\n mod = value[1],\\r\\n mSign = self.sign;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (qSign) quotient = -quotient;\\r\\n quotient = new SmallInteger(quotient);\\r\\n } else quotient = new BigInteger(quotient, qSign);\\r\\n if (typeof mod === \\\"number\\\") {\\r\\n if (mSign) mod = -mod;\\r\\n mod = new SmallInteger(mod);\\r\\n } else mod = new BigInteger(mod, mSign);\\r\\n return [quotient, mod];\\r\\n }\\r\\n\\r\\n BigInteger.prototype.divmod = function (v) {\\r\\n var result = divModAny(this, v);\\r\\n return {\\r\\n quotient: result[0],\\r\\n remainder: result[1]\\r\\n };\\r\\n };\\r\\n NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;\\r\\n\\r\\n\\r\\n BigInteger.prototype.divide = function (v) {\\r\\n return divModAny(this, v)[0];\\r\\n };\\r\\n NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {\\r\\n return new NativeBigInt(this.value / parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;\\r\\n\\r\\n BigInteger.prototype.mod = function (v) {\\r\\n return divModAny(this, v)[1];\\r\\n };\\r\\n NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {\\r\\n return new NativeBigInt(this.value % parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;\\r\\n\\r\\n BigInteger.prototype.pow = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value,\\r\\n value, x, y;\\r\\n if (b === 0) return Integer[1];\\r\\n if (a === 0) return Integer[0];\\r\\n if (a === 1) return Integer[1];\\r\\n if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.sign) {\\r\\n return Integer[0];\\r\\n }\\r\\n if (!n.isSmall) throw new Error(\\\"The exponent \\\" + n.toString() + \\\" is too large.\\\");\\r\\n if (this.isSmall) {\\r\\n if (isPrecise(value = Math.pow(a, b)))\\r\\n return new SmallInteger(truncate(value));\\r\\n }\\r\\n x = this;\\r\\n y = Integer[1];\\r\\n while (true) {\\r\\n if (b & 1 === 1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === 0) break;\\r\\n b /= 2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n };\\r\\n SmallInteger.prototype.pow = BigInteger.prototype.pow;\\r\\n\\r\\n NativeBigInt.prototype.pow = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value, b = n.value;\\r\\n var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);\\r\\n if (b === _0) return Integer[1];\\r\\n if (a === _0) return Integer[0];\\r\\n if (a === _1) return Integer[1];\\r\\n if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.isNegative()) return new NativeBigInt(_0);\\r\\n var x = this;\\r\\n var y = Integer[1];\\r\\n while (true) {\\r\\n if ((b & _1) === _1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === _0) break;\\r\\n b /= _2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.modPow = function (exp, mod) {\\r\\n exp = parseValue(exp);\\r\\n mod = parseValue(mod);\\r\\n if (mod.isZero()) throw new Error(\\\"Cannot take modPow with modulus 0\\\");\\r\\n var r = Integer[1],\\r\\n base = this.mod(mod);\\r\\n if (exp.isNegative()) {\\r\\n exp = exp.multiply(Integer[-1]);\\r\\n base = base.modInv(mod);\\r\\n }\\r\\n while (exp.isPositive()) {\\r\\n if (base.isZero()) return Integer[0];\\r\\n if (exp.isOdd()) r = r.multiply(base).mod(mod);\\r\\n exp = exp.divide(2);\\r\\n base = base.square().mod(mod);\\r\\n }\\r\\n return r;\\r\\n };\\r\\n NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;\\r\\n\\r\\n function compareAbs(a, b) {\\r\\n if (a.length !== b.length) {\\r\\n return a.length > b.length ? 1 : -1;\\r\\n }\\r\\n for (var i = a.length - 1; i >= 0; i--) {\\r\\n if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;\\r\\n }\\r\\n return 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) return 1;\\r\\n return compareAbs(a, b);\\r\\n };\\r\\n SmallInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = Math.abs(this.value),\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n b = Math.abs(b);\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n return -1;\\r\\n };\\r\\n NativeBigInt.prototype.compareAbs = function (v) {\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n a = a >= 0 ? a : -a;\\r\\n b = b >= 0 ? b : -b;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compare = function (v) {\\r\\n // See discussion about comparison with Infinity:\\r\\n // https://github.com/peterolson/BigInteger.js/issues/61\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (this.sign !== n.sign) {\\r\\n return n.sign ? 1 : -1;\\r\\n }\\r\\n if (n.isSmall) {\\r\\n return this.sign ? -1 : 1;\\r\\n }\\r\\n return compareAbs(a, b) * (this.sign ? -1 : 1);\\r\\n };\\r\\n BigInteger.prototype.compareTo = BigInteger.prototype.compare;\\r\\n\\r\\n SmallInteger.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n return a == b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n if (a < 0 !== n.sign) {\\r\\n return a < 0 ? -1 : 1;\\r\\n }\\r\\n return a < 0 ? 1 : -1;\\r\\n };\\r\\n SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;\\r\\n\\r\\n NativeBigInt.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;\\r\\n\\r\\n BigInteger.prototype.equals = function (v) {\\r\\n return this.compare(v) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;\\r\\n\\r\\n BigInteger.prototype.notEquals = function (v) {\\r\\n return this.compare(v) !== 0;\\r\\n };\\r\\n NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;\\r\\n\\r\\n BigInteger.prototype.greater = function (v) {\\r\\n return this.compare(v) > 0;\\r\\n };\\r\\n NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;\\r\\n\\r\\n BigInteger.prototype.lesser = function (v) {\\r\\n return this.compare(v) < 0;\\r\\n };\\r\\n NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;\\r\\n\\r\\n BigInteger.prototype.greaterOrEquals = function (v) {\\r\\n return this.compare(v) >= 0;\\r\\n };\\r\\n NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;\\r\\n\\r\\n BigInteger.prototype.lesserOrEquals = function (v) {\\r\\n return this.compare(v) <= 0;\\r\\n };\\r\\n NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;\\r\\n\\r\\n BigInteger.prototype.isEven = function () {\\r\\n return (this.value[0] & 1) === 0;\\r\\n };\\r\\n SmallInteger.prototype.isEven = function () {\\r\\n return (this.value & 1) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isEven = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isOdd = function () {\\r\\n return (this.value[0] & 1) === 1;\\r\\n };\\r\\n SmallInteger.prototype.isOdd = function () {\\r\\n return (this.value & 1) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isOdd = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isPositive = function () {\\r\\n return !this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isPositive = function () {\\r\\n return this.value > 0;\\r\\n };\\r\\n NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;\\r\\n\\r\\n BigInteger.prototype.isNegative = function () {\\r\\n return this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isNegative = function () {\\r\\n return this.value < 0;\\r\\n };\\r\\n NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;\\r\\n\\r\\n BigInteger.prototype.isUnit = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isUnit = function () {\\r\\n return Math.abs(this.value) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isUnit = function () {\\r\\n return this.abs().value === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isZero = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isZero = function () {\\r\\n return this.value === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isZero = function () {\\r\\n return this.value === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isDivisibleBy = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (n.isZero()) return false;\\r\\n if (n.isUnit()) return true;\\r\\n if (n.compareAbs(2) === 0) return this.isEven();\\r\\n return this.mod(n).isZero();\\r\\n };\\r\\n NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;\\r\\n\\r\\n function isBasicPrime(v) {\\r\\n var n = v.abs();\\r\\n if (n.isUnit()) return false;\\r\\n if (n.equals(2) || n.equals(3) || n.equals(5)) return true;\\r\\n if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;\\r\\n if (n.lesser(49)) return true;\\r\\n // we don't know if it's prime: let the other functions figure it out\\r\\n }\\r\\n\\r\\n function millerRabinTest(n, a) {\\r\\n var nPrev = n.prev(),\\r\\n b = nPrev,\\r\\n r = 0,\\r\\n d, t, i, x;\\r\\n while (b.isEven()) b = b.divide(2), r++;\\r\\n next: for (i = 0; i < a.length; i++) {\\r\\n if (n.lesser(a[i])) continue;\\r\\n x = bigInt(a[i]).modPow(b, n);\\r\\n if (x.isUnit() || x.equals(nPrev)) continue;\\r\\n for (d = r - 1; d != 0; d--) {\\r\\n x = x.square().mod(n);\\r\\n if (x.isUnit()) return false;\\r\\n if (x.equals(nPrev)) continue next;\\r\\n }\\r\\n return false;\\r\\n }\\r\\n return true;\\r\\n }\\r\\n\\r\\n // Set \\\"strict\\\" to true to force GRH-supported lower bound of 2*log(N)^2\\r\\n BigInteger.prototype.isPrime = function (strict) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var bits = n.bitLength();\\r\\n if (bits <= 64)\\r\\n return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);\\r\\n var logN = Math.log(2) * bits.toJSNumber();\\r\\n var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt(i + 2));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;\\r\\n\\r\\n BigInteger.prototype.isProbablePrime = function (iterations, rng) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var t = iterations === undefined ? 5 : iterations;\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt.randBetween(2, n.minus(2), rng));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;\\r\\n\\r\\n BigInteger.prototype.modInv = function (n) {\\r\\n var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;\\r\\n while (!newR.isZero()) {\\r\\n q = r.divide(newR);\\r\\n lastT = t;\\r\\n lastR = r;\\r\\n t = newT;\\r\\n r = newR;\\r\\n newT = lastT.subtract(q.multiply(newT));\\r\\n newR = lastR.subtract(q.multiply(newR));\\r\\n }\\r\\n if (!r.isUnit()) throw new Error(this.toString() + \\\" and \\\" + n.toString() + \\\" are not co-prime\\\");\\r\\n if (t.compare(0) === -1) {\\r\\n t = t.add(n);\\r\\n }\\r\\n if (this.isNegative()) {\\r\\n return t.negate();\\r\\n }\\r\\n return t;\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;\\r\\n\\r\\n BigInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n }\\r\\n return new BigInteger(addSmall(value, 1), this.sign);\\r\\n };\\r\\n SmallInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (value + 1 < MAX_INT) return new SmallInteger(value + 1);\\r\\n return new BigInteger(MAX_INT_ARR, false);\\r\\n };\\r\\n NativeBigInt.prototype.next = function () {\\r\\n return new NativeBigInt(this.value + BigInt(1));\\r\\n }\\r\\n\\r\\n BigInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return new BigInteger(addSmall(value, 1), true);\\r\\n }\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n };\\r\\n SmallInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);\\r\\n return new BigInteger(MAX_INT_ARR, true);\\r\\n };\\r\\n NativeBigInt.prototype.prev = function () {\\r\\n return new NativeBigInt(this.value - BigInt(1));\\r\\n }\\r\\n\\r\\n var powersOfTwo = [1];\\r\\n while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);\\r\\n var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];\\r\\n\\r\\n function shift_isSmall(n) {\\r\\n return Math.abs(n) <= BASE;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.shiftLeft = function (v) {\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftRight(-n);\\r\\n var result = this;\\r\\n if (result.isZero()) return result;\\r\\n while (n >= powers2Length) {\\r\\n result = result.multiply(highestPower2);\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n return result.multiply(powersOfTwo[n]);\\r\\n };\\r\\n NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;\\r\\n\\r\\n BigInteger.prototype.shiftRight = function (v) {\\r\\n var remQuo;\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftLeft(-n);\\r\\n var result = this;\\r\\n while (n >= powers2Length) {\\r\\n if (result.isZero() || (result.isNegative() && result.isUnit())) return result;\\r\\n remQuo = divModAny(result, highestPower2);\\r\\n result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n remQuo = divModAny(result, powersOfTwo[n]);\\r\\n return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n };\\r\\n NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;\\r\\n\\r\\n function bitwise(x, y, fn) {\\r\\n y = parseValue(y);\\r\\n var xSign = x.isNegative(), ySign = y.isNegative();\\r\\n var xRem = xSign ? x.not() : x,\\r\\n yRem = ySign ? y.not() : y;\\r\\n var xDigit = 0, yDigit = 0;\\r\\n var xDivMod = null, yDivMod = null;\\r\\n var result = [];\\r\\n while (!xRem.isZero() || !yRem.isZero()) {\\r\\n xDivMod = divModAny(xRem, highestPower2);\\r\\n xDigit = xDivMod[1].toJSNumber();\\r\\n if (xSign) {\\r\\n xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n yDivMod = divModAny(yRem, highestPower2);\\r\\n yDigit = yDivMod[1].toJSNumber();\\r\\n if (ySign) {\\r\\n yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n xRem = xDivMod[0];\\r\\n yRem = yDivMod[0];\\r\\n result.push(fn(xDigit, yDigit));\\r\\n }\\r\\n var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);\\r\\n for (var i = result.length - 1; i >= 0; i -= 1) {\\r\\n sum = sum.multiply(highestPower2).add(bigInt(result[i]));\\r\\n }\\r\\n return sum;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.not = function () {\\r\\n return this.negate().prev();\\r\\n };\\r\\n NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;\\r\\n\\r\\n BigInteger.prototype.and = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a & b; });\\r\\n };\\r\\n NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;\\r\\n\\r\\n BigInteger.prototype.or = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a | b; });\\r\\n };\\r\\n NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;\\r\\n\\r\\n BigInteger.prototype.xor = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a ^ b; });\\r\\n };\\r\\n NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;\\r\\n\\r\\n var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;\\r\\n function roughLOB(n) { // get lowestOneBit (rough)\\r\\n // SmallInteger: return Min(lowestOneBit(n), 1 << 30)\\r\\n // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]\\r\\n var v = n.value,\\r\\n x = typeof v === \\\"number\\\" ? v | LOBMASK_I :\\r\\n typeof v === \\\"bigint\\\" ? v | BigInt(LOBMASK_I) :\\r\\n v[0] + v[1] * BASE | LOBMASK_BI;\\r\\n return x & -x;\\r\\n }\\r\\n\\r\\n function integerLogarithm(value, base) {\\r\\n if (base.compareTo(value) <= 0) {\\r\\n var tmp = integerLogarithm(value, base.square(base));\\r\\n var p = tmp.p;\\r\\n var e = tmp.e;\\r\\n var t = p.multiply(base);\\r\\n return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };\\r\\n }\\r\\n return { p: bigInt(1), e: 0 };\\r\\n }\\r\\n\\r\\n BigInteger.prototype.bitLength = function () {\\r\\n var n = this;\\r\\n if (n.compareTo(bigInt(0)) < 0) {\\r\\n n = n.negate().subtract(bigInt(1));\\r\\n }\\r\\n if (n.compareTo(bigInt(0)) === 0) {\\r\\n return bigInt(0);\\r\\n }\\r\\n return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));\\r\\n }\\r\\n NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;\\r\\n\\r\\n function max(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.greater(b) ? a : b;\\r\\n }\\r\\n function min(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.lesser(b) ? a : b;\\r\\n }\\r\\n function gcd(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n if (a.equals(b)) return a;\\r\\n if (a.isZero()) return b;\\r\\n if (b.isZero()) return a;\\r\\n var c = Integer[1], d, t;\\r\\n while (a.isEven() && b.isEven()) {\\r\\n d = min(roughLOB(a), roughLOB(b));\\r\\n a = a.divide(d);\\r\\n b = b.divide(d);\\r\\n c = c.multiply(d);\\r\\n }\\r\\n while (a.isEven()) {\\r\\n a = a.divide(roughLOB(a));\\r\\n }\\r\\n do {\\r\\n while (b.isEven()) {\\r\\n b = b.divide(roughLOB(b));\\r\\n }\\r\\n if (a.greater(b)) {\\r\\n t = b; b = a; a = t;\\r\\n }\\r\\n b = b.subtract(a);\\r\\n } while (!b.isZero());\\r\\n return c.isUnit() ? a : a.multiply(c);\\r\\n }\\r\\n function lcm(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n return a.divide(gcd(a, b)).multiply(b);\\r\\n }\\r\\n function randBetween(a, b, rng) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n var usedRNG = rng || Math.random;\\r\\n var low = min(a, b), high = max(a, b);\\r\\n var range = high.subtract(low).add(1);\\r\\n if (range.isSmall) return low.add(Math.floor(usedRNG() * range));\\r\\n var digits = toBase(range, BASE).value;\\r\\n var result = [], restricted = true;\\r\\n for (var i = 0; i < digits.length; i++) {\\r\\n var top = restricted ? digits[i] : BASE;\\r\\n var digit = truncate(usedRNG() * top);\\r\\n result.push(digit);\\r\\n if (digit < top) restricted = false;\\r\\n }\\r\\n return low.add(Integer.fromArray(result, BASE, false));\\r\\n }\\r\\n\\r\\n var parseBase = function (text, base, alphabet, caseSensitive) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n text = String(text);\\r\\n if (!caseSensitive) {\\r\\n text = text.toLowerCase();\\r\\n alphabet = alphabet.toLowerCase();\\r\\n }\\r\\n var length = text.length;\\r\\n var i;\\r\\n var absBase = Math.abs(base);\\r\\n var alphabetValues = {};\\r\\n for (i = 0; i < alphabet.length; i++) {\\r\\n alphabetValues[alphabet[i]] = i;\\r\\n }\\r\\n for (i = 0; i < length; i++) {\\r\\n var c = text[i];\\r\\n if (c === \\\"-\\\") continue;\\r\\n if (c in alphabetValues) {\\r\\n if (alphabetValues[c] >= absBase) {\\r\\n if (c === \\\"1\\\" && absBase === 1) continue;\\r\\n throw new Error(c + \\\" is not a valid digit in base \\\" + base + \\\".\\\");\\r\\n }\\r\\n }\\r\\n }\\r\\n base = parseValue(base);\\r\\n var digits = [];\\r\\n var isNegative = text[0] === \\\"-\\\";\\r\\n for (i = isNegative ? 1 : 0; i < text.length; i++) {\\r\\n var c = text[i];\\r\\n if (c in alphabetValues) digits.push(parseValue(alphabetValues[c]));\\r\\n else if (c === \\\"<\\\") {\\r\\n var start = i;\\r\\n do { i++; } while (text[i] !== \\\">\\\" && i < text.length);\\r\\n digits.push(parseValue(text.slice(start + 1, i)));\\r\\n }\\r\\n else throw new Error(c + \\\" is not a valid character\\\");\\r\\n }\\r\\n return parseBaseFromArray(digits, base, isNegative);\\r\\n };\\r\\n\\r\\n function parseBaseFromArray(digits, base, isNegative) {\\r\\n var val = Integer[0], pow = Integer[1], i;\\r\\n for (i = digits.length - 1; i >= 0; i--) {\\r\\n val = val.add(digits[i].times(pow));\\r\\n pow = pow.times(base);\\r\\n }\\r\\n return isNegative ? val.negate() : val;\\r\\n }\\r\\n\\r\\n function stringify(digit, alphabet) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n if (digit < alphabet.length) {\\r\\n return alphabet[digit];\\r\\n }\\r\\n return \\\"<\\\" + digit + \\\">\\\";\\r\\n }\\r\\n\\r\\n function toBase(n, base) {\\r\\n base = bigInt(base);\\r\\n if (base.isZero()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n throw new Error(\\\"Cannot convert nonzero numbers to base 0.\\\");\\r\\n }\\r\\n if (base.equals(-1)) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n if (n.isNegative())\\r\\n return {\\r\\n value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber()))\\r\\n .map(Array.prototype.valueOf, [1, 0])\\r\\n ),\\r\\n isNegative: false\\r\\n };\\r\\n\\r\\n var arr = Array.apply(null, Array(n.toJSNumber() - 1))\\r\\n .map(Array.prototype.valueOf, [0, 1]);\\r\\n arr.unshift([1]);\\r\\n return {\\r\\n value: [].concat.apply([], arr),\\r\\n isNegative: false\\r\\n };\\r\\n }\\r\\n\\r\\n var neg = false;\\r\\n if (n.isNegative() && base.isPositive()) {\\r\\n neg = true;\\r\\n n = n.abs();\\r\\n }\\r\\n if (base.isUnit()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n\\r\\n return {\\r\\n value: Array.apply(null, Array(n.toJSNumber()))\\r\\n .map(Number.prototype.valueOf, 1),\\r\\n isNegative: neg\\r\\n };\\r\\n }\\r\\n var out = [];\\r\\n var left = n, divmod;\\r\\n while (left.isNegative() || left.compareAbs(base) >= 0) {\\r\\n divmod = left.divmod(base);\\r\\n left = divmod.quotient;\\r\\n var digit = divmod.remainder;\\r\\n if (digit.isNegative()) {\\r\\n digit = base.minus(digit).abs();\\r\\n left = left.next();\\r\\n }\\r\\n out.push(digit.toJSNumber());\\r\\n }\\r\\n out.push(left.toJSNumber());\\r\\n return { value: out.reverse(), isNegative: neg };\\r\\n }\\r\\n\\r\\n function toBaseString(n, base, alphabet) {\\r\\n var arr = toBase(n, base);\\r\\n return (arr.isNegative ? \\\"-\\\" : \\\"\\\") + arr.value.map(function (x) {\\r\\n return stringify(x, alphabet);\\r\\n }).join('');\\r\\n }\\r\\n\\r\\n BigInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix !== 10) return toBaseString(this, radix, alphabet);\\r\\n var v = this.value, l = v.length, str = String(v[--l]), zeros = \\\"0000000\\\", digit;\\r\\n while (--l >= 0) {\\r\\n digit = String(v[l]);\\r\\n str += zeros.slice(digit.length) + digit;\\r\\n }\\r\\n var sign = this.sign ? \\\"-\\\" : \\\"\\\";\\r\\n return sign + str;\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix != 10) return toBaseString(this, radix, alphabet);\\r\\n return String(this.value);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toString = SmallInteger.prototype.toString;\\r\\n\\r\\n NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }\\r\\n\\r\\n BigInteger.prototype.valueOf = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n };\\r\\n BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;\\r\\n\\r\\n SmallInteger.prototype.valueOf = function () {\\r\\n return this.value;\\r\\n };\\r\\n SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;\\r\\n NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n }\\r\\n\\r\\n function parseStringValue(v) {\\r\\n if (isPrecise(+v)) {\\r\\n var x = +v;\\r\\n if (x === truncate(x))\\r\\n return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);\\r\\n throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n }\\r\\n var sign = v[0] === \\\"-\\\";\\r\\n if (sign) v = v.slice(1);\\r\\n var split = v.split(/e/i);\\r\\n if (split.length > 2) throw new Error(\\\"Invalid integer: \\\" + split.join(\\\"e\\\"));\\r\\n if (split.length === 2) {\\r\\n var exp = split[1];\\r\\n if (exp[0] === \\\"+\\\") exp = exp.slice(1);\\r\\n exp = +exp;\\r\\n if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error(\\\"Invalid integer: \\\" + exp + \\\" is not a valid exponent.\\\");\\r\\n var text = split[0];\\r\\n var decimalPlace = text.indexOf(\\\".\\\");\\r\\n if (decimalPlace >= 0) {\\r\\n exp -= text.length - decimalPlace - 1;\\r\\n text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);\\r\\n }\\r\\n if (exp < 0) throw new Error(\\\"Cannot include negative exponent part for integers\\\");\\r\\n text += (new Array(exp + 1)).join(\\\"0\\\");\\r\\n v = text;\\r\\n }\\r\\n var isValid = /^([0-9][0-9]*)$/.test(v);\\r\\n if (!isValid) throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(sign ? \\\"-\\\" + v : v));\\r\\n }\\r\\n var r = [], max = v.length, l = LOG_BASE, min = max - l;\\r\\n while (max > 0) {\\r\\n r.push(+v.slice(min, max));\\r\\n min -= l;\\r\\n if (min < 0) min = 0;\\r\\n max -= l;\\r\\n }\\r\\n trim(r);\\r\\n return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n function parseNumberValue(v) {\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(v));\\r\\n }\\r\\n if (isPrecise(v)) {\\r\\n if (v !== truncate(v)) throw new Error(v + \\\" is not an integer.\\\");\\r\\n return new SmallInteger(v);\\r\\n }\\r\\n return parseStringValue(v.toString());\\r\\n }\\r\\n\\r\\n function parseValue(v) {\\r\\n if (typeof v === \\\"number\\\") {\\r\\n return parseNumberValue(v);\\r\\n }\\r\\n if (typeof v === \\\"string\\\") {\\r\\n return parseStringValue(v);\\r\\n }\\r\\n if (typeof v === \\\"bigint\\\") {\\r\\n return new NativeBigInt(v);\\r\\n }\\r\\n return v;\\r\\n }\\r\\n // Pre-define numbers in range [-999,999]\\r\\n for (var i = 0; i < 1000; i++) {\\r\\n Integer[i] = parseValue(i);\\r\\n if (i > 0) Integer[-i] = parseValue(-i);\\r\\n }\\r\\n // Backwards compatibility\\r\\n Integer.one = Integer[1];\\r\\n Integer.zero = Integer[0];\\r\\n Integer.minusOne = Integer[-1];\\r\\n Integer.max = max;\\r\\n Integer.min = min;\\r\\n Integer.gcd = gcd;\\r\\n Integer.lcm = lcm;\\r\\n Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; };\\r\\n Integer.randBetween = randBetween;\\r\\n\\r\\n Integer.fromArray = function (digits, base, isNegative) {\\r\\n return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);\\r\\n };\\r\\n\\r\\n return Integer;\\r\\n})();\\r\\n\\r\\n// Node.js check\\r\\nif ( true && module.hasOwnProperty(\\\"exports\\\")) {\\r\\n module.exports = bigInt;\\r\\n}\\r\\n\\r\\n//amd check\\r\\nif (true) {\\r\\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\\r\\n return bigInt;\\r\\n }).call(exports, __webpack_require__, exports, module),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\r\\n}\\r\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \\\"./node_modules/webpack/buildin/module.js\\\")(module)))\\n\\n//# sourceURL=webpack:///./node_modules/big-integer/BigInteger.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/webpack/buildin/module.js\":\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = function(module) {\\n\\tif (!module.webpackPolyfill) {\\n\\t\\tmodule.deprecate = function() {};\\n\\t\\tmodule.paths = [];\\n\\t\\t// module.parent = undefined by default\\n\\t\\tif (!module.children) module.children = [];\\n\\t\\tObject.defineProperty(module, \\\"loaded\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.l;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tObject.defineProperty(module, \\\"id\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.i;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tmodule.webpackPolyfill = 1;\\n\\t}\\n\\treturn module;\\n};\\n\\n\\n//# sourceURL=webpack:///(webpack)/buildin/module.js?\");\n\n/***/ }),\n\n/***/ \"./src/hitachi2020/B.js\":\n/*!******************************!*\\\n !*** ./src/hitachi2020/B.js ***!\n \\******************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\\n\\nfunction _nonIterableRest() { throw new TypeError(\\\"Invalid attempt to destructure non-iterable instance\\\"); }\\n\\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \\\"[object Arguments]\\\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\\\"return\\\"] != null) _i[\\\"return\\\"](); } finally { if (_d) throw _e; } } return _arr; }\\n\\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\\n\\nvar fs = __webpack_require__(/*! fs */ \\\"fs\\\");\\n\\nvar bigint = __webpack_require__(/*! big-integer */ \\\"./node_modules/big-integer/BigInteger.js\\\");\\n\\nvar main = function main(input) {\\n var lines = input.split('\\\\n');\\n\\n var _lines$shift$split$ma = lines.shift().split(' ').map(function (i) {\\n return i - 0;\\n }),\\n _lines$shift$split$ma2 = _slicedToArray(_lines$shift$split$ma, 3),\\n A = _lines$shift$split$ma2[0],\\n B = _lines$shift$split$ma2[1],\\n M = _lines$shift$split$ma2[2];\\n\\n var APrice = lines.shift().split(' ').map(function (i) {\\n return i - 0;\\n });\\n var BPrice = lines.shift().split(' ').map(function (i) {\\n return i - 0;\\n });\\n var lower = {};\\n\\n for (var a = 0; a < APrice.length; a++) {\\n for (var b = 0; b < BPrice.length; b++) {\\n lower[`${a},${b}`] = APrice[a] + BPrice[b];\\n }\\n }\\n\\n for (var i = 0; i < M; i++) {\\n var _lines$i$split$map = lines[i].split(' ').map(function (i) {\\n return i - 0;\\n }),\\n _lines$i$split$map2 = _slicedToArray(_lines$i$split$map, 3),\\n x = _lines$i$split$map2[0],\\n y = _lines$i$split$map2[1],\\n c = _lines$i$split$map2[2];\\n\\n x -= 1;\\n y -= 1;\\n var ci = `${x},${y}`;\\n var discount = APrice[x] + BPrice[y] - c;\\n\\n if (lower[ci] > discount) {\\n lower[ci] = discount;\\n }\\n }\\n\\n var answer = null;\\n Object.keys(lower).forEach(function (key) {\\n if (!answer || lower[key] < answer) {\\n answer = lower[key];\\n }\\n });\\n console.log(answer);\\n};\\n\\nmain(fs.readFileSync('/dev/stdin', 'utf8'));\\n\\n//# sourceURL=webpack:///./src/hitachi2020/B.js?\");\n\n/***/ }),\n\n/***/ \"fs\":\n/*!*********************!*\\\n !*** external \"fs\" ***!\n \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = require(\\\"fs\\\");\\n\\n//# sourceURL=webpack:///external_%22fs%22?\");\n\n/***/ })\n\n/******/ });", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "sample_input": "2 3 1\n3 3\n3 3 3\n1 2 1\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02748", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are visiting a large electronics store to buy a refrigerator and a microwave.\n\nThe store sells A kinds of refrigerators and B kinds of microwaves. The i-th refrigerator ( 1 \\le i \\le A ) is sold at a_i yen (the currency of Japan), and the j-th microwave ( 1 \\le j \\le B ) is sold at b_j yen.\n\nYou have M discount tickets. With the i-th ticket ( 1 \\le i \\le M ), you can get a discount of c_i yen from the total price when buying the x_i-th refrigerator and the y_i-th microwave together. Only one ticket can be used at a time.\n\nYou are planning to buy one refrigerator and one microwave. Find the minimum amount of money required.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\le A \\le 10^5\n\n1 \\le B \\le 10^5\n\n1 \\le M \\le 10^5\n\n1 \\le a_i , b_i , c_i \\le 10^5\n\n1 \\le x_i \\le A\n\n1 \\le y_i \\le B\n\nc_i \\le a_{x_i} + b_{y_i}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B M\na_1 a_2 ... a_A\nb_1 b_2 ... b_B\nx_1 y_1 c_1\n\\vdots\nx_M y_M c_M\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 3 1\n3 3\n3 3 3\n1 2 1\n\nSample Output 1\n\n5\n\nWith the ticket, you can get the 1-st refrigerator and the 2-nd microwave for 3+3-1=5 yen.\n\nSample Input 2\n\n1 1 2\n10\n10\n1 1 5\n1 1 10\n\nSample Output 2\n\n10\n\nNote that you cannot use more than one ticket at a time.\n\nSample Input 3\n\n2 2 1\n3 5\n3 5\n2 2 2\n\nSample Output 3\n\n6\n\nYou can get the 1-st refrigerator and the 1-st microwave for 6 yen, which is the minimum amount to pay in this case.\nNote that using a ticket is optional.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 63148, "cpu_time_ms": 2121, "memory_kb": 330452}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s399986065", "group_id": "codeNet:p02753", "input_text": "function Main(input) {\n tmp = input.split(\"\");\n if(tmp[0]==tmp[1]&&tmp[1]==tmp[2]){\n console.log(\"Yes\");\n }else{\n console.log(\"No\")\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1583636643, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02753.html", "problem_id": "p02753", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02753/input.txt", "sample_output_relpath": "derived/input_output/data/p02753/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02753/JavaScript/s399986065.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s399986065", "user_id": "u098212563"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(input) {\n tmp = input.split(\"\");\n if(tmp[0]==tmp[1]&&tmp[1]==tmp[2]){\n console.log(\"Yes\");\n }else{\n console.log(\"No\")\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "sample_input": "ABA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02753", "source_text": "Score : 100 points\n\nProblem Statement\n\nIn AtCoder City, there are three stations numbered 1, 2, and 3.\n\nEach of these stations is operated by one of the two railway companies, A and B. A string S of length 3 represents which company operates each station. If S_i is A, Company A operates Station i; if S_i is B, Company B operates Station i.\n\nTo improve the transportation condition, for each pair of a station operated by Company A and one operated by Company B, there will be a bus service connecting them.\n\nDetermine if there is a pair of stations that will be connected by a bus service.\n\nConstraints\n\nEach character of S is A or B.\n\n|S| = 3\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf there is a pair of stations that will be connected by a bus service, print Yes; otherwise, print No.\n\nSample Input 1\n\nABA\n\nSample Output 1\n\nYes\n\nCompany A operates Station 1 and 3, while Company B operates Station 2.\n\nThere will be a bus service between Station 1 and 2, and between Station 2 and 3, so print Yes.\n\nSample Input 2\n\nBBA\n\nSample Output 2\n\nYes\n\nCompany B operates Station 1 and 2, while Company A operates Station 3.\n\nThere will be a bus service between Station 1 and 3, and between Station 2 and 3, so print Yes.\n\nSample Input 3\n\nBBB\n\nSample Output 3\n\nNo\n\nCompany B operates all the stations. Thus, there will be no bus service, so print No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 56, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s010682267", "group_id": "codeNet:p02754", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\nvar tmp = input.split(\" \");\nvar s = parseInt(tmp[0], 10);\nvar a = parseInt(tmp[1], 10);\nvar b = parseInt(tmp[2], 10);\naa = a+b;;\nvar amari = s%aa;\nvar sho = Math.floor(s/aa);\nvar AAA = sho*a;\nif(amari > a ){\n AAA += a;\n}else{\n AAA += amari;\n}\nconsole.log(AAA);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1583707028, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/JavaScript/s010682267.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s010682267", "user_id": "u557216536"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\nvar tmp = input.split(\" \");\nvar s = parseInt(tmp[0], 10);\nvar a = parseInt(tmp[1], 10);\nvar b = parseInt(tmp[2], 10);\naa = a+b;;\nvar amari = s%aa;\nvar sho = Math.floor(s/aa);\nvar AAA = sho*a;\nif(amari > a ){\n AAA += a;\n}else{\n AAA += amari;\n}\nconsole.log(AAA);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 515, "cpu_time_ms": 53, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s571302097", "group_id": "codeNet:p02754", "input_text": "const main = (inputs) => {\n\n const array = inputs[0].split(\" \");\n var N = Number(array[0]);\n var A = Number(array[1]);\n var B = Number(array[2]);\n var answer = 0;\n if (A !== 0 && B !== 0) {\n answer = A * Math.floor(N / (A + B)) + N % (A + B);\n }\n console.log(answer);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split(\"\\n\"));", "language": "JavaScript", "metadata": {"date": 1583634383, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02754.html", "problem_id": "p02754", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02754/input.txt", "sample_output_relpath": "derived/input_output/data/p02754/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02754/JavaScript/s571302097.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s571302097", "user_id": "u021124817"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "const main = (inputs) => {\n\n const array = inputs[0].split(\" \");\n var N = Number(array[0]);\n var A = Number(array[1]);\n var B = Number(array[2]);\n var answer = 0;\n if (A !== 0 && B !== 0) {\n answer = A * Math.floor(N / (A + B)) + N % (A + B);\n }\n console.log(answer);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'UTF-8').trim().split(\"\\n\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "sample_input": "8 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02754", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has many red balls and blue balls. Now, he will place them in a row.\n\nInitially, there is no ball placed.\n\nTakahashi, who is very patient, will do the following operation 10^{100} times:\n\nPlace A blue balls at the end of the row of balls already placed. Then, place B red balls at the end of the row.\n\nHow many blue balls will be there among the first N balls in the row of balls made this way?\n\nConstraints\n\n1 \\leq N \\leq 10^{18}\n\nA, B \\geq 0\n\n0 < A + B \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the number of blue balls that will be there among the first N balls in the row of balls.\n\nSample Input 1\n\n8 3 4\n\nSample Output 1\n\n4\n\nLet b denote a blue ball, and r denote a red ball. The first eight balls in the row will be bbbrrrrb, among which there are four blue balls.\n\nSample Input 2\n\n8 0 4\n\nSample Output 2\n\n0\n\nHe placed only red balls from the beginning.\n\nSample Input 3\n\n6 2 4\n\nSample Output 3\n\n2\n\nAmong bbrrrr, there are two blue balls.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 357, "cpu_time_ms": 208, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s110878457", "group_id": "codeNet:p02756", "input_text": "//This must be WA.\nfunction Main(input) {\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n var S = input[0];\n var Q = parseInt(input[1], 10);\n var arr_qu = [];\n var nReverse = 0;\n var addHead = [];\n var addTail = [];\n for (var i = 0; i < Q; i++){\n arr_qu.push(input[i + 2]);\n if (arr_qu[i][0] === '1') {\n nReverse ++;\n continue;\n }\n if ((parseInt(arr_qu[i][1], 10) + nReverse) % 2 ===0) {\n addTail.push(arr_qu[i][2]);\n continue;\n }\n addHead.unshift(arr_qu[i][2]);\n }\n var ans = addHead.concat(S[0].split(\"\"), addTail);\n //if (nReverse % 2 === 1) ans = ans.reverse();\n console.log(ans.join(\"\"));\n} \n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1593108360, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/JavaScript/s110878457.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s110878457", "user_id": "u624950076"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "//This must be WA.\nfunction Main(input) {\n input = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n var S = input[0];\n var Q = parseInt(input[1], 10);\n var arr_qu = [];\n var nReverse = 0;\n var addHead = [];\n var addTail = [];\n for (var i = 0; i < Q; i++){\n arr_qu.push(input[i + 2]);\n if (arr_qu[i][0] === '1') {\n nReverse ++;\n continue;\n }\n if ((parseInt(arr_qu[i][1], 10) + nReverse) % 2 ===0) {\n addTail.push(arr_qu[i][2]);\n continue;\n }\n addHead.unshift(arr_qu[i][2]);\n }\n var ans = addHead.concat(S[0].split(\"\"), addTail);\n //if (nReverse % 2 === 1) ans = ans.reverse();\n console.log(ans.join(\"\"));\n} \n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 733, "cpu_time_ms": 2208, "memory_kb": 86528}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s399202380", "group_id": "codeNet:p02756", "input_text": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var s = nextCharArray();\n var Q = nextInt();\n var t = \"\";\n for(var i = 0; i < Q; i++){\n var tmp = nextStrArray();\n if(tmp[0] == \"1\"){\n var swap = s;\n s = t;\n t = swap;\n }else{\n if(tmp[1] == \"1\"){\n t += tmp[2];\n }else{\n s += tmp[2];\n }\n }\n }\n t = myconv(t,6);\n t.sort(function(){\n \treturn 1;\n });\n myout(t.join(\"\") + s);\n}", "language": "JavaScript", "metadata": {"date": 1583643714, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02756.html", "problem_id": "p02756", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02756/input.txt", "sample_output_relpath": "derived/input_output/data/p02756/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02756/JavaScript/s399202380.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s399202380", "user_id": "u222822036"}, "prompt_components": {"gold_output": "cpa\n", "input_to_evaluate": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var s = nextCharArray();\n var Q = nextInt();\n var t = \"\";\n for(var i = 0; i < Q; i++){\n var tmp = nextStrArray();\n if(tmp[0] == \"1\"){\n var swap = s;\n s = t;\n t = swap;\n }else{\n if(tmp[1] == \"1\"){\n t += tmp[2];\n }else{\n s += tmp[2];\n }\n }\n }\n t = myconv(t,6);\n t.sort(function(){\n \treturn 1;\n });\n myout(t.join(\"\") + s);\n}", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "sample_input": "a\n4\n2 1 p\n1\n2 2 c\n1\n"}, "reference_outputs": ["cpa\n"], "source_document_id": "p02756", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a string S consisting of lowercase English letters.\n\nStarting with this string, he will produce a new one in the procedure given as follows.\n\nThe procedure consists of Q operations. In Operation i (1 \\leq i \\leq Q), an integer T_i is provided, which means the following:\n\nIf T_i = 1: reverse the string S.\n\nIf T_i = 2: An integer F_i and a lowercase English letter C_i are additionally provided.\n\nIf F_i = 1 : Add C_i to the beginning of the string S.\n\nIf F_i = 2 : Add C_i to the end of the string S.\n\nHelp Takahashi by finding the final string that results from the procedure.\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS consists of lowercase English letters.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\nT_i = 1 or 2.\n\nF_i = 1 or 2, if provided.\n\nC_i is a lowercase English letter, if provided.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nQ\nQuery_1\n:\nQuery_Q\n\nIn the 3-rd through the (Q+2)-th lines, Query_i is one of the following:\n\n1\n\nwhich means T_i = 1, and:\n\n2 F_i C_i\n\nwhich means T_i = 2.\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\na\n4\n2 1 p\n1\n2 2 c\n1\n\nSample Output 1\n\ncpa\n\nThere will be Q = 4 operations. Initially, S is a.\n\nOperation 1: Add p at the beginning of S. S becomes pa.\n\nOperation 2: Reverse S. S becomes ap.\n\nOperation 3: Add c at the end of S. S becomes apc.\n\nOperation 4: Reverse S. S becomes cpa.\n\nThus, the resulting string is cpa.\n\nSample Input 2\n\na\n6\n2 2 a\n2 1 b\n1\n2 2 c\n1\n1\n\nSample Output 2\n\naabc\n\nThere will be Q = 6 operations. Initially, S is a.\n\nOperation 1: S becomes aa.\n\nOperation 2: S becomes baa.\n\nOperation 3: S becomes aab.\n\nOperation 4: S becomes aabc.\n\nOperation 5: S becomes cbaa.\n\nOperation 6: S becomes aabc.\n\nThus, the resulting string is aabc.\n\nSample Input 3\n\ny\n1\n2 1 x\n\nSample Output 3\n\nxy", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1894, "cpu_time_ms": 2110, "memory_kb": 57684}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s055520369", "group_id": "codeNet:p02759", "input_text": "(function main() {\n let a = N / 2;\n let b = N % 2\n let Nn = parseInt(a) + b;\n console.log(Nn);\n})();\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1583116895, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/JavaScript/s055520369.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s055520369", "user_id": "u871647586"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "(function main() {\n let a = N / 2;\n let b = N % 2\n let Nn = parseInt(a) + b;\n console.log(Nn);\n})();\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 168, "cpu_time_ms": 53, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s604389330", "group_id": "codeNet:p02759", "input_text": "const fs = require(\"fs\");\n\nfunction main(input) {\n const n = input;\n console.log(Math.ceil(n / 2));\n}\n\nmain(fs.readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1583116774, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02759.html", "problem_id": "p02759", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02759/input.txt", "sample_output_relpath": "derived/input_output/data/p02759/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02759/JavaScript/s604389330.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s604389330", "user_id": "u448863865"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const fs = require(\"fs\");\n\nfunction main(input) {\n const n = input;\n console.log(Math.ceil(n / 2));\n}\n\nmain(fs.readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "sample_input": "5\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02759", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.\n\nAt least how many sheets of paper does he need?\n\nConstraints\n\nN is an integer.\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n5\n\nSample Output 1\n\n3\n\nBy printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n50", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 149, "cpu_time_ms": 202, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s468542151", "group_id": "codeNet:p02760", "input_text": "/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/ABC157/B.js\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/big-integer/BigInteger.js\":\n/*!************************************************!*\\\n !*** ./node_modules/big-integer/BigInteger.js ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;var bigInt = (function (undefined) {\\r\\n \\\"use strict\\\";\\r\\n\\r\\n var BASE = 1e7,\\r\\n LOG_BASE = 7,\\r\\n MAX_INT = 9007199254740992,\\r\\n MAX_INT_ARR = smallToArray(MAX_INT),\\r\\n DEFAULT_ALPHABET = \\\"0123456789abcdefghijklmnopqrstuvwxyz\\\";\\r\\n\\r\\n var supportsNativeBigInt = typeof BigInt === \\\"function\\\";\\r\\n\\r\\n function Integer(v, radix, alphabet, caseSensitive) {\\r\\n if (typeof v === \\\"undefined\\\") return Integer[0];\\r\\n if (typeof radix !== \\\"undefined\\\") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);\\r\\n return parseValue(v);\\r\\n }\\r\\n\\r\\n function BigInteger(value, sign) {\\r\\n this.value = value;\\r\\n this.sign = sign;\\r\\n this.isSmall = false;\\r\\n }\\r\\n BigInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function SmallInteger(value) {\\r\\n this.value = value;\\r\\n this.sign = value < 0;\\r\\n this.isSmall = true;\\r\\n }\\r\\n SmallInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function NativeBigInt(value) {\\r\\n this.value = value;\\r\\n }\\r\\n NativeBigInt.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function isPrecise(n) {\\r\\n return -MAX_INT < n && n < MAX_INT;\\r\\n }\\r\\n\\r\\n function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes\\r\\n if (n < 1e7)\\r\\n return [n];\\r\\n if (n < 1e14)\\r\\n return [n % 1e7, Math.floor(n / 1e7)];\\r\\n return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];\\r\\n }\\r\\n\\r\\n function arrayToSmall(arr) { // If BASE changes this function may need to change\\r\\n trim(arr);\\r\\n var length = arr.length;\\r\\n if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {\\r\\n switch (length) {\\r\\n case 0: return 0;\\r\\n case 1: return arr[0];\\r\\n case 2: return arr[0] + arr[1] * BASE;\\r\\n default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;\\r\\n }\\r\\n }\\r\\n return arr;\\r\\n }\\r\\n\\r\\n function trim(v) {\\r\\n var i = v.length;\\r\\n while (v[--i] === 0);\\r\\n v.length = i + 1;\\r\\n }\\r\\n\\r\\n function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger\\r\\n var x = new Array(length);\\r\\n var i = -1;\\r\\n while (++i < length) {\\r\\n x[i] = 0;\\r\\n }\\r\\n return x;\\r\\n }\\r\\n\\r\\n function truncate(n) {\\r\\n if (n > 0) return Math.floor(n);\\r\\n return Math.ceil(n);\\r\\n }\\r\\n\\r\\n function add(a, b) { // assumes a and b are arrays with a.length >= b.length\\r\\n var l_a = a.length,\\r\\n l_b = b.length,\\r\\n r = new Array(l_a),\\r\\n carry = 0,\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l_b; i++) {\\r\\n sum = a[i] + b[i] + carry;\\r\\n carry = sum >= base ? 1 : 0;\\r\\n r[i] = sum - carry * base;\\r\\n }\\r\\n while (i < l_a) {\\r\\n sum = a[i] + carry;\\r\\n carry = sum === base ? 1 : 0;\\r\\n r[i++] = sum - carry * base;\\r\\n }\\r\\n if (carry > 0) r.push(carry);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function addAny(a, b) {\\r\\n if (a.length >= b.length) return add(a, b);\\r\\n return add(b, a);\\r\\n }\\r\\n\\r\\n function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n sum = a[i] - base + carry;\\r\\n carry = Math.floor(sum / base);\\r\\n r[i] = sum - carry * base;\\r\\n carry += 1;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new BigInteger(addSmall(a, Math.abs(b)), this.sign);\\r\\n }\\r\\n return new BigInteger(addAny(a, b), this.sign);\\r\\n };\\r\\n BigInteger.prototype.plus = BigInteger.prototype.add;\\r\\n\\r\\n SmallInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n if (isPrecise(a + b)) return new SmallInteger(a + b);\\r\\n b = smallToArray(Math.abs(b));\\r\\n }\\r\\n return new BigInteger(addSmall(b, Math.abs(a)), a < 0);\\r\\n };\\r\\n SmallInteger.prototype.plus = SmallInteger.prototype.add;\\r\\n\\r\\n NativeBigInt.prototype.add = function (v) {\\r\\n return new NativeBigInt(this.value + parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.plus = NativeBigInt.prototype.add;\\r\\n\\r\\n function subtract(a, b) { // assumes a and b are arrays with a >= b\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n r = new Array(a_l),\\r\\n borrow = 0,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < b_l; i++) {\\r\\n difference = a[i] - borrow - b[i];\\r\\n if (difference < 0) {\\r\\n difference += base;\\r\\n borrow = 1;\\r\\n } else borrow = 0;\\r\\n r[i] = difference;\\r\\n }\\r\\n for (i = b_l; i < a_l; i++) {\\r\\n difference = a[i] - borrow;\\r\\n if (difference < 0) difference += base;\\r\\n else {\\r\\n r[i++] = difference;\\r\\n break;\\r\\n }\\r\\n r[i] = difference;\\r\\n }\\r\\n for (; i < a_l; i++) {\\r\\n r[i] = a[i];\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function subtractAny(a, b, sign) {\\r\\n var value;\\r\\n if (compareAbs(a, b) >= 0) {\\r\\n value = subtract(a, b);\\r\\n } else {\\r\\n value = subtract(b, a);\\r\\n sign = !sign;\\r\\n }\\r\\n value = arrayToSmall(value);\\r\\n if (typeof value === \\\"number\\\") {\\r\\n if (sign) value = -value;\\r\\n return new SmallInteger(value);\\r\\n }\\r\\n return new BigInteger(value, sign);\\r\\n }\\r\\n\\r\\n function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n carry = -b,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < l; i++) {\\r\\n difference = a[i] + carry;\\r\\n carry = Math.floor(difference / base);\\r\\n difference %= base;\\r\\n r[i] = difference < 0 ? difference + base : difference;\\r\\n }\\r\\n r = arrayToSmall(r);\\r\\n if (typeof r === \\\"number\\\") {\\r\\n if (sign) r = -r;\\r\\n return new SmallInteger(r);\\r\\n } return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall)\\r\\n return subtractSmall(a, Math.abs(b), this.sign);\\r\\n return subtractAny(a, b, this.sign);\\r\\n };\\r\\n BigInteger.prototype.minus = BigInteger.prototype.subtract;\\r\\n\\r\\n SmallInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new SmallInteger(a - b);\\r\\n }\\r\\n return subtractSmall(b, Math.abs(a), a >= 0);\\r\\n };\\r\\n SmallInteger.prototype.minus = SmallInteger.prototype.subtract;\\r\\n\\r\\n NativeBigInt.prototype.subtract = function (v) {\\r\\n return new NativeBigInt(this.value - parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;\\r\\n\\r\\n BigInteger.prototype.negate = function () {\\r\\n return new BigInteger(this.value, !this.sign);\\r\\n };\\r\\n SmallInteger.prototype.negate = function () {\\r\\n var sign = this.sign;\\r\\n var small = new SmallInteger(-this.value);\\r\\n small.sign = !sign;\\r\\n return small;\\r\\n };\\r\\n NativeBigInt.prototype.negate = function () {\\r\\n return new NativeBigInt(-this.value);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.abs = function () {\\r\\n return new BigInteger(this.value, false);\\r\\n };\\r\\n SmallInteger.prototype.abs = function () {\\r\\n return new SmallInteger(Math.abs(this.value));\\r\\n };\\r\\n NativeBigInt.prototype.abs = function () {\\r\\n return new NativeBigInt(this.value >= 0 ? this.value : -this.value);\\r\\n }\\r\\n\\r\\n\\r\\n function multiplyLong(a, b) {\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n l = a_l + b_l,\\r\\n r = createArray(l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, b_j;\\r\\n for (i = 0; i < a_l; ++i) {\\r\\n a_i = a[i];\\r\\n for (var j = 0; j < b_l; ++j) {\\r\\n b_j = b[j];\\r\\n product = a_i * b_j + r[i + j];\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n r[i + j + 1] += carry;\\r\\n }\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n carry = 0,\\r\\n product, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n product = a[i] * b + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i] = product - carry * base;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n function shiftLeft(x, n) {\\r\\n var r = [];\\r\\n while (n-- > 0) r.push(0);\\r\\n return r.concat(x);\\r\\n }\\r\\n\\r\\n function multiplyKaratsuba(x, y) {\\r\\n var n = Math.max(x.length, y.length);\\r\\n\\r\\n if (n <= 30) return multiplyLong(x, y);\\r\\n n = Math.ceil(n / 2);\\r\\n\\r\\n var b = x.slice(n),\\r\\n a = x.slice(0, n),\\r\\n d = y.slice(n),\\r\\n c = y.slice(0, n);\\r\\n\\r\\n var ac = multiplyKaratsuba(a, c),\\r\\n bd = multiplyKaratsuba(b, d),\\r\\n abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));\\r\\n\\r\\n var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));\\r\\n trim(product);\\r\\n return product;\\r\\n }\\r\\n\\r\\n // The following function is derived from a surface fit of a graph plotting the performance difference\\r\\n // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.\\r\\n function useKaratsuba(l1, l2) {\\r\\n return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.multiply = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value, b = n.value,\\r\\n sign = this.sign !== n.sign,\\r\\n abs;\\r\\n if (n.isSmall) {\\r\\n if (b === 0) return Integer[0];\\r\\n if (b === 1) return this;\\r\\n if (b === -1) return this.negate();\\r\\n abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n return new BigInteger(multiplySmall(a, abs), sign);\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes\\r\\n return new BigInteger(multiplyKaratsuba(a, b), sign);\\r\\n return new BigInteger(multiplyLong(a, b), sign);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.times = BigInteger.prototype.multiply;\\r\\n\\r\\n function multiplySmallAndArray(a, b, sign) { // a >= 0\\r\\n if (a < BASE) {\\r\\n return new BigInteger(multiplySmall(b, a), sign);\\r\\n }\\r\\n return new BigInteger(multiplyLong(b, smallToArray(a)), sign);\\r\\n }\\r\\n SmallInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (isPrecise(a.value * this.value)) {\\r\\n return new SmallInteger(a.value * this.value);\\r\\n }\\r\\n return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);\\r\\n };\\r\\n BigInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (a.value === 0) return Integer[0];\\r\\n if (a.value === 1) return this;\\r\\n if (a.value === -1) return this.negate();\\r\\n return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);\\r\\n };\\r\\n SmallInteger.prototype.multiply = function (v) {\\r\\n return parseValue(v)._multiplyBySmall(this);\\r\\n };\\r\\n SmallInteger.prototype.times = SmallInteger.prototype.multiply;\\r\\n\\r\\n NativeBigInt.prototype.multiply = function (v) {\\r\\n return new NativeBigInt(this.value * parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;\\r\\n\\r\\n function square(a) {\\r\\n //console.assert(2 * BASE * BASE < MAX_INT);\\r\\n var l = a.length,\\r\\n r = createArray(l + l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, a_j;\\r\\n for (i = 0; i < l; i++) {\\r\\n a_i = a[i];\\r\\n carry = 0 - a_i * a_i;\\r\\n for (var j = i; j < l; j++) {\\r\\n a_j = a[j];\\r\\n product = 2 * (a_i * a_j) + r[i + j] + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n }\\r\\n r[i + l] = carry;\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.square = function () {\\r\\n return new BigInteger(square(this.value), false);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.square = function () {\\r\\n var value = this.value * this.value;\\r\\n if (isPrecise(value)) return new SmallInteger(value);\\r\\n return new BigInteger(square(smallToArray(Math.abs(this.value))), false);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.square = function (v) {\\r\\n return new NativeBigInt(this.value * this.value);\\r\\n }\\r\\n\\r\\n function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n base = BASE,\\r\\n result = createArray(b.length),\\r\\n divisorMostSignificantDigit = b[b_l - 1],\\r\\n // normalization\\r\\n lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),\\r\\n remainder = multiplySmall(a, lambda),\\r\\n divisor = multiplySmall(b, lambda),\\r\\n quotientDigit, shift, carry, borrow, i, l, q;\\r\\n if (remainder.length <= a_l) remainder.push(0);\\r\\n divisor.push(0);\\r\\n divisorMostSignificantDigit = divisor[b_l - 1];\\r\\n for (shift = a_l - b_l; shift >= 0; shift--) {\\r\\n quotientDigit = base - 1;\\r\\n if (remainder[shift + b_l] !== divisorMostSignificantDigit) {\\r\\n quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);\\r\\n }\\r\\n // quotientDigit <= base - 1\\r\\n carry = 0;\\r\\n borrow = 0;\\r\\n l = divisor.length;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += quotientDigit * divisor[i];\\r\\n q = Math.floor(carry / base);\\r\\n borrow += remainder[shift + i] - (carry - q * base);\\r\\n carry = q;\\r\\n if (borrow < 0) {\\r\\n remainder[shift + i] = borrow + base;\\r\\n borrow = -1;\\r\\n } else {\\r\\n remainder[shift + i] = borrow;\\r\\n borrow = 0;\\r\\n }\\r\\n }\\r\\n while (borrow !== 0) {\\r\\n quotientDigit -= 1;\\r\\n carry = 0;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += remainder[shift + i] - base + divisor[i];\\r\\n if (carry < 0) {\\r\\n remainder[shift + i] = carry + base;\\r\\n carry = 0;\\r\\n } else {\\r\\n remainder[shift + i] = carry;\\r\\n carry = 1;\\r\\n }\\r\\n }\\r\\n borrow += carry;\\r\\n }\\r\\n result[shift] = quotientDigit;\\r\\n }\\r\\n // denormalization\\r\\n remainder = divModSmall(remainder, lambda)[0];\\r\\n return [arrayToSmall(result), arrayToSmall(remainder)];\\r\\n }\\r\\n\\r\\n function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/\\r\\n // Performs faster than divMod1 on larger input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n result = [],\\r\\n part = [],\\r\\n base = BASE,\\r\\n guess, xlen, highx, highy, check;\\r\\n while (a_l) {\\r\\n part.unshift(a[--a_l]);\\r\\n trim(part);\\r\\n if (compareAbs(part, b) < 0) {\\r\\n result.push(0);\\r\\n continue;\\r\\n }\\r\\n xlen = part.length;\\r\\n highx = part[xlen - 1] * base + part[xlen - 2];\\r\\n highy = b[b_l - 1] * base + b[b_l - 2];\\r\\n if (xlen > b_l) {\\r\\n highx = (highx + 1) * base;\\r\\n }\\r\\n guess = Math.ceil(highx / highy);\\r\\n do {\\r\\n check = multiplySmall(b, guess);\\r\\n if (compareAbs(check, part) <= 0) break;\\r\\n guess--;\\r\\n } while (guess);\\r\\n result.push(guess);\\r\\n part = subtract(part, check);\\r\\n }\\r\\n result.reverse();\\r\\n return [arrayToSmall(result), arrayToSmall(part)];\\r\\n }\\r\\n\\r\\n function divModSmall(value, lambda) {\\r\\n var length = value.length,\\r\\n quotient = createArray(length),\\r\\n base = BASE,\\r\\n i, q, remainder, divisor;\\r\\n remainder = 0;\\r\\n for (i = length - 1; i >= 0; --i) {\\r\\n divisor = remainder * base + value[i];\\r\\n q = truncate(divisor / lambda);\\r\\n remainder = divisor - q * lambda;\\r\\n quotient[i] = q | 0;\\r\\n }\\r\\n return [quotient, remainder | 0];\\r\\n }\\r\\n\\r\\n function divModAny(self, v) {\\r\\n var value, n = parseValue(v);\\r\\n if (supportsNativeBigInt) {\\r\\n return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)];\\r\\n }\\r\\n var a = self.value, b = n.value;\\r\\n var quotient;\\r\\n if (b === 0) throw new Error(\\\"Cannot divide by zero\\\");\\r\\n if (self.isSmall) {\\r\\n if (n.isSmall) {\\r\\n return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];\\r\\n }\\r\\n return [Integer[0], self];\\r\\n }\\r\\n if (n.isSmall) {\\r\\n if (b === 1) return [self, Integer[0]];\\r\\n if (b == -1) return [self.negate(), Integer[0]];\\r\\n var abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n value = divModSmall(a, abs);\\r\\n quotient = arrayToSmall(value[0]);\\r\\n var remainder = value[1];\\r\\n if (self.sign) remainder = -remainder;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (self.sign !== n.sign) quotient = -quotient;\\r\\n return [new SmallInteger(quotient), new SmallInteger(remainder)];\\r\\n }\\r\\n return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n var comparison = compareAbs(a, b);\\r\\n if (comparison === -1) return [Integer[0], self];\\r\\n if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];\\r\\n\\r\\n // divMod1 is faster on smaller input sizes\\r\\n if (a.length + b.length <= 200)\\r\\n value = divMod1(a, b);\\r\\n else value = divMod2(a, b);\\r\\n\\r\\n quotient = value[0];\\r\\n var qSign = self.sign !== n.sign,\\r\\n mod = value[1],\\r\\n mSign = self.sign;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (qSign) quotient = -quotient;\\r\\n quotient = new SmallInteger(quotient);\\r\\n } else quotient = new BigInteger(quotient, qSign);\\r\\n if (typeof mod === \\\"number\\\") {\\r\\n if (mSign) mod = -mod;\\r\\n mod = new SmallInteger(mod);\\r\\n } else mod = new BigInteger(mod, mSign);\\r\\n return [quotient, mod];\\r\\n }\\r\\n\\r\\n BigInteger.prototype.divmod = function (v) {\\r\\n var result = divModAny(this, v);\\r\\n return {\\r\\n quotient: result[0],\\r\\n remainder: result[1]\\r\\n };\\r\\n };\\r\\n NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;\\r\\n\\r\\n\\r\\n BigInteger.prototype.divide = function (v) {\\r\\n return divModAny(this, v)[0];\\r\\n };\\r\\n NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {\\r\\n return new NativeBigInt(this.value / parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;\\r\\n\\r\\n BigInteger.prototype.mod = function (v) {\\r\\n return divModAny(this, v)[1];\\r\\n };\\r\\n NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {\\r\\n return new NativeBigInt(this.value % parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;\\r\\n\\r\\n BigInteger.prototype.pow = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value,\\r\\n value, x, y;\\r\\n if (b === 0) return Integer[1];\\r\\n if (a === 0) return Integer[0];\\r\\n if (a === 1) return Integer[1];\\r\\n if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.sign) {\\r\\n return Integer[0];\\r\\n }\\r\\n if (!n.isSmall) throw new Error(\\\"The exponent \\\" + n.toString() + \\\" is too large.\\\");\\r\\n if (this.isSmall) {\\r\\n if (isPrecise(value = Math.pow(a, b)))\\r\\n return new SmallInteger(truncate(value));\\r\\n }\\r\\n x = this;\\r\\n y = Integer[1];\\r\\n while (true) {\\r\\n if (b & 1 === 1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === 0) break;\\r\\n b /= 2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n };\\r\\n SmallInteger.prototype.pow = BigInteger.prototype.pow;\\r\\n\\r\\n NativeBigInt.prototype.pow = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value, b = n.value;\\r\\n var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);\\r\\n if (b === _0) return Integer[1];\\r\\n if (a === _0) return Integer[0];\\r\\n if (a === _1) return Integer[1];\\r\\n if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.isNegative()) return new NativeBigInt(_0);\\r\\n var x = this;\\r\\n var y = Integer[1];\\r\\n while (true) {\\r\\n if ((b & _1) === _1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === _0) break;\\r\\n b /= _2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.modPow = function (exp, mod) {\\r\\n exp = parseValue(exp);\\r\\n mod = parseValue(mod);\\r\\n if (mod.isZero()) throw new Error(\\\"Cannot take modPow with modulus 0\\\");\\r\\n var r = Integer[1],\\r\\n base = this.mod(mod);\\r\\n if (exp.isNegative()) {\\r\\n exp = exp.multiply(Integer[-1]);\\r\\n base = base.modInv(mod);\\r\\n }\\r\\n while (exp.isPositive()) {\\r\\n if (base.isZero()) return Integer[0];\\r\\n if (exp.isOdd()) r = r.multiply(base).mod(mod);\\r\\n exp = exp.divide(2);\\r\\n base = base.square().mod(mod);\\r\\n }\\r\\n return r;\\r\\n };\\r\\n NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;\\r\\n\\r\\n function compareAbs(a, b) {\\r\\n if (a.length !== b.length) {\\r\\n return a.length > b.length ? 1 : -1;\\r\\n }\\r\\n for (var i = a.length - 1; i >= 0; i--) {\\r\\n if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;\\r\\n }\\r\\n return 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) return 1;\\r\\n return compareAbs(a, b);\\r\\n };\\r\\n SmallInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = Math.abs(this.value),\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n b = Math.abs(b);\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n return -1;\\r\\n };\\r\\n NativeBigInt.prototype.compareAbs = function (v) {\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n a = a >= 0 ? a : -a;\\r\\n b = b >= 0 ? b : -b;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compare = function (v) {\\r\\n // See discussion about comparison with Infinity:\\r\\n // https://github.com/peterolson/BigInteger.js/issues/61\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (this.sign !== n.sign) {\\r\\n return n.sign ? 1 : -1;\\r\\n }\\r\\n if (n.isSmall) {\\r\\n return this.sign ? -1 : 1;\\r\\n }\\r\\n return compareAbs(a, b) * (this.sign ? -1 : 1);\\r\\n };\\r\\n BigInteger.prototype.compareTo = BigInteger.prototype.compare;\\r\\n\\r\\n SmallInteger.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n return a == b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n if (a < 0 !== n.sign) {\\r\\n return a < 0 ? -1 : 1;\\r\\n }\\r\\n return a < 0 ? 1 : -1;\\r\\n };\\r\\n SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;\\r\\n\\r\\n NativeBigInt.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;\\r\\n\\r\\n BigInteger.prototype.equals = function (v) {\\r\\n return this.compare(v) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;\\r\\n\\r\\n BigInteger.prototype.notEquals = function (v) {\\r\\n return this.compare(v) !== 0;\\r\\n };\\r\\n NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;\\r\\n\\r\\n BigInteger.prototype.greater = function (v) {\\r\\n return this.compare(v) > 0;\\r\\n };\\r\\n NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;\\r\\n\\r\\n BigInteger.prototype.lesser = function (v) {\\r\\n return this.compare(v) < 0;\\r\\n };\\r\\n NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;\\r\\n\\r\\n BigInteger.prototype.greaterOrEquals = function (v) {\\r\\n return this.compare(v) >= 0;\\r\\n };\\r\\n NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;\\r\\n\\r\\n BigInteger.prototype.lesserOrEquals = function (v) {\\r\\n return this.compare(v) <= 0;\\r\\n };\\r\\n NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;\\r\\n\\r\\n BigInteger.prototype.isEven = function () {\\r\\n return (this.value[0] & 1) === 0;\\r\\n };\\r\\n SmallInteger.prototype.isEven = function () {\\r\\n return (this.value & 1) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isEven = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isOdd = function () {\\r\\n return (this.value[0] & 1) === 1;\\r\\n };\\r\\n SmallInteger.prototype.isOdd = function () {\\r\\n return (this.value & 1) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isOdd = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isPositive = function () {\\r\\n return !this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isPositive = function () {\\r\\n return this.value > 0;\\r\\n };\\r\\n NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;\\r\\n\\r\\n BigInteger.prototype.isNegative = function () {\\r\\n return this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isNegative = function () {\\r\\n return this.value < 0;\\r\\n };\\r\\n NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;\\r\\n\\r\\n BigInteger.prototype.isUnit = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isUnit = function () {\\r\\n return Math.abs(this.value) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isUnit = function () {\\r\\n return this.abs().value === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isZero = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isZero = function () {\\r\\n return this.value === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isZero = function () {\\r\\n return this.value === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isDivisibleBy = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (n.isZero()) return false;\\r\\n if (n.isUnit()) return true;\\r\\n if (n.compareAbs(2) === 0) return this.isEven();\\r\\n return this.mod(n).isZero();\\r\\n };\\r\\n NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;\\r\\n\\r\\n function isBasicPrime(v) {\\r\\n var n = v.abs();\\r\\n if (n.isUnit()) return false;\\r\\n if (n.equals(2) || n.equals(3) || n.equals(5)) return true;\\r\\n if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;\\r\\n if (n.lesser(49)) return true;\\r\\n // we don't know if it's prime: let the other functions figure it out\\r\\n }\\r\\n\\r\\n function millerRabinTest(n, a) {\\r\\n var nPrev = n.prev(),\\r\\n b = nPrev,\\r\\n r = 0,\\r\\n d, t, i, x;\\r\\n while (b.isEven()) b = b.divide(2), r++;\\r\\n next: for (i = 0; i < a.length; i++) {\\r\\n if (n.lesser(a[i])) continue;\\r\\n x = bigInt(a[i]).modPow(b, n);\\r\\n if (x.isUnit() || x.equals(nPrev)) continue;\\r\\n for (d = r - 1; d != 0; d--) {\\r\\n x = x.square().mod(n);\\r\\n if (x.isUnit()) return false;\\r\\n if (x.equals(nPrev)) continue next;\\r\\n }\\r\\n return false;\\r\\n }\\r\\n return true;\\r\\n }\\r\\n\\r\\n // Set \\\"strict\\\" to true to force GRH-supported lower bound of 2*log(N)^2\\r\\n BigInteger.prototype.isPrime = function (strict) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var bits = n.bitLength();\\r\\n if (bits <= 64)\\r\\n return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);\\r\\n var logN = Math.log(2) * bits.toJSNumber();\\r\\n var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt(i + 2));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;\\r\\n\\r\\n BigInteger.prototype.isProbablePrime = function (iterations, rng) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var t = iterations === undefined ? 5 : iterations;\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt.randBetween(2, n.minus(2), rng));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;\\r\\n\\r\\n BigInteger.prototype.modInv = function (n) {\\r\\n var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;\\r\\n while (!newR.isZero()) {\\r\\n q = r.divide(newR);\\r\\n lastT = t;\\r\\n lastR = r;\\r\\n t = newT;\\r\\n r = newR;\\r\\n newT = lastT.subtract(q.multiply(newT));\\r\\n newR = lastR.subtract(q.multiply(newR));\\r\\n }\\r\\n if (!r.isUnit()) throw new Error(this.toString() + \\\" and \\\" + n.toString() + \\\" are not co-prime\\\");\\r\\n if (t.compare(0) === -1) {\\r\\n t = t.add(n);\\r\\n }\\r\\n if (this.isNegative()) {\\r\\n return t.negate();\\r\\n }\\r\\n return t;\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;\\r\\n\\r\\n BigInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n }\\r\\n return new BigInteger(addSmall(value, 1), this.sign);\\r\\n };\\r\\n SmallInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (value + 1 < MAX_INT) return new SmallInteger(value + 1);\\r\\n return new BigInteger(MAX_INT_ARR, false);\\r\\n };\\r\\n NativeBigInt.prototype.next = function () {\\r\\n return new NativeBigInt(this.value + BigInt(1));\\r\\n }\\r\\n\\r\\n BigInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return new BigInteger(addSmall(value, 1), true);\\r\\n }\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n };\\r\\n SmallInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);\\r\\n return new BigInteger(MAX_INT_ARR, true);\\r\\n };\\r\\n NativeBigInt.prototype.prev = function () {\\r\\n return new NativeBigInt(this.value - BigInt(1));\\r\\n }\\r\\n\\r\\n var powersOfTwo = [1];\\r\\n while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);\\r\\n var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];\\r\\n\\r\\n function shift_isSmall(n) {\\r\\n return Math.abs(n) <= BASE;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.shiftLeft = function (v) {\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftRight(-n);\\r\\n var result = this;\\r\\n if (result.isZero()) return result;\\r\\n while (n >= powers2Length) {\\r\\n result = result.multiply(highestPower2);\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n return result.multiply(powersOfTwo[n]);\\r\\n };\\r\\n NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;\\r\\n\\r\\n BigInteger.prototype.shiftRight = function (v) {\\r\\n var remQuo;\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftLeft(-n);\\r\\n var result = this;\\r\\n while (n >= powers2Length) {\\r\\n if (result.isZero() || (result.isNegative() && result.isUnit())) return result;\\r\\n remQuo = divModAny(result, highestPower2);\\r\\n result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n remQuo = divModAny(result, powersOfTwo[n]);\\r\\n return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n };\\r\\n NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;\\r\\n\\r\\n function bitwise(x, y, fn) {\\r\\n y = parseValue(y);\\r\\n var xSign = x.isNegative(), ySign = y.isNegative();\\r\\n var xRem = xSign ? x.not() : x,\\r\\n yRem = ySign ? y.not() : y;\\r\\n var xDigit = 0, yDigit = 0;\\r\\n var xDivMod = null, yDivMod = null;\\r\\n var result = [];\\r\\n while (!xRem.isZero() || !yRem.isZero()) {\\r\\n xDivMod = divModAny(xRem, highestPower2);\\r\\n xDigit = xDivMod[1].toJSNumber();\\r\\n if (xSign) {\\r\\n xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n yDivMod = divModAny(yRem, highestPower2);\\r\\n yDigit = yDivMod[1].toJSNumber();\\r\\n if (ySign) {\\r\\n yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n xRem = xDivMod[0];\\r\\n yRem = yDivMod[0];\\r\\n result.push(fn(xDigit, yDigit));\\r\\n }\\r\\n var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);\\r\\n for (var i = result.length - 1; i >= 0; i -= 1) {\\r\\n sum = sum.multiply(highestPower2).add(bigInt(result[i]));\\r\\n }\\r\\n return sum;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.not = function () {\\r\\n return this.negate().prev();\\r\\n };\\r\\n NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;\\r\\n\\r\\n BigInteger.prototype.and = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a & b; });\\r\\n };\\r\\n NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;\\r\\n\\r\\n BigInteger.prototype.or = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a | b; });\\r\\n };\\r\\n NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;\\r\\n\\r\\n BigInteger.prototype.xor = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a ^ b; });\\r\\n };\\r\\n NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;\\r\\n\\r\\n var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;\\r\\n function roughLOB(n) { // get lowestOneBit (rough)\\r\\n // SmallInteger: return Min(lowestOneBit(n), 1 << 30)\\r\\n // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]\\r\\n var v = n.value,\\r\\n x = typeof v === \\\"number\\\" ? v | LOBMASK_I :\\r\\n typeof v === \\\"bigint\\\" ? v | BigInt(LOBMASK_I) :\\r\\n v[0] + v[1] * BASE | LOBMASK_BI;\\r\\n return x & -x;\\r\\n }\\r\\n\\r\\n function integerLogarithm(value, base) {\\r\\n if (base.compareTo(value) <= 0) {\\r\\n var tmp = integerLogarithm(value, base.square(base));\\r\\n var p = tmp.p;\\r\\n var e = tmp.e;\\r\\n var t = p.multiply(base);\\r\\n return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };\\r\\n }\\r\\n return { p: bigInt(1), e: 0 };\\r\\n }\\r\\n\\r\\n BigInteger.prototype.bitLength = function () {\\r\\n var n = this;\\r\\n if (n.compareTo(bigInt(0)) < 0) {\\r\\n n = n.negate().subtract(bigInt(1));\\r\\n }\\r\\n if (n.compareTo(bigInt(0)) === 0) {\\r\\n return bigInt(0);\\r\\n }\\r\\n return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));\\r\\n }\\r\\n NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;\\r\\n\\r\\n function max(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.greater(b) ? a : b;\\r\\n }\\r\\n function min(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.lesser(b) ? a : b;\\r\\n }\\r\\n function gcd(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n if (a.equals(b)) return a;\\r\\n if (a.isZero()) return b;\\r\\n if (b.isZero()) return a;\\r\\n var c = Integer[1], d, t;\\r\\n while (a.isEven() && b.isEven()) {\\r\\n d = min(roughLOB(a), roughLOB(b));\\r\\n a = a.divide(d);\\r\\n b = b.divide(d);\\r\\n c = c.multiply(d);\\r\\n }\\r\\n while (a.isEven()) {\\r\\n a = a.divide(roughLOB(a));\\r\\n }\\r\\n do {\\r\\n while (b.isEven()) {\\r\\n b = b.divide(roughLOB(b));\\r\\n }\\r\\n if (a.greater(b)) {\\r\\n t = b; b = a; a = t;\\r\\n }\\r\\n b = b.subtract(a);\\r\\n } while (!b.isZero());\\r\\n return c.isUnit() ? a : a.multiply(c);\\r\\n }\\r\\n function lcm(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n return a.divide(gcd(a, b)).multiply(b);\\r\\n }\\r\\n function randBetween(a, b, rng) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n var usedRNG = rng || Math.random;\\r\\n var low = min(a, b), high = max(a, b);\\r\\n var range = high.subtract(low).add(1);\\r\\n if (range.isSmall) return low.add(Math.floor(usedRNG() * range));\\r\\n var digits = toBase(range, BASE).value;\\r\\n var result = [], restricted = true;\\r\\n for (var i = 0; i < digits.length; i++) {\\r\\n var top = restricted ? digits[i] : BASE;\\r\\n var digit = truncate(usedRNG() * top);\\r\\n result.push(digit);\\r\\n if (digit < top) restricted = false;\\r\\n }\\r\\n return low.add(Integer.fromArray(result, BASE, false));\\r\\n }\\r\\n\\r\\n var parseBase = function (text, base, alphabet, caseSensitive) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n text = String(text);\\r\\n if (!caseSensitive) {\\r\\n text = text.toLowerCase();\\r\\n alphabet = alphabet.toLowerCase();\\r\\n }\\r\\n var length = text.length;\\r\\n var i;\\r\\n var absBase = Math.abs(base);\\r\\n var alphabetValues = {};\\r\\n for (i = 0; i < alphabet.length; i++) {\\r\\n alphabetValues[alphabet[i]] = i;\\r\\n }\\r\\n for (i = 0; i < length; i++) {\\r\\n var c = text[i];\\r\\n if (c === \\\"-\\\") continue;\\r\\n if (c in alphabetValues) {\\r\\n if (alphabetValues[c] >= absBase) {\\r\\n if (c === \\\"1\\\" && absBase === 1) continue;\\r\\n throw new Error(c + \\\" is not a valid digit in base \\\" + base + \\\".\\\");\\r\\n }\\r\\n }\\r\\n }\\r\\n base = parseValue(base);\\r\\n var digits = [];\\r\\n var isNegative = text[0] === \\\"-\\\";\\r\\n for (i = isNegative ? 1 : 0; i < text.length; i++) {\\r\\n var c = text[i];\\r\\n if (c in alphabetValues) digits.push(parseValue(alphabetValues[c]));\\r\\n else if (c === \\\"<\\\") {\\r\\n var start = i;\\r\\n do { i++; } while (text[i] !== \\\">\\\" && i < text.length);\\r\\n digits.push(parseValue(text.slice(start + 1, i)));\\r\\n }\\r\\n else throw new Error(c + \\\" is not a valid character\\\");\\r\\n }\\r\\n return parseBaseFromArray(digits, base, isNegative);\\r\\n };\\r\\n\\r\\n function parseBaseFromArray(digits, base, isNegative) {\\r\\n var val = Integer[0], pow = Integer[1], i;\\r\\n for (i = digits.length - 1; i >= 0; i--) {\\r\\n val = val.add(digits[i].times(pow));\\r\\n pow = pow.times(base);\\r\\n }\\r\\n return isNegative ? val.negate() : val;\\r\\n }\\r\\n\\r\\n function stringify(digit, alphabet) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n if (digit < alphabet.length) {\\r\\n return alphabet[digit];\\r\\n }\\r\\n return \\\"<\\\" + digit + \\\">\\\";\\r\\n }\\r\\n\\r\\n function toBase(n, base) {\\r\\n base = bigInt(base);\\r\\n if (base.isZero()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n throw new Error(\\\"Cannot convert nonzero numbers to base 0.\\\");\\r\\n }\\r\\n if (base.equals(-1)) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n if (n.isNegative())\\r\\n return {\\r\\n value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber()))\\r\\n .map(Array.prototype.valueOf, [1, 0])\\r\\n ),\\r\\n isNegative: false\\r\\n };\\r\\n\\r\\n var arr = Array.apply(null, Array(n.toJSNumber() - 1))\\r\\n .map(Array.prototype.valueOf, [0, 1]);\\r\\n arr.unshift([1]);\\r\\n return {\\r\\n value: [].concat.apply([], arr),\\r\\n isNegative: false\\r\\n };\\r\\n }\\r\\n\\r\\n var neg = false;\\r\\n if (n.isNegative() && base.isPositive()) {\\r\\n neg = true;\\r\\n n = n.abs();\\r\\n }\\r\\n if (base.isUnit()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n\\r\\n return {\\r\\n value: Array.apply(null, Array(n.toJSNumber()))\\r\\n .map(Number.prototype.valueOf, 1),\\r\\n isNegative: neg\\r\\n };\\r\\n }\\r\\n var out = [];\\r\\n var left = n, divmod;\\r\\n while (left.isNegative() || left.compareAbs(base) >= 0) {\\r\\n divmod = left.divmod(base);\\r\\n left = divmod.quotient;\\r\\n var digit = divmod.remainder;\\r\\n if (digit.isNegative()) {\\r\\n digit = base.minus(digit).abs();\\r\\n left = left.next();\\r\\n }\\r\\n out.push(digit.toJSNumber());\\r\\n }\\r\\n out.push(left.toJSNumber());\\r\\n return { value: out.reverse(), isNegative: neg };\\r\\n }\\r\\n\\r\\n function toBaseString(n, base, alphabet) {\\r\\n var arr = toBase(n, base);\\r\\n return (arr.isNegative ? \\\"-\\\" : \\\"\\\") + arr.value.map(function (x) {\\r\\n return stringify(x, alphabet);\\r\\n }).join('');\\r\\n }\\r\\n\\r\\n BigInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix !== 10) return toBaseString(this, radix, alphabet);\\r\\n var v = this.value, l = v.length, str = String(v[--l]), zeros = \\\"0000000\\\", digit;\\r\\n while (--l >= 0) {\\r\\n digit = String(v[l]);\\r\\n str += zeros.slice(digit.length) + digit;\\r\\n }\\r\\n var sign = this.sign ? \\\"-\\\" : \\\"\\\";\\r\\n return sign + str;\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix != 10) return toBaseString(this, radix, alphabet);\\r\\n return String(this.value);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toString = SmallInteger.prototype.toString;\\r\\n\\r\\n NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }\\r\\n\\r\\n BigInteger.prototype.valueOf = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n };\\r\\n BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;\\r\\n\\r\\n SmallInteger.prototype.valueOf = function () {\\r\\n return this.value;\\r\\n };\\r\\n SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;\\r\\n NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n }\\r\\n\\r\\n function parseStringValue(v) {\\r\\n if (isPrecise(+v)) {\\r\\n var x = +v;\\r\\n if (x === truncate(x))\\r\\n return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);\\r\\n throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n }\\r\\n var sign = v[0] === \\\"-\\\";\\r\\n if (sign) v = v.slice(1);\\r\\n var split = v.split(/e/i);\\r\\n if (split.length > 2) throw new Error(\\\"Invalid integer: \\\" + split.join(\\\"e\\\"));\\r\\n if (split.length === 2) {\\r\\n var exp = split[1];\\r\\n if (exp[0] === \\\"+\\\") exp = exp.slice(1);\\r\\n exp = +exp;\\r\\n if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error(\\\"Invalid integer: \\\" + exp + \\\" is not a valid exponent.\\\");\\r\\n var text = split[0];\\r\\n var decimalPlace = text.indexOf(\\\".\\\");\\r\\n if (decimalPlace >= 0) {\\r\\n exp -= text.length - decimalPlace - 1;\\r\\n text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);\\r\\n }\\r\\n if (exp < 0) throw new Error(\\\"Cannot include negative exponent part for integers\\\");\\r\\n text += (new Array(exp + 1)).join(\\\"0\\\");\\r\\n v = text;\\r\\n }\\r\\n var isValid = /^([0-9][0-9]*)$/.test(v);\\r\\n if (!isValid) throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(sign ? \\\"-\\\" + v : v));\\r\\n }\\r\\n var r = [], max = v.length, l = LOG_BASE, min = max - l;\\r\\n while (max > 0) {\\r\\n r.push(+v.slice(min, max));\\r\\n min -= l;\\r\\n if (min < 0) min = 0;\\r\\n max -= l;\\r\\n }\\r\\n trim(r);\\r\\n return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n function parseNumberValue(v) {\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(v));\\r\\n }\\r\\n if (isPrecise(v)) {\\r\\n if (v !== truncate(v)) throw new Error(v + \\\" is not an integer.\\\");\\r\\n return new SmallInteger(v);\\r\\n }\\r\\n return parseStringValue(v.toString());\\r\\n }\\r\\n\\r\\n function parseValue(v) {\\r\\n if (typeof v === \\\"number\\\") {\\r\\n return parseNumberValue(v);\\r\\n }\\r\\n if (typeof v === \\\"string\\\") {\\r\\n return parseStringValue(v);\\r\\n }\\r\\n if (typeof v === \\\"bigint\\\") {\\r\\n return new NativeBigInt(v);\\r\\n }\\r\\n return v;\\r\\n }\\r\\n // Pre-define numbers in range [-999,999]\\r\\n for (var i = 0; i < 1000; i++) {\\r\\n Integer[i] = parseValue(i);\\r\\n if (i > 0) Integer[-i] = parseValue(-i);\\r\\n }\\r\\n // Backwards compatibility\\r\\n Integer.one = Integer[1];\\r\\n Integer.zero = Integer[0];\\r\\n Integer.minusOne = Integer[-1];\\r\\n Integer.max = max;\\r\\n Integer.min = min;\\r\\n Integer.gcd = gcd;\\r\\n Integer.lcm = lcm;\\r\\n Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; };\\r\\n Integer.randBetween = randBetween;\\r\\n\\r\\n Integer.fromArray = function (digits, base, isNegative) {\\r\\n return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);\\r\\n };\\r\\n\\r\\n return Integer;\\r\\n})();\\r\\n\\r\\n// Node.js check\\r\\nif ( true && module.hasOwnProperty(\\\"exports\\\")) {\\r\\n module.exports = bigInt;\\r\\n}\\r\\n\\r\\n//amd check\\r\\nif (true) {\\r\\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\\r\\n return bigInt;\\r\\n }).call(exports, __webpack_require__, exports, module),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\r\\n}\\r\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \\\"./node_modules/webpack/buildin/module.js\\\")(module)))\\n\\n//# sourceURL=webpack:///./node_modules/big-integer/BigInteger.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/webpack/buildin/module.js\":\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = function(module) {\\n\\tif (!module.webpackPolyfill) {\\n\\t\\tmodule.deprecate = function() {};\\n\\t\\tmodule.paths = [];\\n\\t\\t// module.parent = undefined by default\\n\\t\\tif (!module.children) module.children = [];\\n\\t\\tObject.defineProperty(module, \\\"loaded\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.l;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tObject.defineProperty(module, \\\"id\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.i;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tmodule.webpackPolyfill = 1;\\n\\t}\\n\\treturn module;\\n};\\n\\n\\n//# sourceURL=webpack:///(webpack)/buildin/module.js?\");\n\n/***/ }),\n\n/***/ \"./src/ABC157/B.js\":\n/*!*************************!*\\\n !*** ./src/ABC157/B.js ***!\n \\*************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var fs = __webpack_require__(/*! fs */ \\\"fs\\\");\\n\\nvar bigInt = __webpack_require__(/*! big-integer */ \\\"./node_modules/big-integer/BigInteger.js\\\");\\n\\nvar main = function main(input) {\\n var SIZE = 3;\\n var lines = input.split('\\\\n');\\n var A = [];\\n\\n for (var i = 0; i < SIZE; i++) {\\n A.push(lines.shift().split(' ').map(function (n) {\\n return n - 0;\\n }));\\n }\\n\\n var N = lines.shift();\\n\\n for (var _i = 0; _i < N; _i++) {\\n var number = lines.shift() - 0;\\n\\n for (var y = 0; y < SIZE; y++) {\\n for (var x = 0; x < SIZE; x++) {\\n if (A[y][x] === number) A[y][x] = null;\\n }\\n }\\n }\\n\\n var isBingo = false;\\n\\n var _loop = function _loop(_y) {\\n if (A[_y].every(function (n) {\\n return n === null;\\n })) {\\n isBingo = true;\\n }\\n\\n if (A.every(function (col) {\\n return col[_y] === null;\\n })) {\\n isBingo = true;\\n }\\n };\\n\\n for (var _y = 0; _y < SIZE; _y++) {\\n _loop(_y);\\n }\\n\\n if (A[0][0] === null && A[1][1] === null && A[2][2] === null) {\\n isBingo = true;\\n }\\n\\n if (A[2][0] === null && A[1][1] === null && A[0][2] === null) {\\n isBingo = true;\\n }\\n\\n if (isBingo) {\\n console.log('Yes');\\n } else {\\n console.log('No');\\n }\\n};\\n\\nmain(fs.readFileSync('/dev/stdin', 'utf8'));\\n\\n//# sourceURL=webpack:///./src/ABC157/B.js?\");\n\n/***/ }),\n\n/***/ \"fs\":\n/*!*********************!*\\\n !*** external \"fs\" ***!\n \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = require(\\\"fs\\\");\\n\\n//# sourceURL=webpack:///external_%22fs%22?\");\n\n/***/ })\n\n/******/ });", "language": "JavaScript", "metadata": {"date": 1583116462, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02760/input.txt", "sample_output_relpath": "derived/input_output/data/p02760/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02760/JavaScript/s468542151.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s468542151", "user_id": "u279835114"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// define __esModule on exports\n/******/ \t__webpack_require__.r = function(exports) {\n/******/ \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n/******/ \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n/******/ \t\t}\n/******/ \t\tObject.defineProperty(exports, '__esModule', { value: true });\n/******/ \t};\n/******/\n/******/ \t// create a fake namespace object\n/******/ \t// mode & 1: value is a module id, require it\n/******/ \t// mode & 2: merge all properties of value into the ns\n/******/ \t// mode & 4: return value when already ns object\n/******/ \t// mode & 8|1: behave like require\n/******/ \t__webpack_require__.t = function(value, mode) {\n/******/ \t\tif(mode & 1) value = __webpack_require__(value);\n/******/ \t\tif(mode & 8) return value;\n/******/ \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n/******/ \t\tvar ns = Object.create(null);\n/******/ \t\t__webpack_require__.r(ns);\n/******/ \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n/******/ \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n/******/ \t\treturn ns;\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = \"./src/ABC157/B.js\");\n/******/ })\n/************************************************************************/\n/******/ ({\n\n/***/ \"./node_modules/big-integer/BigInteger.js\":\n/*!************************************************!*\\\n !*** ./node_modules/big-integer/BigInteger.js ***!\n \\************************************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;var bigInt = (function (undefined) {\\r\\n \\\"use strict\\\";\\r\\n\\r\\n var BASE = 1e7,\\r\\n LOG_BASE = 7,\\r\\n MAX_INT = 9007199254740992,\\r\\n MAX_INT_ARR = smallToArray(MAX_INT),\\r\\n DEFAULT_ALPHABET = \\\"0123456789abcdefghijklmnopqrstuvwxyz\\\";\\r\\n\\r\\n var supportsNativeBigInt = typeof BigInt === \\\"function\\\";\\r\\n\\r\\n function Integer(v, radix, alphabet, caseSensitive) {\\r\\n if (typeof v === \\\"undefined\\\") return Integer[0];\\r\\n if (typeof radix !== \\\"undefined\\\") return +radix === 10 && !alphabet ? parseValue(v) : parseBase(v, radix, alphabet, caseSensitive);\\r\\n return parseValue(v);\\r\\n }\\r\\n\\r\\n function BigInteger(value, sign) {\\r\\n this.value = value;\\r\\n this.sign = sign;\\r\\n this.isSmall = false;\\r\\n }\\r\\n BigInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function SmallInteger(value) {\\r\\n this.value = value;\\r\\n this.sign = value < 0;\\r\\n this.isSmall = true;\\r\\n }\\r\\n SmallInteger.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function NativeBigInt(value) {\\r\\n this.value = value;\\r\\n }\\r\\n NativeBigInt.prototype = Object.create(Integer.prototype);\\r\\n\\r\\n function isPrecise(n) {\\r\\n return -MAX_INT < n && n < MAX_INT;\\r\\n }\\r\\n\\r\\n function smallToArray(n) { // For performance reasons doesn't reference BASE, need to change this function if BASE changes\\r\\n if (n < 1e7)\\r\\n return [n];\\r\\n if (n < 1e14)\\r\\n return [n % 1e7, Math.floor(n / 1e7)];\\r\\n return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)];\\r\\n }\\r\\n\\r\\n function arrayToSmall(arr) { // If BASE changes this function may need to change\\r\\n trim(arr);\\r\\n var length = arr.length;\\r\\n if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) {\\r\\n switch (length) {\\r\\n case 0: return 0;\\r\\n case 1: return arr[0];\\r\\n case 2: return arr[0] + arr[1] * BASE;\\r\\n default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE;\\r\\n }\\r\\n }\\r\\n return arr;\\r\\n }\\r\\n\\r\\n function trim(v) {\\r\\n var i = v.length;\\r\\n while (v[--i] === 0);\\r\\n v.length = i + 1;\\r\\n }\\r\\n\\r\\n function createArray(length) { // function shamelessly stolen from Yaffle's library https://github.com/Yaffle/BigInteger\\r\\n var x = new Array(length);\\r\\n var i = -1;\\r\\n while (++i < length) {\\r\\n x[i] = 0;\\r\\n }\\r\\n return x;\\r\\n }\\r\\n\\r\\n function truncate(n) {\\r\\n if (n > 0) return Math.floor(n);\\r\\n return Math.ceil(n);\\r\\n }\\r\\n\\r\\n function add(a, b) { // assumes a and b are arrays with a.length >= b.length\\r\\n var l_a = a.length,\\r\\n l_b = b.length,\\r\\n r = new Array(l_a),\\r\\n carry = 0,\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l_b; i++) {\\r\\n sum = a[i] + b[i] + carry;\\r\\n carry = sum >= base ? 1 : 0;\\r\\n r[i] = sum - carry * base;\\r\\n }\\r\\n while (i < l_a) {\\r\\n sum = a[i] + carry;\\r\\n carry = sum === base ? 1 : 0;\\r\\n r[i++] = sum - carry * base;\\r\\n }\\r\\n if (carry > 0) r.push(carry);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function addAny(a, b) {\\r\\n if (a.length >= b.length) return add(a, b);\\r\\n return add(b, a);\\r\\n }\\r\\n\\r\\n function addSmall(a, carry) { // assumes a is array, carry is number with 0 <= carry < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n sum, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n sum = a[i] - base + carry;\\r\\n carry = Math.floor(sum / base);\\r\\n r[i] = sum - carry * base;\\r\\n carry += 1;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new BigInteger(addSmall(a, Math.abs(b)), this.sign);\\r\\n }\\r\\n return new BigInteger(addAny(a, b), this.sign);\\r\\n };\\r\\n BigInteger.prototype.plus = BigInteger.prototype.add;\\r\\n\\r\\n SmallInteger.prototype.add = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.subtract(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n if (isPrecise(a + b)) return new SmallInteger(a + b);\\r\\n b = smallToArray(Math.abs(b));\\r\\n }\\r\\n return new BigInteger(addSmall(b, Math.abs(a)), a < 0);\\r\\n };\\r\\n SmallInteger.prototype.plus = SmallInteger.prototype.add;\\r\\n\\r\\n NativeBigInt.prototype.add = function (v) {\\r\\n return new NativeBigInt(this.value + parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.plus = NativeBigInt.prototype.add;\\r\\n\\r\\n function subtract(a, b) { // assumes a and b are arrays with a >= b\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n r = new Array(a_l),\\r\\n borrow = 0,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < b_l; i++) {\\r\\n difference = a[i] - borrow - b[i];\\r\\n if (difference < 0) {\\r\\n difference += base;\\r\\n borrow = 1;\\r\\n } else borrow = 0;\\r\\n r[i] = difference;\\r\\n }\\r\\n for (i = b_l; i < a_l; i++) {\\r\\n difference = a[i] - borrow;\\r\\n if (difference < 0) difference += base;\\r\\n else {\\r\\n r[i++] = difference;\\r\\n break;\\r\\n }\\r\\n r[i] = difference;\\r\\n }\\r\\n for (; i < a_l; i++) {\\r\\n r[i] = a[i];\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function subtractAny(a, b, sign) {\\r\\n var value;\\r\\n if (compareAbs(a, b) >= 0) {\\r\\n value = subtract(a, b);\\r\\n } else {\\r\\n value = subtract(b, a);\\r\\n sign = !sign;\\r\\n }\\r\\n value = arrayToSmall(value);\\r\\n if (typeof value === \\\"number\\\") {\\r\\n if (sign) value = -value;\\r\\n return new SmallInteger(value);\\r\\n }\\r\\n return new BigInteger(value, sign);\\r\\n }\\r\\n\\r\\n function subtractSmall(a, b, sign) { // assumes a is array, b is number with 0 <= b < MAX_INT\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n carry = -b,\\r\\n base = BASE,\\r\\n i, difference;\\r\\n for (i = 0; i < l; i++) {\\r\\n difference = a[i] + carry;\\r\\n carry = Math.floor(difference / base);\\r\\n difference %= base;\\r\\n r[i] = difference < 0 ? difference + base : difference;\\r\\n }\\r\\n r = arrayToSmall(r);\\r\\n if (typeof r === \\\"number\\\") {\\r\\n if (sign) r = -r;\\r\\n return new SmallInteger(r);\\r\\n } return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (this.sign !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var a = this.value, b = n.value;\\r\\n if (n.isSmall)\\r\\n return subtractSmall(a, Math.abs(b), this.sign);\\r\\n return subtractAny(a, b, this.sign);\\r\\n };\\r\\n BigInteger.prototype.minus = BigInteger.prototype.subtract;\\r\\n\\r\\n SmallInteger.prototype.subtract = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value;\\r\\n if (a < 0 !== n.sign) {\\r\\n return this.add(n.negate());\\r\\n }\\r\\n var b = n.value;\\r\\n if (n.isSmall) {\\r\\n return new SmallInteger(a - b);\\r\\n }\\r\\n return subtractSmall(b, Math.abs(a), a >= 0);\\r\\n };\\r\\n SmallInteger.prototype.minus = SmallInteger.prototype.subtract;\\r\\n\\r\\n NativeBigInt.prototype.subtract = function (v) {\\r\\n return new NativeBigInt(this.value - parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.minus = NativeBigInt.prototype.subtract;\\r\\n\\r\\n BigInteger.prototype.negate = function () {\\r\\n return new BigInteger(this.value, !this.sign);\\r\\n };\\r\\n SmallInteger.prototype.negate = function () {\\r\\n var sign = this.sign;\\r\\n var small = new SmallInteger(-this.value);\\r\\n small.sign = !sign;\\r\\n return small;\\r\\n };\\r\\n NativeBigInt.prototype.negate = function () {\\r\\n return new NativeBigInt(-this.value);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.abs = function () {\\r\\n return new BigInteger(this.value, false);\\r\\n };\\r\\n SmallInteger.prototype.abs = function () {\\r\\n return new SmallInteger(Math.abs(this.value));\\r\\n };\\r\\n NativeBigInt.prototype.abs = function () {\\r\\n return new NativeBigInt(this.value >= 0 ? this.value : -this.value);\\r\\n }\\r\\n\\r\\n\\r\\n function multiplyLong(a, b) {\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n l = a_l + b_l,\\r\\n r = createArray(l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, b_j;\\r\\n for (i = 0; i < a_l; ++i) {\\r\\n a_i = a[i];\\r\\n for (var j = 0; j < b_l; ++j) {\\r\\n b_j = b[j];\\r\\n product = a_i * b_j + r[i + j];\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n r[i + j + 1] += carry;\\r\\n }\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n function multiplySmall(a, b) { // assumes a is array, b is number with |b| < BASE\\r\\n var l = a.length,\\r\\n r = new Array(l),\\r\\n base = BASE,\\r\\n carry = 0,\\r\\n product, i;\\r\\n for (i = 0; i < l; i++) {\\r\\n product = a[i] * b + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i] = product - carry * base;\\r\\n }\\r\\n while (carry > 0) {\\r\\n r[i++] = carry % base;\\r\\n carry = Math.floor(carry / base);\\r\\n }\\r\\n return r;\\r\\n }\\r\\n\\r\\n function shiftLeft(x, n) {\\r\\n var r = [];\\r\\n while (n-- > 0) r.push(0);\\r\\n return r.concat(x);\\r\\n }\\r\\n\\r\\n function multiplyKaratsuba(x, y) {\\r\\n var n = Math.max(x.length, y.length);\\r\\n\\r\\n if (n <= 30) return multiplyLong(x, y);\\r\\n n = Math.ceil(n / 2);\\r\\n\\r\\n var b = x.slice(n),\\r\\n a = x.slice(0, n),\\r\\n d = y.slice(n),\\r\\n c = y.slice(0, n);\\r\\n\\r\\n var ac = multiplyKaratsuba(a, c),\\r\\n bd = multiplyKaratsuba(b, d),\\r\\n abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d));\\r\\n\\r\\n var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n));\\r\\n trim(product);\\r\\n return product;\\r\\n }\\r\\n\\r\\n // The following function is derived from a surface fit of a graph plotting the performance difference\\r\\n // between long multiplication and karatsuba multiplication versus the lengths of the two arrays.\\r\\n function useKaratsuba(l1, l2) {\\r\\n return -0.012 * l1 - 0.012 * l2 + 0.000015 * l1 * l2 > 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.multiply = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value, b = n.value,\\r\\n sign = this.sign !== n.sign,\\r\\n abs;\\r\\n if (n.isSmall) {\\r\\n if (b === 0) return Integer[0];\\r\\n if (b === 1) return this;\\r\\n if (b === -1) return this.negate();\\r\\n abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n return new BigInteger(multiplySmall(a, abs), sign);\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n if (useKaratsuba(a.length, b.length)) // Karatsuba is only faster for certain array sizes\\r\\n return new BigInteger(multiplyKaratsuba(a, b), sign);\\r\\n return new BigInteger(multiplyLong(a, b), sign);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.times = BigInteger.prototype.multiply;\\r\\n\\r\\n function multiplySmallAndArray(a, b, sign) { // a >= 0\\r\\n if (a < BASE) {\\r\\n return new BigInteger(multiplySmall(b, a), sign);\\r\\n }\\r\\n return new BigInteger(multiplyLong(b, smallToArray(a)), sign);\\r\\n }\\r\\n SmallInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (isPrecise(a.value * this.value)) {\\r\\n return new SmallInteger(a.value * this.value);\\r\\n }\\r\\n return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign);\\r\\n };\\r\\n BigInteger.prototype._multiplyBySmall = function (a) {\\r\\n if (a.value === 0) return Integer[0];\\r\\n if (a.value === 1) return this;\\r\\n if (a.value === -1) return this.negate();\\r\\n return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign);\\r\\n };\\r\\n SmallInteger.prototype.multiply = function (v) {\\r\\n return parseValue(v)._multiplyBySmall(this);\\r\\n };\\r\\n SmallInteger.prototype.times = SmallInteger.prototype.multiply;\\r\\n\\r\\n NativeBigInt.prototype.multiply = function (v) {\\r\\n return new NativeBigInt(this.value * parseValue(v).value);\\r\\n }\\r\\n NativeBigInt.prototype.times = NativeBigInt.prototype.multiply;\\r\\n\\r\\n function square(a) {\\r\\n //console.assert(2 * BASE * BASE < MAX_INT);\\r\\n var l = a.length,\\r\\n r = createArray(l + l),\\r\\n base = BASE,\\r\\n product, carry, i, a_i, a_j;\\r\\n for (i = 0; i < l; i++) {\\r\\n a_i = a[i];\\r\\n carry = 0 - a_i * a_i;\\r\\n for (var j = i; j < l; j++) {\\r\\n a_j = a[j];\\r\\n product = 2 * (a_i * a_j) + r[i + j] + carry;\\r\\n carry = Math.floor(product / base);\\r\\n r[i + j] = product - carry * base;\\r\\n }\\r\\n r[i + l] = carry;\\r\\n }\\r\\n trim(r);\\r\\n return r;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.square = function () {\\r\\n return new BigInteger(square(this.value), false);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.square = function () {\\r\\n var value = this.value * this.value;\\r\\n if (isPrecise(value)) return new SmallInteger(value);\\r\\n return new BigInteger(square(smallToArray(Math.abs(this.value))), false);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.square = function (v) {\\r\\n return new NativeBigInt(this.value * this.value);\\r\\n }\\r\\n\\r\\n function divMod1(a, b) { // Left over from previous version. Performs faster than divMod2 on smaller input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n base = BASE,\\r\\n result = createArray(b.length),\\r\\n divisorMostSignificantDigit = b[b_l - 1],\\r\\n // normalization\\r\\n lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)),\\r\\n remainder = multiplySmall(a, lambda),\\r\\n divisor = multiplySmall(b, lambda),\\r\\n quotientDigit, shift, carry, borrow, i, l, q;\\r\\n if (remainder.length <= a_l) remainder.push(0);\\r\\n divisor.push(0);\\r\\n divisorMostSignificantDigit = divisor[b_l - 1];\\r\\n for (shift = a_l - b_l; shift >= 0; shift--) {\\r\\n quotientDigit = base - 1;\\r\\n if (remainder[shift + b_l] !== divisorMostSignificantDigit) {\\r\\n quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit);\\r\\n }\\r\\n // quotientDigit <= base - 1\\r\\n carry = 0;\\r\\n borrow = 0;\\r\\n l = divisor.length;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += quotientDigit * divisor[i];\\r\\n q = Math.floor(carry / base);\\r\\n borrow += remainder[shift + i] - (carry - q * base);\\r\\n carry = q;\\r\\n if (borrow < 0) {\\r\\n remainder[shift + i] = borrow + base;\\r\\n borrow = -1;\\r\\n } else {\\r\\n remainder[shift + i] = borrow;\\r\\n borrow = 0;\\r\\n }\\r\\n }\\r\\n while (borrow !== 0) {\\r\\n quotientDigit -= 1;\\r\\n carry = 0;\\r\\n for (i = 0; i < l; i++) {\\r\\n carry += remainder[shift + i] - base + divisor[i];\\r\\n if (carry < 0) {\\r\\n remainder[shift + i] = carry + base;\\r\\n carry = 0;\\r\\n } else {\\r\\n remainder[shift + i] = carry;\\r\\n carry = 1;\\r\\n }\\r\\n }\\r\\n borrow += carry;\\r\\n }\\r\\n result[shift] = quotientDigit;\\r\\n }\\r\\n // denormalization\\r\\n remainder = divModSmall(remainder, lambda)[0];\\r\\n return [arrayToSmall(result), arrayToSmall(remainder)];\\r\\n }\\r\\n\\r\\n function divMod2(a, b) { // Implementation idea shamelessly stolen from Silent Matt's library http://silentmatt.com/biginteger/\\r\\n // Performs faster than divMod1 on larger input sizes.\\r\\n var a_l = a.length,\\r\\n b_l = b.length,\\r\\n result = [],\\r\\n part = [],\\r\\n base = BASE,\\r\\n guess, xlen, highx, highy, check;\\r\\n while (a_l) {\\r\\n part.unshift(a[--a_l]);\\r\\n trim(part);\\r\\n if (compareAbs(part, b) < 0) {\\r\\n result.push(0);\\r\\n continue;\\r\\n }\\r\\n xlen = part.length;\\r\\n highx = part[xlen - 1] * base + part[xlen - 2];\\r\\n highy = b[b_l - 1] * base + b[b_l - 2];\\r\\n if (xlen > b_l) {\\r\\n highx = (highx + 1) * base;\\r\\n }\\r\\n guess = Math.ceil(highx / highy);\\r\\n do {\\r\\n check = multiplySmall(b, guess);\\r\\n if (compareAbs(check, part) <= 0) break;\\r\\n guess--;\\r\\n } while (guess);\\r\\n result.push(guess);\\r\\n part = subtract(part, check);\\r\\n }\\r\\n result.reverse();\\r\\n return [arrayToSmall(result), arrayToSmall(part)];\\r\\n }\\r\\n\\r\\n function divModSmall(value, lambda) {\\r\\n var length = value.length,\\r\\n quotient = createArray(length),\\r\\n base = BASE,\\r\\n i, q, remainder, divisor;\\r\\n remainder = 0;\\r\\n for (i = length - 1; i >= 0; --i) {\\r\\n divisor = remainder * base + value[i];\\r\\n q = truncate(divisor / lambda);\\r\\n remainder = divisor - q * lambda;\\r\\n quotient[i] = q | 0;\\r\\n }\\r\\n return [quotient, remainder | 0];\\r\\n }\\r\\n\\r\\n function divModAny(self, v) {\\r\\n var value, n = parseValue(v);\\r\\n if (supportsNativeBigInt) {\\r\\n return [new NativeBigInt(self.value / n.value), new NativeBigInt(self.value % n.value)];\\r\\n }\\r\\n var a = self.value, b = n.value;\\r\\n var quotient;\\r\\n if (b === 0) throw new Error(\\\"Cannot divide by zero\\\");\\r\\n if (self.isSmall) {\\r\\n if (n.isSmall) {\\r\\n return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)];\\r\\n }\\r\\n return [Integer[0], self];\\r\\n }\\r\\n if (n.isSmall) {\\r\\n if (b === 1) return [self, Integer[0]];\\r\\n if (b == -1) return [self.negate(), Integer[0]];\\r\\n var abs = Math.abs(b);\\r\\n if (abs < BASE) {\\r\\n value = divModSmall(a, abs);\\r\\n quotient = arrayToSmall(value[0]);\\r\\n var remainder = value[1];\\r\\n if (self.sign) remainder = -remainder;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (self.sign !== n.sign) quotient = -quotient;\\r\\n return [new SmallInteger(quotient), new SmallInteger(remainder)];\\r\\n }\\r\\n return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)];\\r\\n }\\r\\n b = smallToArray(abs);\\r\\n }\\r\\n var comparison = compareAbs(a, b);\\r\\n if (comparison === -1) return [Integer[0], self];\\r\\n if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]];\\r\\n\\r\\n // divMod1 is faster on smaller input sizes\\r\\n if (a.length + b.length <= 200)\\r\\n value = divMod1(a, b);\\r\\n else value = divMod2(a, b);\\r\\n\\r\\n quotient = value[0];\\r\\n var qSign = self.sign !== n.sign,\\r\\n mod = value[1],\\r\\n mSign = self.sign;\\r\\n if (typeof quotient === \\\"number\\\") {\\r\\n if (qSign) quotient = -quotient;\\r\\n quotient = new SmallInteger(quotient);\\r\\n } else quotient = new BigInteger(quotient, qSign);\\r\\n if (typeof mod === \\\"number\\\") {\\r\\n if (mSign) mod = -mod;\\r\\n mod = new SmallInteger(mod);\\r\\n } else mod = new BigInteger(mod, mSign);\\r\\n return [quotient, mod];\\r\\n }\\r\\n\\r\\n BigInteger.prototype.divmod = function (v) {\\r\\n var result = divModAny(this, v);\\r\\n return {\\r\\n quotient: result[0],\\r\\n remainder: result[1]\\r\\n };\\r\\n };\\r\\n NativeBigInt.prototype.divmod = SmallInteger.prototype.divmod = BigInteger.prototype.divmod;\\r\\n\\r\\n\\r\\n BigInteger.prototype.divide = function (v) {\\r\\n return divModAny(this, v)[0];\\r\\n };\\r\\n NativeBigInt.prototype.over = NativeBigInt.prototype.divide = function (v) {\\r\\n return new NativeBigInt(this.value / parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide;\\r\\n\\r\\n BigInteger.prototype.mod = function (v) {\\r\\n return divModAny(this, v)[1];\\r\\n };\\r\\n NativeBigInt.prototype.mod = NativeBigInt.prototype.remainder = function (v) {\\r\\n return new NativeBigInt(this.value % parseValue(v).value);\\r\\n };\\r\\n SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod;\\r\\n\\r\\n BigInteger.prototype.pow = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value,\\r\\n value, x, y;\\r\\n if (b === 0) return Integer[1];\\r\\n if (a === 0) return Integer[0];\\r\\n if (a === 1) return Integer[1];\\r\\n if (a === -1) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.sign) {\\r\\n return Integer[0];\\r\\n }\\r\\n if (!n.isSmall) throw new Error(\\\"The exponent \\\" + n.toString() + \\\" is too large.\\\");\\r\\n if (this.isSmall) {\\r\\n if (isPrecise(value = Math.pow(a, b)))\\r\\n return new SmallInteger(truncate(value));\\r\\n }\\r\\n x = this;\\r\\n y = Integer[1];\\r\\n while (true) {\\r\\n if (b & 1 === 1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === 0) break;\\r\\n b /= 2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n };\\r\\n SmallInteger.prototype.pow = BigInteger.prototype.pow;\\r\\n\\r\\n NativeBigInt.prototype.pow = function (v) {\\r\\n var n = parseValue(v);\\r\\n var a = this.value, b = n.value;\\r\\n var _0 = BigInt(0), _1 = BigInt(1), _2 = BigInt(2);\\r\\n if (b === _0) return Integer[1];\\r\\n if (a === _0) return Integer[0];\\r\\n if (a === _1) return Integer[1];\\r\\n if (a === BigInt(-1)) return n.isEven() ? Integer[1] : Integer[-1];\\r\\n if (n.isNegative()) return new NativeBigInt(_0);\\r\\n var x = this;\\r\\n var y = Integer[1];\\r\\n while (true) {\\r\\n if ((b & _1) === _1) {\\r\\n y = y.times(x);\\r\\n --b;\\r\\n }\\r\\n if (b === _0) break;\\r\\n b /= _2;\\r\\n x = x.square();\\r\\n }\\r\\n return y;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.modPow = function (exp, mod) {\\r\\n exp = parseValue(exp);\\r\\n mod = parseValue(mod);\\r\\n if (mod.isZero()) throw new Error(\\\"Cannot take modPow with modulus 0\\\");\\r\\n var r = Integer[1],\\r\\n base = this.mod(mod);\\r\\n if (exp.isNegative()) {\\r\\n exp = exp.multiply(Integer[-1]);\\r\\n base = base.modInv(mod);\\r\\n }\\r\\n while (exp.isPositive()) {\\r\\n if (base.isZero()) return Integer[0];\\r\\n if (exp.isOdd()) r = r.multiply(base).mod(mod);\\r\\n exp = exp.divide(2);\\r\\n base = base.square().mod(mod);\\r\\n }\\r\\n return r;\\r\\n };\\r\\n NativeBigInt.prototype.modPow = SmallInteger.prototype.modPow = BigInteger.prototype.modPow;\\r\\n\\r\\n function compareAbs(a, b) {\\r\\n if (a.length !== b.length) {\\r\\n return a.length > b.length ? 1 : -1;\\r\\n }\\r\\n for (var i = a.length - 1; i >= 0; i--) {\\r\\n if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1;\\r\\n }\\r\\n return 0;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) return 1;\\r\\n return compareAbs(a, b);\\r\\n };\\r\\n SmallInteger.prototype.compareAbs = function (v) {\\r\\n var n = parseValue(v),\\r\\n a = Math.abs(this.value),\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n b = Math.abs(b);\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n return -1;\\r\\n };\\r\\n NativeBigInt.prototype.compareAbs = function (v) {\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n a = a >= 0 ? a : -a;\\r\\n b = b >= 0 ? b : -b;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.compare = function (v) {\\r\\n // See discussion about comparison with Infinity:\\r\\n // https://github.com/peterolson/BigInteger.js/issues/61\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (this.sign !== n.sign) {\\r\\n return n.sign ? 1 : -1;\\r\\n }\\r\\n if (n.isSmall) {\\r\\n return this.sign ? -1 : 1;\\r\\n }\\r\\n return compareAbs(a, b) * (this.sign ? -1 : 1);\\r\\n };\\r\\n BigInteger.prototype.compareTo = BigInteger.prototype.compare;\\r\\n\\r\\n SmallInteger.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n\\r\\n var n = parseValue(v),\\r\\n a = this.value,\\r\\n b = n.value;\\r\\n if (n.isSmall) {\\r\\n return a == b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n if (a < 0 !== n.sign) {\\r\\n return a < 0 ? -1 : 1;\\r\\n }\\r\\n return a < 0 ? 1 : -1;\\r\\n };\\r\\n SmallInteger.prototype.compareTo = SmallInteger.prototype.compare;\\r\\n\\r\\n NativeBigInt.prototype.compare = function (v) {\\r\\n if (v === Infinity) {\\r\\n return -1;\\r\\n }\\r\\n if (v === -Infinity) {\\r\\n return 1;\\r\\n }\\r\\n var a = this.value;\\r\\n var b = parseValue(v).value;\\r\\n return a === b ? 0 : a > b ? 1 : -1;\\r\\n }\\r\\n NativeBigInt.prototype.compareTo = NativeBigInt.prototype.compare;\\r\\n\\r\\n BigInteger.prototype.equals = function (v) {\\r\\n return this.compare(v) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.eq = NativeBigInt.prototype.equals = SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals;\\r\\n\\r\\n BigInteger.prototype.notEquals = function (v) {\\r\\n return this.compare(v) !== 0;\\r\\n };\\r\\n NativeBigInt.prototype.neq = NativeBigInt.prototype.notEquals = SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals;\\r\\n\\r\\n BigInteger.prototype.greater = function (v) {\\r\\n return this.compare(v) > 0;\\r\\n };\\r\\n NativeBigInt.prototype.gt = NativeBigInt.prototype.greater = SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater;\\r\\n\\r\\n BigInteger.prototype.lesser = function (v) {\\r\\n return this.compare(v) < 0;\\r\\n };\\r\\n NativeBigInt.prototype.lt = NativeBigInt.prototype.lesser = SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser;\\r\\n\\r\\n BigInteger.prototype.greaterOrEquals = function (v) {\\r\\n return this.compare(v) >= 0;\\r\\n };\\r\\n NativeBigInt.prototype.geq = NativeBigInt.prototype.greaterOrEquals = SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals;\\r\\n\\r\\n BigInteger.prototype.lesserOrEquals = function (v) {\\r\\n return this.compare(v) <= 0;\\r\\n };\\r\\n NativeBigInt.prototype.leq = NativeBigInt.prototype.lesserOrEquals = SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals;\\r\\n\\r\\n BigInteger.prototype.isEven = function () {\\r\\n return (this.value[0] & 1) === 0;\\r\\n };\\r\\n SmallInteger.prototype.isEven = function () {\\r\\n return (this.value & 1) === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isEven = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isOdd = function () {\\r\\n return (this.value[0] & 1) === 1;\\r\\n };\\r\\n SmallInteger.prototype.isOdd = function () {\\r\\n return (this.value & 1) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isOdd = function () {\\r\\n return (this.value & BigInt(1)) === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isPositive = function () {\\r\\n return !this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isPositive = function () {\\r\\n return this.value > 0;\\r\\n };\\r\\n NativeBigInt.prototype.isPositive = SmallInteger.prototype.isPositive;\\r\\n\\r\\n BigInteger.prototype.isNegative = function () {\\r\\n return this.sign;\\r\\n };\\r\\n SmallInteger.prototype.isNegative = function () {\\r\\n return this.value < 0;\\r\\n };\\r\\n NativeBigInt.prototype.isNegative = SmallInteger.prototype.isNegative;\\r\\n\\r\\n BigInteger.prototype.isUnit = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isUnit = function () {\\r\\n return Math.abs(this.value) === 1;\\r\\n };\\r\\n NativeBigInt.prototype.isUnit = function () {\\r\\n return this.abs().value === BigInt(1);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isZero = function () {\\r\\n return false;\\r\\n };\\r\\n SmallInteger.prototype.isZero = function () {\\r\\n return this.value === 0;\\r\\n };\\r\\n NativeBigInt.prototype.isZero = function () {\\r\\n return this.value === BigInt(0);\\r\\n }\\r\\n\\r\\n BigInteger.prototype.isDivisibleBy = function (v) {\\r\\n var n = parseValue(v);\\r\\n if (n.isZero()) return false;\\r\\n if (n.isUnit()) return true;\\r\\n if (n.compareAbs(2) === 0) return this.isEven();\\r\\n return this.mod(n).isZero();\\r\\n };\\r\\n NativeBigInt.prototype.isDivisibleBy = SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy;\\r\\n\\r\\n function isBasicPrime(v) {\\r\\n var n = v.abs();\\r\\n if (n.isUnit()) return false;\\r\\n if (n.equals(2) || n.equals(3) || n.equals(5)) return true;\\r\\n if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;\\r\\n if (n.lesser(49)) return true;\\r\\n // we don't know if it's prime: let the other functions figure it out\\r\\n }\\r\\n\\r\\n function millerRabinTest(n, a) {\\r\\n var nPrev = n.prev(),\\r\\n b = nPrev,\\r\\n r = 0,\\r\\n d, t, i, x;\\r\\n while (b.isEven()) b = b.divide(2), r++;\\r\\n next: for (i = 0; i < a.length; i++) {\\r\\n if (n.lesser(a[i])) continue;\\r\\n x = bigInt(a[i]).modPow(b, n);\\r\\n if (x.isUnit() || x.equals(nPrev)) continue;\\r\\n for (d = r - 1; d != 0; d--) {\\r\\n x = x.square().mod(n);\\r\\n if (x.isUnit()) return false;\\r\\n if (x.equals(nPrev)) continue next;\\r\\n }\\r\\n return false;\\r\\n }\\r\\n return true;\\r\\n }\\r\\n\\r\\n // Set \\\"strict\\\" to true to force GRH-supported lower bound of 2*log(N)^2\\r\\n BigInteger.prototype.isPrime = function (strict) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var bits = n.bitLength();\\r\\n if (bits <= 64)\\r\\n return millerRabinTest(n, [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]);\\r\\n var logN = Math.log(2) * bits.toJSNumber();\\r\\n var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt(i + 2));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isPrime = SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;\\r\\n\\r\\n BigInteger.prototype.isProbablePrime = function (iterations, rng) {\\r\\n var isPrime = isBasicPrime(this);\\r\\n if (isPrime !== undefined) return isPrime;\\r\\n var n = this.abs();\\r\\n var t = iterations === undefined ? 5 : iterations;\\r\\n for (var a = [], i = 0; i < t; i++) {\\r\\n a.push(bigInt.randBetween(2, n.minus(2), rng));\\r\\n }\\r\\n return millerRabinTest(n, a);\\r\\n };\\r\\n NativeBigInt.prototype.isProbablePrime = SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;\\r\\n\\r\\n BigInteger.prototype.modInv = function (n) {\\r\\n var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR;\\r\\n while (!newR.isZero()) {\\r\\n q = r.divide(newR);\\r\\n lastT = t;\\r\\n lastR = r;\\r\\n t = newT;\\r\\n r = newR;\\r\\n newT = lastT.subtract(q.multiply(newT));\\r\\n newR = lastR.subtract(q.multiply(newR));\\r\\n }\\r\\n if (!r.isUnit()) throw new Error(this.toString() + \\\" and \\\" + n.toString() + \\\" are not co-prime\\\");\\r\\n if (t.compare(0) === -1) {\\r\\n t = t.add(n);\\r\\n }\\r\\n if (this.isNegative()) {\\r\\n return t.negate();\\r\\n }\\r\\n return t;\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.modInv = SmallInteger.prototype.modInv = BigInteger.prototype.modInv;\\r\\n\\r\\n BigInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n }\\r\\n return new BigInteger(addSmall(value, 1), this.sign);\\r\\n };\\r\\n SmallInteger.prototype.next = function () {\\r\\n var value = this.value;\\r\\n if (value + 1 < MAX_INT) return new SmallInteger(value + 1);\\r\\n return new BigInteger(MAX_INT_ARR, false);\\r\\n };\\r\\n NativeBigInt.prototype.next = function () {\\r\\n return new NativeBigInt(this.value + BigInt(1));\\r\\n }\\r\\n\\r\\n BigInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (this.sign) {\\r\\n return new BigInteger(addSmall(value, 1), true);\\r\\n }\\r\\n return subtractSmall(value, 1, this.sign);\\r\\n };\\r\\n SmallInteger.prototype.prev = function () {\\r\\n var value = this.value;\\r\\n if (value - 1 > -MAX_INT) return new SmallInteger(value - 1);\\r\\n return new BigInteger(MAX_INT_ARR, true);\\r\\n };\\r\\n NativeBigInt.prototype.prev = function () {\\r\\n return new NativeBigInt(this.value - BigInt(1));\\r\\n }\\r\\n\\r\\n var powersOfTwo = [1];\\r\\n while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]);\\r\\n var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1];\\r\\n\\r\\n function shift_isSmall(n) {\\r\\n return Math.abs(n) <= BASE;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.shiftLeft = function (v) {\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftRight(-n);\\r\\n var result = this;\\r\\n if (result.isZero()) return result;\\r\\n while (n >= powers2Length) {\\r\\n result = result.multiply(highestPower2);\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n return result.multiply(powersOfTwo[n]);\\r\\n };\\r\\n NativeBigInt.prototype.shiftLeft = SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft;\\r\\n\\r\\n BigInteger.prototype.shiftRight = function (v) {\\r\\n var remQuo;\\r\\n var n = parseValue(v).toJSNumber();\\r\\n if (!shift_isSmall(n)) {\\r\\n throw new Error(String(n) + \\\" is too large for shifting.\\\");\\r\\n }\\r\\n if (n < 0) return this.shiftLeft(-n);\\r\\n var result = this;\\r\\n while (n >= powers2Length) {\\r\\n if (result.isZero() || (result.isNegative() && result.isUnit())) return result;\\r\\n remQuo = divModAny(result, highestPower2);\\r\\n result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n n -= powers2Length - 1;\\r\\n }\\r\\n remQuo = divModAny(result, powersOfTwo[n]);\\r\\n return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0];\\r\\n };\\r\\n NativeBigInt.prototype.shiftRight = SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight;\\r\\n\\r\\n function bitwise(x, y, fn) {\\r\\n y = parseValue(y);\\r\\n var xSign = x.isNegative(), ySign = y.isNegative();\\r\\n var xRem = xSign ? x.not() : x,\\r\\n yRem = ySign ? y.not() : y;\\r\\n var xDigit = 0, yDigit = 0;\\r\\n var xDivMod = null, yDivMod = null;\\r\\n var result = [];\\r\\n while (!xRem.isZero() || !yRem.isZero()) {\\r\\n xDivMod = divModAny(xRem, highestPower2);\\r\\n xDigit = xDivMod[1].toJSNumber();\\r\\n if (xSign) {\\r\\n xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n yDivMod = divModAny(yRem, highestPower2);\\r\\n yDigit = yDivMod[1].toJSNumber();\\r\\n if (ySign) {\\r\\n yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers\\r\\n }\\r\\n\\r\\n xRem = xDivMod[0];\\r\\n yRem = yDivMod[0];\\r\\n result.push(fn(xDigit, yDigit));\\r\\n }\\r\\n var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0);\\r\\n for (var i = result.length - 1; i >= 0; i -= 1) {\\r\\n sum = sum.multiply(highestPower2).add(bigInt(result[i]));\\r\\n }\\r\\n return sum;\\r\\n }\\r\\n\\r\\n BigInteger.prototype.not = function () {\\r\\n return this.negate().prev();\\r\\n };\\r\\n NativeBigInt.prototype.not = SmallInteger.prototype.not = BigInteger.prototype.not;\\r\\n\\r\\n BigInteger.prototype.and = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a & b; });\\r\\n };\\r\\n NativeBigInt.prototype.and = SmallInteger.prototype.and = BigInteger.prototype.and;\\r\\n\\r\\n BigInteger.prototype.or = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a | b; });\\r\\n };\\r\\n NativeBigInt.prototype.or = SmallInteger.prototype.or = BigInteger.prototype.or;\\r\\n\\r\\n BigInteger.prototype.xor = function (n) {\\r\\n return bitwise(this, n, function (a, b) { return a ^ b; });\\r\\n };\\r\\n NativeBigInt.prototype.xor = SmallInteger.prototype.xor = BigInteger.prototype.xor;\\r\\n\\r\\n var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I;\\r\\n function roughLOB(n) { // get lowestOneBit (rough)\\r\\n // SmallInteger: return Min(lowestOneBit(n), 1 << 30)\\r\\n // BigInteger: return Min(lowestOneBit(n), 1 << 14) [BASE=1e7]\\r\\n var v = n.value,\\r\\n x = typeof v === \\\"number\\\" ? v | LOBMASK_I :\\r\\n typeof v === \\\"bigint\\\" ? v | BigInt(LOBMASK_I) :\\r\\n v[0] + v[1] * BASE | LOBMASK_BI;\\r\\n return x & -x;\\r\\n }\\r\\n\\r\\n function integerLogarithm(value, base) {\\r\\n if (base.compareTo(value) <= 0) {\\r\\n var tmp = integerLogarithm(value, base.square(base));\\r\\n var p = tmp.p;\\r\\n var e = tmp.e;\\r\\n var t = p.multiply(base);\\r\\n return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 };\\r\\n }\\r\\n return { p: bigInt(1), e: 0 };\\r\\n }\\r\\n\\r\\n BigInteger.prototype.bitLength = function () {\\r\\n var n = this;\\r\\n if (n.compareTo(bigInt(0)) < 0) {\\r\\n n = n.negate().subtract(bigInt(1));\\r\\n }\\r\\n if (n.compareTo(bigInt(0)) === 0) {\\r\\n return bigInt(0);\\r\\n }\\r\\n return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1));\\r\\n }\\r\\n NativeBigInt.prototype.bitLength = SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength;\\r\\n\\r\\n function max(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.greater(b) ? a : b;\\r\\n }\\r\\n function min(a, b) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n return a.lesser(b) ? a : b;\\r\\n }\\r\\n function gcd(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n if (a.equals(b)) return a;\\r\\n if (a.isZero()) return b;\\r\\n if (b.isZero()) return a;\\r\\n var c = Integer[1], d, t;\\r\\n while (a.isEven() && b.isEven()) {\\r\\n d = min(roughLOB(a), roughLOB(b));\\r\\n a = a.divide(d);\\r\\n b = b.divide(d);\\r\\n c = c.multiply(d);\\r\\n }\\r\\n while (a.isEven()) {\\r\\n a = a.divide(roughLOB(a));\\r\\n }\\r\\n do {\\r\\n while (b.isEven()) {\\r\\n b = b.divide(roughLOB(b));\\r\\n }\\r\\n if (a.greater(b)) {\\r\\n t = b; b = a; a = t;\\r\\n }\\r\\n b = b.subtract(a);\\r\\n } while (!b.isZero());\\r\\n return c.isUnit() ? a : a.multiply(c);\\r\\n }\\r\\n function lcm(a, b) {\\r\\n a = parseValue(a).abs();\\r\\n b = parseValue(b).abs();\\r\\n return a.divide(gcd(a, b)).multiply(b);\\r\\n }\\r\\n function randBetween(a, b, rng) {\\r\\n a = parseValue(a);\\r\\n b = parseValue(b);\\r\\n var usedRNG = rng || Math.random;\\r\\n var low = min(a, b), high = max(a, b);\\r\\n var range = high.subtract(low).add(1);\\r\\n if (range.isSmall) return low.add(Math.floor(usedRNG() * range));\\r\\n var digits = toBase(range, BASE).value;\\r\\n var result = [], restricted = true;\\r\\n for (var i = 0; i < digits.length; i++) {\\r\\n var top = restricted ? digits[i] : BASE;\\r\\n var digit = truncate(usedRNG() * top);\\r\\n result.push(digit);\\r\\n if (digit < top) restricted = false;\\r\\n }\\r\\n return low.add(Integer.fromArray(result, BASE, false));\\r\\n }\\r\\n\\r\\n var parseBase = function (text, base, alphabet, caseSensitive) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n text = String(text);\\r\\n if (!caseSensitive) {\\r\\n text = text.toLowerCase();\\r\\n alphabet = alphabet.toLowerCase();\\r\\n }\\r\\n var length = text.length;\\r\\n var i;\\r\\n var absBase = Math.abs(base);\\r\\n var alphabetValues = {};\\r\\n for (i = 0; i < alphabet.length; i++) {\\r\\n alphabetValues[alphabet[i]] = i;\\r\\n }\\r\\n for (i = 0; i < length; i++) {\\r\\n var c = text[i];\\r\\n if (c === \\\"-\\\") continue;\\r\\n if (c in alphabetValues) {\\r\\n if (alphabetValues[c] >= absBase) {\\r\\n if (c === \\\"1\\\" && absBase === 1) continue;\\r\\n throw new Error(c + \\\" is not a valid digit in base \\\" + base + \\\".\\\");\\r\\n }\\r\\n }\\r\\n }\\r\\n base = parseValue(base);\\r\\n var digits = [];\\r\\n var isNegative = text[0] === \\\"-\\\";\\r\\n for (i = isNegative ? 1 : 0; i < text.length; i++) {\\r\\n var c = text[i];\\r\\n if (c in alphabetValues) digits.push(parseValue(alphabetValues[c]));\\r\\n else if (c === \\\"<\\\") {\\r\\n var start = i;\\r\\n do { i++; } while (text[i] !== \\\">\\\" && i < text.length);\\r\\n digits.push(parseValue(text.slice(start + 1, i)));\\r\\n }\\r\\n else throw new Error(c + \\\" is not a valid character\\\");\\r\\n }\\r\\n return parseBaseFromArray(digits, base, isNegative);\\r\\n };\\r\\n\\r\\n function parseBaseFromArray(digits, base, isNegative) {\\r\\n var val = Integer[0], pow = Integer[1], i;\\r\\n for (i = digits.length - 1; i >= 0; i--) {\\r\\n val = val.add(digits[i].times(pow));\\r\\n pow = pow.times(base);\\r\\n }\\r\\n return isNegative ? val.negate() : val;\\r\\n }\\r\\n\\r\\n function stringify(digit, alphabet) {\\r\\n alphabet = alphabet || DEFAULT_ALPHABET;\\r\\n if (digit < alphabet.length) {\\r\\n return alphabet[digit];\\r\\n }\\r\\n return \\\"<\\\" + digit + \\\">\\\";\\r\\n }\\r\\n\\r\\n function toBase(n, base) {\\r\\n base = bigInt(base);\\r\\n if (base.isZero()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n throw new Error(\\\"Cannot convert nonzero numbers to base 0.\\\");\\r\\n }\\r\\n if (base.equals(-1)) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n if (n.isNegative())\\r\\n return {\\r\\n value: [].concat.apply([], Array.apply(null, Array(-n.toJSNumber()))\\r\\n .map(Array.prototype.valueOf, [1, 0])\\r\\n ),\\r\\n isNegative: false\\r\\n };\\r\\n\\r\\n var arr = Array.apply(null, Array(n.toJSNumber() - 1))\\r\\n .map(Array.prototype.valueOf, [0, 1]);\\r\\n arr.unshift([1]);\\r\\n return {\\r\\n value: [].concat.apply([], arr),\\r\\n isNegative: false\\r\\n };\\r\\n }\\r\\n\\r\\n var neg = false;\\r\\n if (n.isNegative() && base.isPositive()) {\\r\\n neg = true;\\r\\n n = n.abs();\\r\\n }\\r\\n if (base.isUnit()) {\\r\\n if (n.isZero()) return { value: [0], isNegative: false };\\r\\n\\r\\n return {\\r\\n value: Array.apply(null, Array(n.toJSNumber()))\\r\\n .map(Number.prototype.valueOf, 1),\\r\\n isNegative: neg\\r\\n };\\r\\n }\\r\\n var out = [];\\r\\n var left = n, divmod;\\r\\n while (left.isNegative() || left.compareAbs(base) >= 0) {\\r\\n divmod = left.divmod(base);\\r\\n left = divmod.quotient;\\r\\n var digit = divmod.remainder;\\r\\n if (digit.isNegative()) {\\r\\n digit = base.minus(digit).abs();\\r\\n left = left.next();\\r\\n }\\r\\n out.push(digit.toJSNumber());\\r\\n }\\r\\n out.push(left.toJSNumber());\\r\\n return { value: out.reverse(), isNegative: neg };\\r\\n }\\r\\n\\r\\n function toBaseString(n, base, alphabet) {\\r\\n var arr = toBase(n, base);\\r\\n return (arr.isNegative ? \\\"-\\\" : \\\"\\\") + arr.value.map(function (x) {\\r\\n return stringify(x, alphabet);\\r\\n }).join('');\\r\\n }\\r\\n\\r\\n BigInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toArray = function (radix) {\\r\\n return toBase(this, radix);\\r\\n };\\r\\n\\r\\n BigInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix !== 10) return toBaseString(this, radix, alphabet);\\r\\n var v = this.value, l = v.length, str = String(v[--l]), zeros = \\\"0000000\\\", digit;\\r\\n while (--l >= 0) {\\r\\n digit = String(v[l]);\\r\\n str += zeros.slice(digit.length) + digit;\\r\\n }\\r\\n var sign = this.sign ? \\\"-\\\" : \\\"\\\";\\r\\n return sign + str;\\r\\n };\\r\\n\\r\\n SmallInteger.prototype.toString = function (radix, alphabet) {\\r\\n if (radix === undefined) radix = 10;\\r\\n if (radix != 10) return toBaseString(this, radix, alphabet);\\r\\n return String(this.value);\\r\\n };\\r\\n\\r\\n NativeBigInt.prototype.toString = SmallInteger.prototype.toString;\\r\\n\\r\\n NativeBigInt.prototype.toJSON = BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString(); }\\r\\n\\r\\n BigInteger.prototype.valueOf = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n };\\r\\n BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf;\\r\\n\\r\\n SmallInteger.prototype.valueOf = function () {\\r\\n return this.value;\\r\\n };\\r\\n SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf;\\r\\n NativeBigInt.prototype.valueOf = NativeBigInt.prototype.toJSNumber = function () {\\r\\n return parseInt(this.toString(), 10);\\r\\n }\\r\\n\\r\\n function parseStringValue(v) {\\r\\n if (isPrecise(+v)) {\\r\\n var x = +v;\\r\\n if (x === truncate(x))\\r\\n return supportsNativeBigInt ? new NativeBigInt(BigInt(x)) : new SmallInteger(x);\\r\\n throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n }\\r\\n var sign = v[0] === \\\"-\\\";\\r\\n if (sign) v = v.slice(1);\\r\\n var split = v.split(/e/i);\\r\\n if (split.length > 2) throw new Error(\\\"Invalid integer: \\\" + split.join(\\\"e\\\"));\\r\\n if (split.length === 2) {\\r\\n var exp = split[1];\\r\\n if (exp[0] === \\\"+\\\") exp = exp.slice(1);\\r\\n exp = +exp;\\r\\n if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error(\\\"Invalid integer: \\\" + exp + \\\" is not a valid exponent.\\\");\\r\\n var text = split[0];\\r\\n var decimalPlace = text.indexOf(\\\".\\\");\\r\\n if (decimalPlace >= 0) {\\r\\n exp -= text.length - decimalPlace - 1;\\r\\n text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1);\\r\\n }\\r\\n if (exp < 0) throw new Error(\\\"Cannot include negative exponent part for integers\\\");\\r\\n text += (new Array(exp + 1)).join(\\\"0\\\");\\r\\n v = text;\\r\\n }\\r\\n var isValid = /^([0-9][0-9]*)$/.test(v);\\r\\n if (!isValid) throw new Error(\\\"Invalid integer: \\\" + v);\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(sign ? \\\"-\\\" + v : v));\\r\\n }\\r\\n var r = [], max = v.length, l = LOG_BASE, min = max - l;\\r\\n while (max > 0) {\\r\\n r.push(+v.slice(min, max));\\r\\n min -= l;\\r\\n if (min < 0) min = 0;\\r\\n max -= l;\\r\\n }\\r\\n trim(r);\\r\\n return new BigInteger(r, sign);\\r\\n }\\r\\n\\r\\n function parseNumberValue(v) {\\r\\n if (supportsNativeBigInt) {\\r\\n return new NativeBigInt(BigInt(v));\\r\\n }\\r\\n if (isPrecise(v)) {\\r\\n if (v !== truncate(v)) throw new Error(v + \\\" is not an integer.\\\");\\r\\n return new SmallInteger(v);\\r\\n }\\r\\n return parseStringValue(v.toString());\\r\\n }\\r\\n\\r\\n function parseValue(v) {\\r\\n if (typeof v === \\\"number\\\") {\\r\\n return parseNumberValue(v);\\r\\n }\\r\\n if (typeof v === \\\"string\\\") {\\r\\n return parseStringValue(v);\\r\\n }\\r\\n if (typeof v === \\\"bigint\\\") {\\r\\n return new NativeBigInt(v);\\r\\n }\\r\\n return v;\\r\\n }\\r\\n // Pre-define numbers in range [-999,999]\\r\\n for (var i = 0; i < 1000; i++) {\\r\\n Integer[i] = parseValue(i);\\r\\n if (i > 0) Integer[-i] = parseValue(-i);\\r\\n }\\r\\n // Backwards compatibility\\r\\n Integer.one = Integer[1];\\r\\n Integer.zero = Integer[0];\\r\\n Integer.minusOne = Integer[-1];\\r\\n Integer.max = max;\\r\\n Integer.min = min;\\r\\n Integer.gcd = gcd;\\r\\n Integer.lcm = lcm;\\r\\n Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger || x instanceof NativeBigInt; };\\r\\n Integer.randBetween = randBetween;\\r\\n\\r\\n Integer.fromArray = function (digits, base, isNegative) {\\r\\n return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative);\\r\\n };\\r\\n\\r\\n return Integer;\\r\\n})();\\r\\n\\r\\n// Node.js check\\r\\nif ( true && module.hasOwnProperty(\\\"exports\\\")) {\\r\\n module.exports = bigInt;\\r\\n}\\r\\n\\r\\n//amd check\\r\\nif (true) {\\r\\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {\\r\\n return bigInt;\\r\\n }).call(exports, __webpack_require__, exports, module),\\n\\t\\t\\t\\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\\r\\n}\\r\\n\\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \\\"./node_modules/webpack/buildin/module.js\\\")(module)))\\n\\n//# sourceURL=webpack:///./node_modules/big-integer/BigInteger.js?\");\n\n/***/ }),\n\n/***/ \"./node_modules/webpack/buildin/module.js\":\n/*!***********************************!*\\\n !*** (webpack)/buildin/module.js ***!\n \\***********************************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = function(module) {\\n\\tif (!module.webpackPolyfill) {\\n\\t\\tmodule.deprecate = function() {};\\n\\t\\tmodule.paths = [];\\n\\t\\t// module.parent = undefined by default\\n\\t\\tif (!module.children) module.children = [];\\n\\t\\tObject.defineProperty(module, \\\"loaded\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.l;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tObject.defineProperty(module, \\\"id\\\", {\\n\\t\\t\\tenumerable: true,\\n\\t\\t\\tget: function() {\\n\\t\\t\\t\\treturn module.i;\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\tmodule.webpackPolyfill = 1;\\n\\t}\\n\\treturn module;\\n};\\n\\n\\n//# sourceURL=webpack:///(webpack)/buildin/module.js?\");\n\n/***/ }),\n\n/***/ \"./src/ABC157/B.js\":\n/*!*************************!*\\\n !*** ./src/ABC157/B.js ***!\n \\*************************/\n/*! no static exports found */\n/***/ (function(module, exports, __webpack_require__) {\n\neval(\"var fs = __webpack_require__(/*! fs */ \\\"fs\\\");\\n\\nvar bigInt = __webpack_require__(/*! big-integer */ \\\"./node_modules/big-integer/BigInteger.js\\\");\\n\\nvar main = function main(input) {\\n var SIZE = 3;\\n var lines = input.split('\\\\n');\\n var A = [];\\n\\n for (var i = 0; i < SIZE; i++) {\\n A.push(lines.shift().split(' ').map(function (n) {\\n return n - 0;\\n }));\\n }\\n\\n var N = lines.shift();\\n\\n for (var _i = 0; _i < N; _i++) {\\n var number = lines.shift() - 0;\\n\\n for (var y = 0; y < SIZE; y++) {\\n for (var x = 0; x < SIZE; x++) {\\n if (A[y][x] === number) A[y][x] = null;\\n }\\n }\\n }\\n\\n var isBingo = false;\\n\\n var _loop = function _loop(_y) {\\n if (A[_y].every(function (n) {\\n return n === null;\\n })) {\\n isBingo = true;\\n }\\n\\n if (A.every(function (col) {\\n return col[_y] === null;\\n })) {\\n isBingo = true;\\n }\\n };\\n\\n for (var _y = 0; _y < SIZE; _y++) {\\n _loop(_y);\\n }\\n\\n if (A[0][0] === null && A[1][1] === null && A[2][2] === null) {\\n isBingo = true;\\n }\\n\\n if (A[2][0] === null && A[1][1] === null && A[0][2] === null) {\\n isBingo = true;\\n }\\n\\n if (isBingo) {\\n console.log('Yes');\\n } else {\\n console.log('No');\\n }\\n};\\n\\nmain(fs.readFileSync('/dev/stdin', 'utf8'));\\n\\n//# sourceURL=webpack:///./src/ABC157/B.js?\");\n\n/***/ }),\n\n/***/ \"fs\":\n/*!*********************!*\\\n !*** external \"fs\" ***!\n \\*********************/\n/*! no static exports found */\n/***/ (function(module, exports) {\n\neval(\"module.exports = require(\\\"fs\\\");\\n\\n//# sourceURL=webpack:///external_%22fs%22?\");\n\n/***/ })\n\n/******/ });", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "sample_input": "84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02760", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 61995, "cpu_time_ms": 61, "memory_kb": 10060}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s194182900", "group_id": "codeNet:p02760", "input_text": "'use strict'\nconst Main=input=>{\n input=input.split(\"\\n\");\n \n let hole=[[false,false,false],[false,false,false],[false,false,false]];\n const sheet=[];\n sheet.push(input[0].split(\" \"));\n sheet.push(input[1].split(\" \"));\n sheet.push(input[2].split(\" \"));\n \n for(let i=0;i{\n input=input.split(\"\\n\");\n \n let hole=[[false,false,false],[false,false,false],[false,false,false]];\n const sheet=[];\n sheet.push(input[0].split(\" \"));\n sheet.push(input[1].split(\" \"));\n sheet.push(input[2].split(\" \"));\n \n for(let i=0;i {\n arg = arg.trim().split(\"\\n\");\n const A1 = arg[0].split(\" \").map(n=>parseInt(n));\n const A2 = arg[1].split(\" \").map(n=>parseInt(n));\n const A3 = arg[2].split(\" \").map(n=>parseInt(n));\n const N = arg[3];\n const B = arg.slice(4, N + 3).map(n=>parseInt(n));\n \n let as = [A1, A2, A3];\n \n for(let i in B) {\n for(let j in as) {\n let del = as[j].indexOf(B[i]);\n \n if(del !== -1) {\n as[j][del] = \"x\";\n } \n }\n \n const vert1 = [A1[0], A2[0], A3[0]]; \n const vert2 = [A1[1], A2[1], A3[1]]; \n const vert3 = [A1[2], A2[2], A3[2]]; \n \n const cross1 = [A1[0], A2[1], A3[2]];\n const cross2 = [A3[0], A2[1], A1[2]];\n \n let temp = [A1, A2, A3, vert1, vert2, vert3, cross1, cross2];\n \n for(let j in temp) {\n if(temp[j].filter(n=>n === \"x\").length === temp[j].length) {\n console.log(\"Yes\");\n return;\n }\n }\n }\n \n console.log(\"No\");\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1583115358, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02760.html", "problem_id": "p02760", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02760/input.txt", "sample_output_relpath": "derived/input_output/data/p02760/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02760/JavaScript/s683345426.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s683345426", "user_id": "u598795006"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const A1 = arg[0].split(\" \").map(n=>parseInt(n));\n const A2 = arg[1].split(\" \").map(n=>parseInt(n));\n const A3 = arg[2].split(\" \").map(n=>parseInt(n));\n const N = arg[3];\n const B = arg.slice(4, N + 3).map(n=>parseInt(n));\n \n let as = [A1, A2, A3];\n \n for(let i in B) {\n for(let j in as) {\n let del = as[j].indexOf(B[i]);\n \n if(del !== -1) {\n as[j][del] = \"x\";\n } \n }\n \n const vert1 = [A1[0], A2[0], A3[0]]; \n const vert2 = [A1[1], A2[1], A3[1]]; \n const vert3 = [A1[2], A2[2], A3[2]]; \n \n const cross1 = [A1[0], A2[1], A3[2]];\n const cross2 = [A3[0], A2[1], A1[2]];\n \n let temp = [A1, A2, A3, vert1, vert2, vert3, cross1, cross2];\n \n for(let j in temp) {\n if(temp[j].filter(n=>n === \"x\").length === temp[j].length) {\n console.log(\"Yes\");\n return;\n }\n }\n }\n \n console.log(\"No\");\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "sample_input": "84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02760", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a bingo card with a 3\\times3 grid. The square at the i-th row from the top and the j-th column from the left contains the number A_{i, j}.\n\nThe MC will choose N numbers, b_1, b_2, \\cdots, b_N. If our bingo sheet contains some of those numbers, we will mark them on our sheet.\n\nDetermine whether we will have a bingo when the N numbers are chosen, that is, the sheet will contain three marked numbers in a row, column, or diagonal.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A_{i, j} \\leq 100\n\nA_{i_1, j_1} \\neq A_{i_2, j_2} ((i_1, j_1) \\neq (i_2, j_2))\n\n1 \\leq N \\leq 10\n\n1 \\leq b_i \\leq 100\n\nb_i \\neq b_j (i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_{1, 1} A_{1, 2} A_{1, 3}\nA_{2, 1} A_{2, 2} A_{2, 3}\nA_{3, 1} A_{3, 2} A_{3, 3}\nN\nb_1\n\\vdots\nb_N\n\nOutput\n\nIf we will have a bingo, print Yes; otherwise, print No.\n\nSample Input 1\n\n84 97 66\n79 89 11\n61 59 7\n7\n89\n7\n87\n79\n24\n84\n30\n\nSample Output 1\n\nYes\n\nWe will mark A_{1, 1}, A_{2, 1}, A_{2, 2}, A_{3, 3}, and complete the diagonal from the top-left to the bottom-right.\n\nSample Input 2\n\n41 7 46\n26 89 2\n78 92 8\n5\n6\n45\n16\n57\n17\n\nSample Output 2\n\nNo\n\nWe will mark nothing.\n\nSample Input 3\n\n60 88 34\n92 41 43\n65 73 48\n10\n60\n43\n88\n11\n48\n73\n65\n41\n92\n34\n\nSample Output 3\n\nYes\n\nWe will mark all the squares.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1157, "cpu_time_ms": 238, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s731314458", "group_id": "codeNet:p02764", "input_text": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var n = next(), k = next();\n if(k === 1)return 0;\n var c = nextm(n,3);\n var ans = 1e9;\n for(var i = 0; i < n; i++){\n var q = [[0,i]], x = c[i][0], y = c[i][1];\n for(var j = 0; j < n; j++){\n if(i === j)continue;\n q.push([solve(x,y,c[j]),j]);\n }\n q.sort((a,b)=>a[0]-b[0]);\n var cost = q[k-1][0];\n var l = 500;\n while(l > 1e-7){\n var d = solve2(x,y,c[q[k-1][1]]), q2 = [], f = 1;\n var xd = x - d[0]*l, yd = y - d[1]*l;\n for(var j = 0; j < k && f; j++){\n var t = solve(xd,yd,c[q[j][1]]);\n if(cost < t)f = 0;\n else q2.push([t,q[j][1]]);\n }\n if(f){\n q2.sort((a,b)=>a[0]-b[0]);\n cost = q2[k-1][0];\n q = q2;\n x = xd, y = yd;\n }else{\n l /= 2;\n }\n }\n if(cost < ans)ans = cost\n }\n return ans;\n}\n\nfunction solve(x,y,a){\n var x1 = a[0], y1 = a[1], c1 = a[2];\n var dx = x-x1, dy = y-y1;\n return c1 * Math.sqrt(dx*dx + dy*dy);\n}\n\nfunction solve2(x,y,a){\n var x1 = a[0], y1 = a[1];\n var dx = x-x1, dy = y-y1;\n var l = Math.sqrt(dx*dx + dy*dy);\n return [dx/l , dy/l];\n}", "language": "JavaScript", "metadata": {"date": 1583121074, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02764.html", "problem_id": "p02764", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02764/input.txt", "sample_output_relpath": "derived/input_output/data/p02764/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02764/JavaScript/s731314458.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s731314458", "user_id": "u643613120"}, "prompt_components": {"gold_output": "2.4\n", "input_to_evaluate": "\"use strict\";\nvar input=require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\");\nvar cin=input.split(/ |\\n/),cid=0;\nfunction next(a){return a?cin[cid++]:+cin[cid++];}\nfunction nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}\nfunction nextm(h,w,a){var r=[],i=0;if(a)for(;i+a));return r;}\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill().map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill().map(x=>\"+r+\")\";return eval(r);}\n\nvar myOut = main();\nif(myOut !== undefined)console.log(myOut);\n\nfunction main(){\n var n = next(), k = next();\n if(k === 1)return 0;\n var c = nextm(n,3);\n var ans = 1e9;\n for(var i = 0; i < n; i++){\n var q = [[0,i]], x = c[i][0], y = c[i][1];\n for(var j = 0; j < n; j++){\n if(i === j)continue;\n q.push([solve(x,y,c[j]),j]);\n }\n q.sort((a,b)=>a[0]-b[0]);\n var cost = q[k-1][0];\n var l = 500;\n while(l > 1e-7){\n var d = solve2(x,y,c[q[k-1][1]]), q2 = [], f = 1;\n var xd = x - d[0]*l, yd = y - d[1]*l;\n for(var j = 0; j < k && f; j++){\n var t = solve(xd,yd,c[q[j][1]]);\n if(cost < t)f = 0;\n else q2.push([t,q[j][1]]);\n }\n if(f){\n q2.sort((a,b)=>a[0]-b[0]);\n cost = q2[k-1][0];\n q = q2;\n x = xd, y = yd;\n }else{\n l /= 2;\n }\n }\n if(cost < ans)ans = cost\n }\n return ans;\n}\n\nfunction solve(x,y,a){\n var x1 = a[0], y1 = a[1], c1 = a[2];\n var dx = x-x1, dy = y-y1;\n return c1 * Math.sqrt(dx*dx + dy*dy);\n}\n\nfunction solve2(x,y,a){\n var x1 = a[0], y1 = a[1];\n var dx = x-x1, dy = y-y1;\n var l = Math.sqrt(dx*dx + dy*dy);\n return [dx/l , dy/l];\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi wants to grill N pieces of meat on a grilling net, which can be seen as a two-dimensional plane. The coordinates of the i-th piece of meat are \\left(x_i, y_i\\right), and its hardness is c_i.\n\nTakahashi can use one heat source to grill the meat. If he puts the heat source at coordinates \\left(X, Y\\right), where X and Y are real numbers, the i-th piece of meat will be ready to eat in c_i \\times \\sqrt{\\left(X - x_i\\right)^2 + \\left(Y-y_i\\right)^2} seconds.\n\nTakahashi wants to eat K pieces of meat. Find the time required to have K or more pieces of meat ready if he put the heat source to minimize this time.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 60\n\n1 \\leq K \\leq N\n\n-1000 \\leq x_i , y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) \\left(i \\neq j \\right)\n\n1 \\leq c_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 y_1 c_1\n\\vdots\nx_N y_N c_N\n\nOutput\n\nPrint the answer.\n\nIt will be considered correct if its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n4 3\n-1 0 3\n0 0 3\n1 0 2\n1 1 40\n\nSample Output 1\n\n2.4\n\nIf we put the heat source at \\left(-0.2, 0\\right), the 1-st, 2-nd, and 3-rd pieces of meat will be ready to eat within 2.4 seconds. This is the optimal place to put the heat source.\n\nSample Input 2\n\n10 5\n-879 981 26\n890 -406 81\n512 859 97\n362 -955 25\n128 553 17\n-885 763 2\n449 310 57\n-656 -204 11\n-270 76 40\n184 170 16\n\nSample Output 2\n\n7411.2252", "sample_input": "4 3\n-1 0 3\n0 0 3\n1 0 2\n1 1 40\n"}, "reference_outputs": ["2.4\n"], "source_document_id": "p02764", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi wants to grill N pieces of meat on a grilling net, which can be seen as a two-dimensional plane. The coordinates of the i-th piece of meat are \\left(x_i, y_i\\right), and its hardness is c_i.\n\nTakahashi can use one heat source to grill the meat. If he puts the heat source at coordinates \\left(X, Y\\right), where X and Y are real numbers, the i-th piece of meat will be ready to eat in c_i \\times \\sqrt{\\left(X - x_i\\right)^2 + \\left(Y-y_i\\right)^2} seconds.\n\nTakahashi wants to eat K pieces of meat. Find the time required to have K or more pieces of meat ready if he put the heat source to minimize this time.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 60\n\n1 \\leq K \\leq N\n\n-1000 \\leq x_i , y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) \\left(i \\neq j \\right)\n\n1 \\leq c_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 y_1 c_1\n\\vdots\nx_N y_N c_N\n\nOutput\n\nPrint the answer.\n\nIt will be considered correct if its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n4 3\n-1 0 3\n0 0 3\n1 0 2\n1 1 40\n\nSample Output 1\n\n2.4\n\nIf we put the heat source at \\left(-0.2, 0\\right), the 1-st, 2-nd, and 3-rd pieces of meat will be ready to eat within 2.4 seconds. This is the optimal place to put the heat source.\n\nSample Input 2\n\n10 5\n-879 981 26\n890 -406 81\n512 859 97\n362 -955 25\n128 553 17\n-885 763 2\n449 310 57\n-656 -204 11\n-270 76 40\n184 170 16\n\nSample Output 2\n\n7411.2252", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1742, "cpu_time_ms": 2109, "memory_kb": 16552}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s145831948", "group_id": "codeNet:p02765", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n var [n, r] = input[0].split(' ').map(v=>Number(v));\n if (n >= 10) {\n console.log(r);\n } else {\n console.log(r + 100 * (10 - n));\n }\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// Main(['2 2919']);\n// Main(['22 3051']);\n", "language": "JavaScript", "metadata": {"date": 1582427082, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/JavaScript/s145831948.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s145831948", "user_id": "u714338605"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n var [n, r] = input[0].split(' ').map(v=>Number(v));\n if (n >= 10) {\n console.log(r);\n } else {\n console.log(r + 100 * (10 - n));\n }\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n// Main(['2 2919']);\n// Main(['22 3051']);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 495, "cpu_time_ms": 50, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s952481410", "group_id": "codeNet:p02765", "input_text": "function Main(input) {\n var line = input.split(' ');\n var N = Number(line[0]);\n var K = Number(line[1]);\n var log2 = Math.ceil(Math.log2(N + 1));\n // console.log('log2=' + log2);\n var log10 = Math.ceil(Math.log10(N + 1));\n // console.log('log10=' + log10);\n if (K == 2) {\n console.log(log2);\n } else if (K == 10) {\n console.log(log10);\n } else {\n for (var i = log10; i <= log2; i ++) {\n var n = Math.pow(K, i);\n // console.log('n(' + i + ')=' + n);\n if (N < n) {\n console.log(i);\n break;\n }\n }\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1582425514, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/JavaScript/s952481410.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s952481410", "user_id": "u953863592"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "function Main(input) {\n var line = input.split(' ');\n var N = Number(line[0]);\n var K = Number(line[1]);\n var log2 = Math.ceil(Math.log2(N + 1));\n // console.log('log2=' + log2);\n var log10 = Math.ceil(Math.log10(N + 1));\n // console.log('log10=' + log10);\n if (K == 2) {\n console.log(log2);\n } else if (K == 10) {\n console.log(log10);\n } else {\n for (var i = log10; i <= log2; i ++) {\n var n = Math.pow(K, i);\n // console.log('n(' + i + ')=' + n);\n if (N < n) {\n console.log(i);\n break;\n }\n }\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 613, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s916794726", "group_id": "codeNet:p02765", "input_text": "'use strict'\n\nfunction Main(input) {\n input = input.trim().split(' ').map(s => parseInt(s))\n\n const N = input[0]\n const R = input[1]\n\n if (N < 10) {\n console.log(R + 100 * (10 - N))\n } else {\n console.log(R)\n }\n \n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1582424696, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02765.html", "problem_id": "p02765", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02765/input.txt", "sample_output_relpath": "derived/input_output/data/p02765/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02765/JavaScript/s916794726.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s916794726", "user_id": "u177274511"}, "prompt_components": {"gold_output": "3719\n", "input_to_evaluate": "'use strict'\n\nfunction Main(input) {\n input = input.trim().split(' ').map(s => parseInt(s))\n\n const N = input[0]\n const R = input[1]\n\n if (N < 10) {\n console.log(R + 100 * (10 - N))\n } else {\n console.log(R)\n }\n \n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "sample_input": "2 2919\n"}, "reference_outputs": ["3719\n"], "source_document_id": "p02765", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is a member of a programming competition site, ButCoder.\n\nEach member of ButCoder is assigned two values: Inner Rating and Displayed Rating.\n\nThe Displayed Rating of a member is equal to their Inner Rating if the member has participated in 10 or more contests. Otherwise, the Displayed Rating will be their Inner Rating minus 100 \\times (10 - K) when the member has participated in K contests.\n\nTakahashi has participated in N contests, and his Displayed Rating is R. Find his Inner Rating.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n0 \\leq R \\leq 4111\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN R\n\nOutput\n\nPrint his Inner Rating.\n\nSample Input 1\n\n2 2919\n\nSample Output 1\n\n3719\n\nTakahashi has participated in 2 contests, which is less than 10, so his Displayed Rating is his Inner Rating minus 100 \\times (10 - 2) = 800.\n\nThus, Takahashi's Inner Rating is 2919 + 800 = 3719.\n\nSample Input 2\n\n22 3051\n\nSample Output 2\n\n3051", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 284, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s058355002", "group_id": "codeNet:p02767", "input_text": "\"use strict\";\nfunction Main(input) {\n input = input.split(\"\\n\");\n let n = Number(input[0]);\n let place_array = input[1].split(\" \").map(Number);\n let min = 0;\n for (let cp = 0; cp < 100; cp++) {\n let tmp_total = 0;\n for (let i = 0; i < n; i++) {\n tmp_total += Math.pow((cp - place_array[i]), 2);\n //console.log(`${point} - ${place_array[index]}の2乗 = ${(point - place_array[index]) ** 2}`);\n }\n if (cp === 0) min = tmp_total;\n min = min < tmp_total ? min : tmp_total;\n }\n console.log(min);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1582427764, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02767.html", "problem_id": "p02767", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02767/input.txt", "sample_output_relpath": "derived/input_output/data/p02767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02767/JavaScript/s058355002.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s058355002", "user_id": "u994502918"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "\"use strict\";\nfunction Main(input) {\n input = input.split(\"\\n\");\n let n = Number(input[0]);\n let place_array = input[1].split(\" \").map(Number);\n let min = 0;\n for (let cp = 0; cp < 100; cp++) {\n let tmp_total = 0;\n for (let i = 0; i < n; i++) {\n tmp_total += Math.pow((cp - place_array[i]), 2);\n //console.log(`${point} - ${place_array[index]}の2乗 = ${(point - place_array[index]) ** 2}`);\n }\n if (cp === 0) min = tmp_total;\n min = min < tmp_total ? min : tmp_total;\n }\n console.log(min);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "sample_input": "2\n1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 581, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s945252662", "group_id": "codeNet:p02767", "input_text": "'use strict'\n\nfunction Main(input) {\n input = input.trim().split('\\n')\n const N = parseInt(input[0])\n let X = input[1].split(' ').map(s => parseInt(s))\n\n X = X.sort()\n\n const MAX = 100\n\n const memo = {}\n for(let i = 0; i <= MAX; ++i) {\n memo[i] = false\n for(let j = 0; j < N; ++j) {\n if (i === X[j]) memo[i] = true\n }\n }\n\n let result = Infinity\n\n for(let i = 1; i <= MAX; ++i) {\n if(!memo[i]) {\n let total = 0\n for(let j = 0; j < N; ++j) {\n const n = X[j] - i\n total += n * n\n }\n\n result = Math.min(result, total)\n\n }\n }\n\n if( result === Infinity ) result = 0\n console.log(result)\n\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1582427345, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02767.html", "problem_id": "p02767", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02767/input.txt", "sample_output_relpath": "derived/input_output/data/p02767/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02767/JavaScript/s945252662.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s945252662", "user_id": "u177274511"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "'use strict'\n\nfunction Main(input) {\n input = input.trim().split('\\n')\n const N = parseInt(input[0])\n let X = input[1].split(' ').map(s => parseInt(s))\n\n X = X.sort()\n\n const MAX = 100\n\n const memo = {}\n for(let i = 0; i <= MAX; ++i) {\n memo[i] = false\n for(let j = 0; j < N; ++j) {\n if (i === X[j]) memo[i] = true\n }\n }\n\n let result = Infinity\n\n for(let i = 1; i <= MAX; ++i) {\n if(!memo[i]) {\n let total = 0\n for(let j = 0; j < N; ++j) {\n const n = X[j] - i\n total += n * n\n }\n\n result = Math.min(result, total)\n\n }\n }\n\n if( result === Infinity ) result = 0\n console.log(result)\n\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "sample_input": "2\n1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02767", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N people living on a number line.\n\nThe i-th person lives at coordinate X_i.\n\nYou are going to hold a meeting that all N people have to attend.\n\nThe meeting can be held at any integer coordinate. If you choose to hold the meeting at coordinate P, the i-th person will spend (X_i - P)^2 points of stamina to attend the meeting.\n\nFind the minimum total points of stamina the N people have to spend.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq X_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 X_2 ... X_N\n\nOutput\n\nPrint the minimum total stamina the N people have to spend.\n\nSample Input 1\n\n2\n1 4\n\nSample Output 1\n\n5\n\nAssume the meeting is held at coordinate 2. In this case, the first person will spend (1 - 2)^2 points of stamina, and the second person will spend (4 - 2)^2 = 4 points of stamina, for a total of 5 points of stamina. This is the minimum total stamina that the 2 people have to spend.\n\nNote that you can hold the meeting only at an integer coordinate.\n\nSample Input 2\n\n7\n14 14 2 13 56 2 37\n\nSample Output 2\n\n2354", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 707, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s342046285", "group_id": "codeNet:p02771", "input_text": "function Main(arg)\n{\n var N = arg.split(\" \").map(Number);\n \n var ans = new Set(N);\n\n console.log(ans.size == 2 ? \"Yes\" : \"No\");\n\n return;\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1581883415, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02771.html", "problem_id": "p02771", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02771/input.txt", "sample_output_relpath": "derived/input_output/data/p02771/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02771/JavaScript/s342046285.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s342046285", "user_id": "u303297838"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(arg)\n{\n var N = arg.split(\" \").map(Number);\n \n var ans = new Set(N);\n\n console.log(ans.size == 2 ? \"Yes\" : \"No\");\n\n return;\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nA triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.\n\nYou will be given three integers A, B, and C. If this triple is poor, print Yes; otherwise, print No.\n\nConstraints\n\nA, B, and C are all integers between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the given triple is poor, print Yes; otherwise, print No.\n\nSample Input 1\n\n5 7 5\n\nSample Output 1\n\nYes\n\nA and C are equal, but B is different from those two numbers, so this triple is poor.\n\nSample Input 2\n\n4 4 4\n\nSample Output 2\n\nNo\n\nA, B, and C are all equal, so this triple is not poor.\n\nSample Input 3\n\n4 9 6\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3 3 4\n\nSample Output 4\n\nYes", "sample_input": "5 7 5\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02771", "source_text": "Score: 100 points\n\nProblem Statement\n\nA triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers.\n\nYou will be given three integers A, B, and C. If this triple is poor, print Yes; otherwise, print No.\n\nConstraints\n\nA, B, and C are all integers between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nIf the given triple is poor, print Yes; otherwise, print No.\n\nSample Input 1\n\n5 7 5\n\nSample Output 1\n\nYes\n\nA and C are equal, but B is different from those two numbers, so this triple is poor.\n\nSample Input 2\n\n4 4 4\n\nSample Output 2\n\nNo\n\nA, B, and C are all equal, so this triple is not poor.\n\nSample Input 3\n\n4 9 6\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n3 3 4\n\nSample Output 4\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 201, "cpu_time_ms": 171, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s607238316", "group_id": "codeNet:p02772", "input_text": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nMain();\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//standard output\nfunction myerr(t){console.error(t);}//standard error\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = myconv(next(),1);\n var list = myconv(next(),4);\n for(var i = 0; i < N; i++){\n if(list[i] % 2 == 0){\n if(!(list[i] % 3 == 0 || list[i] % 5 == 0)){\n myout(\"DENIED\");\n return;\n }\n }\n }\n myout(\"APPROVED\");\n}", "language": "JavaScript", "metadata": {"date": 1581883484, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02772.html", "problem_id": "p02772", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02772/input.txt", "sample_output_relpath": "derived/input_output/data/p02772/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02772/JavaScript/s607238316.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s607238316", "user_id": "u222822036"}, "prompt_components": {"gold_output": "APPROVED\n", "input_to_evaluate": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nMain();\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//standard output\nfunction myerr(t){console.error(t);}//standard error\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = myconv(next(),1);\n var list = myconv(next(),4);\n for(var i = 0; i < N; i++){\n if(list[i] % 2 == 0){\n if(!(list[i] % 3 == 0 || list[i] % 5 == 0)){\n myout(\"DENIED\");\n return;\n }\n }\n }\n myout(\"APPROVED\");\n}", "problem_context": "Score: 200 points\n\nProblem Statement\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\n\nAccording to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:\n\nAll even numbers written on the document are divisible by 3 or 5.\n\nIf the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.\n\nNotes\n\nThe condition in the statement can be rephrased as \"If x is an even number written on the document, x is divisible by 3 or 5\".\nHere \"if\" and \"or\" are logical terms.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nIf the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.\n\nSample Input 1\n\n5\n6 7 9 10 31\n\nSample Output 1\n\nAPPROVED\n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\nSample Input 2\n\n3\n28 27 24\n\nSample Output 2\n\nDENIED\n\n28 violates the condition, so the immigrant should not be allowed entry.", "sample_input": "5\n6 7 9 10 31\n"}, "reference_outputs": ["APPROVED\n"], "source_document_id": "p02772", "source_text": "Score: 200 points\n\nProblem Statement\n\nYou are an immigration officer in the Kingdom of AtCoder. The document carried by an immigrant has some number of integers written on it, and you need to check whether they meet certain criteria.\n\nAccording to the regulation, the immigrant should be allowed entry to the kingdom if and only if the following condition is satisfied:\n\nAll even numbers written on the document are divisible by 3 or 5.\n\nIf the immigrant should be allowed entry according to the regulation, output APPROVED; otherwise, print DENIED.\n\nNotes\n\nThe condition in the statement can be rephrased as \"If x is an even number written on the document, x is divisible by 3 or 5\".\nHere \"if\" and \"or\" are logical terms.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 1000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\dots A_N\n\nOutput\n\nIf the immigrant should be allowed entry according to the regulation, print APPROVED; otherwise, print DENIED.\n\nSample Input 1\n\n5\n6 7 9 10 31\n\nSample Output 1\n\nAPPROVED\n\nThe even numbers written on the document are 6 and 10.\n\nAll of them are divisible by 3 or 5, so the immigrant should be allowed entry.\n\nSample Input 2\n\n3\n28 27 24\n\nSample Output 2\n\nDENIED\n\n28 violates the condition, so the immigrant should not be allowed entry.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1482, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s288867591", "group_id": "codeNet:p02773", "input_text": "function Main(input) {\n var line = input.split(\"\\n\");\n var n = parseFloat(line[0]);\n var ws = {};\n for (var i = 1; i <= n; ++i) {\n if (ws[line[i]] === undefined) {\n ws[line[i]] = 1;\n } else {\n ++ws[line[i]];\n }\n }\n var m = 0;\n for (var w in ws) {\n if (ws[w] > m) m = ws[w];\n }\n var rs = [];\n for (var w in ws) {\n if (ws[w] === m) rs.push(w);\n }\n rs.sort(function(a, b){\n a = a.toString().toLowerCase();\n b = b.toString().toLowerCase();\n if(a < b){\n return -1;\n }else if(a > b){\n return 1;\n }\n });\n for (var r of rs) console.log(r);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1581884857, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02773.html", "problem_id": "p02773", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02773/input.txt", "sample_output_relpath": "derived/input_output/data/p02773/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02773/JavaScript/s288867591.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s288867591", "user_id": "u977660562"}, "prompt_components": {"gold_output": "beet\nvet\n", "input_to_evaluate": "function Main(input) {\n var line = input.split(\"\\n\");\n var n = parseFloat(line[0]);\n var ws = {};\n for (var i = 1; i <= n; ++i) {\n if (ws[line[i]] === undefined) {\n ws[line[i]] = 1;\n } else {\n ++ws[line[i]];\n }\n }\n var m = 0;\n for (var w in ws) {\n if (ws[w] > m) m = ws[w];\n }\n var rs = [];\n for (var w in ws) {\n if (ws[w] === m) rs.push(w);\n }\n rs.sort(function(a, b){\n a = a.toString().toLowerCase();\n b = b.toString().toLowerCase();\n if(a < b){\n return -1;\n }else if(a > b){\n return 1;\n }\n });\n for (var r of rs) console.log(r);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "sample_input": "7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n"}, "reference_outputs": ["beet\nvet\n"], "source_document_id": "p02773", "source_text": "Score: 300 points\n\nProblem Statement\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nS_i (1 \\leq i \\leq N) are strings consisting of lowercase English letters.\n\nThe length of S_i (1 \\leq i \\leq N) is between 1 and 10 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1\n:\nS_N\n\nOutput\n\nPrint all strings in question in lexicographical order.\n\nSample Input 1\n\n7\nbeat\nvet\nbeet\nbed\nvet\nbet\nbeet\n\nSample Output 1\n\nbeet\nvet\n\nbeet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.\n\nSample Input 2\n\n8\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\nbuffalo\n\nSample Output 2\n\nbuffalo\n\nSample Input 3\n\n7\nbass\nbass\nkick\nkick\nbass\nkick\nkick\n\nSample Output 3\n\nkick\n\nSample Input 4\n\n4\nushi\ntapu\nnichia\nkun\n\nSample Output 4\n\nkun\nnichia\ntapu\nushi", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 653, "cpu_time_ms": 2109, "memory_kb": 86136}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s446494674", "group_id": "codeNet:p02777", "input_text": "function main(arg){\n \tvar out = arg.trim().split('\\n');\n\tvar ball = out[0].split(' ');\n \tvar num = out[1].split(' ').map(str => parseInt(str, 10)); \n \tvar fall = out[2];\n \n \tvar result;\n \tif(ball[0] === fall) {\n \tnum[0]--;\n \tresult = num.join(' ');\n } else if (ball[1] === fall){\n \tnum[1]--;\n \tresult = num.join(' ');\n }\n\tconsole.log(result);\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1582293956, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02777.html", "problem_id": "p02777", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02777/input.txt", "sample_output_relpath": "derived/input_output/data/p02777/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02777/JavaScript/s446494674.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s446494674", "user_id": "u321604546"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "function main(arg){\n \tvar out = arg.trim().split('\\n');\n\tvar ball = out[0].split(' ');\n \tvar num = out[1].split(' ').map(str => parseInt(str, 10)); \n \tvar fall = out[2];\n \n \tvar result;\n \tif(ball[0] === fall) {\n \tnum[0]--;\n \tresult = num.join(' ');\n } else if (ball[1] === fall){\n \tnum[1]--;\n \tresult = num.join(' ');\n }\n\tconsole.log(result);\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "sample_input": "red blue\n3 4\nred\n"}, "reference_outputs": ["2 4\n"], "source_document_id": "p02777", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 429, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s196892601", "group_id": "codeNet:p02777", "input_text": "function Main(impu) {\n\tlet imput = impu.split(\"\\n\");\n\tlet name = imput[0].split(\" \");\n\tlet count = imput[1].split(\" \");\n\t\n\t+count[0];\n\t+count[1];\n\t\n\tif(name[0] === imput[2]) \n\t\tcount[0]--;\n\telse\n\t\tcount[1]--;\n\t\n\tconsole.log(count[0] + \" \" + count[1]);\n}", "language": "JavaScript", "metadata": {"date": 1581280905, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02777.html", "problem_id": "p02777", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02777/input.txt", "sample_output_relpath": "derived/input_output/data/p02777/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02777/JavaScript/s196892601.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s196892601", "user_id": "u571323639"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "function Main(impu) {\n\tlet imput = impu.split(\"\\n\");\n\tlet name = imput[0].split(\" \");\n\tlet count = imput[1].split(\" \");\n\t\n\t+count[0];\n\t+count[1];\n\t\n\tif(name[0] === imput[2]) \n\t\tcount[0]--;\n\telse\n\t\tcount[1]--;\n\t\n\tconsole.log(count[0] + \" \" + count[1]);\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "sample_input": "red blue\n3 4\nred\n"}, "reference_outputs": ["2 4\n"], "source_document_id": "p02777", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 253, "cpu_time_ms": 627, "memory_kb": 20936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s785022357", "group_id": "codeNet:p02777", "input_text": "function Main(input) {\n\tinput = input.split(\"\\n\");\n\tinput[0] = input[0].split(\" \");\n\tinput[1] = input[1].split(\" \");\n\tvar ans = input[1];\n\tif(input[2]==input[0][0]) ans[0]--;\n\telse ans[1]--;\n\tconsole.log(ans.join(\" \")); \n}Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "language": "JavaScript", "metadata": {"date": 1581279166, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02777.html", "problem_id": "p02777", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02777/input.txt", "sample_output_relpath": "derived/input_output/data/p02777/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02777/JavaScript/s785022357.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s785022357", "user_id": "u938152299"}, "prompt_components": {"gold_output": "2 4\n", "input_to_evaluate": "function Main(input) {\n\tinput = input.split(\"\\n\");\n\tinput[0] = input[0].split(\" \");\n\tinput[1] = input[1].split(\" \");\n\tvar ans = input[1];\n\tif(input[2]==input[0][0]) ans[0]--;\n\telse ans[1]--;\n\tconsole.log(ans.join(\" \")); \n}Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "sample_input": "red blue\n3 4\nred\n"}, "reference_outputs": ["2 4\n"], "source_document_id": "p02777", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A balls with the string S written on each of them and B balls with the string T written on each of them.\n\nFrom these balls, Takahashi chooses one with the string U written on it and throws it away.\n\nFind the number of balls with the string S and balls with the string T that we have now.\n\nConstraints\n\nS, T, and U are strings consisting of lowercase English letters.\n\nThe lengths of S and T are each between 1 and 10 (inclusive).\n\nS \\not= T\n\nS=U or T=U.\n\n1 \\leq A,B \\leq 10\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\nA B\nU\n\nOutput\n\nPrint the answer, with space in between.\n\nSample Input 1\n\nred blue\n3 4\nred\n\nSample Output 1\n\n2 4\n\nTakahashi chose a ball with red written on it and threw it away.\nNow we have two balls with the string S and four balls with the string T.\n\nSample Input 2\n\nred blue\n5 5\nblue\n\nSample Output 2\n\n5 4\n\nTakahashi chose a ball with blue written on it and threw it away.\nNow we have five balls with the string S and four balls with the string T.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 284, "cpu_time_ms": 570, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s309694151", "group_id": "codeNet:p02778", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n \tvar S = input.split(\"\\n\")[0];\n \n \tconsole.log(\"x\".repeat(S.length));\n \treturn;\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1581594207, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02778.html", "problem_id": "p02778", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02778/input.txt", "sample_output_relpath": "derived/input_output/data/p02778/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02778/JavaScript/s309694151.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s309694151", "user_id": "u138073252"}, "prompt_components": {"gold_output": "xxxxxxx\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n \tvar S = input.split(\"\\n\")[0];\n \n \tconsole.log(\"x\".repeat(S.length));\n \treturn;\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "sample_input": "sardine\n"}, "reference_outputs": ["xxxxxxx\n"], "source_document_id": "p02778", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is a string S. Replace every character in S with x and print the result.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nReplace every character in S with x and print the result.\n\nSample Input 1\n\nsardine\n\nSample Output 1\n\nxxxxxxx\n\nReplacing every character in S with x results in xxxxxxx.\n\nSample Input 2\n\nxxxx\n\nSample Output 2\n\nxxxx\n\nSample Input 3\n\ngone\n\nSample Output 3\n\nxxxx", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 335, "cpu_time_ms": 228, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s889033502", "group_id": "codeNet:p02779", "input_text": "function main(input) {\n const inputs =input.split('\\n')\n const [N] = inputs[0].split(' ').map(Number)\n const A = inputs[1].split(' ').map(Number)\n const len = A.length\n const slen = (new Set(A)).size\n console.log(len === slen ? 'YES' : 'NO')\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim())\n", "language": "JavaScript", "metadata": {"date": 1592735685, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02779.html", "problem_id": "p02779", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02779/input.txt", "sample_output_relpath": "derived/input_output/data/p02779/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02779/JavaScript/s889033502.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s889033502", "user_id": "u431663947"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "function main(input) {\n const inputs =input.split('\\n')\n const [N] = inputs[0].split(' ').map(Number)\n const A = inputs[1].split(' ').map(Number)\n const len = A.length\n const slen = (new Set(A)).size\n console.log(len === slen ? 'YES' : 'NO')\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim())\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "sample_input": "5\n2 6 1 4 5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02779", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a sequence of integers A_1, A_2, ..., A_N.\nIf its elements are pairwise distinct, print YES; otherwise, print NO.\n\nConstraints\n\n2 ≤ N ≤ 200000\n\n1 ≤ A_i ≤ 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nIf the elements of the sequence are pairwise distinct, print YES; otherwise, print NO.\n\nSample Input 1\n\n5\n2 6 1 4 5\n\nSample Output 1\n\nYES\n\nThe elements are pairwise distinct.\n\nSample Input 2\n\n6\n4 1 3 1 6 2\n\nSample Output 2\n\nNO\n\nThe second and fourth elements are identical.\n\nSample Input 3\n\n2\n10000000 10000000\n\nSample Output 3\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 313, "cpu_time_ms": 120, "memory_kb": 55636}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s795730590", "group_id": "codeNet:p02780", "input_text": "\"use strict\";\n\nconst main = arg => {\n // 標準入力の不要な空白と改行を削除し、配列に格納する\n const input = arg.trim().split(\"\\n\");\n const N = input[0].split(\" \")[0];\n const K = input[0].split(\" \")[1];\n const p = input[1].split(\" \").map(p => Math.floor(p));\n\n const add = (a, b) => a + b;\n const kitai = (a) => (a + 1) / 2;\n\n \n let maxArray = [0];\n let maxArraySum = 0;\n for (let i=0; i maxArraySum {\n maxArray = currentArray;\n maxArraySum = maxArray.reduce(add);\n }\n }\n console.log(maxArray.map(kitai).reduce(add));\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "language": "JavaScript", "metadata": {"date": 1581284367, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02780.html", "problem_id": "p02780", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02780/input.txt", "sample_output_relpath": "derived/input_output/data/p02780/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02780/JavaScript/s795730590.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s795730590", "user_id": "u280818020"}, "prompt_components": {"gold_output": "7.000000000000\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n // 標準入力の不要な空白と改行を削除し、配列に格納する\n const input = arg.trim().split(\"\\n\");\n const N = input[0].split(\" \")[0];\n const K = input[0].split(\" \")[1];\n const p = input[1].split(\" \").map(p => Math.floor(p));\n\n const add = (a, b) => a + b;\n const kitai = (a) => (a + 1) / 2;\n\n \n let maxArray = [0];\n let maxArraySum = 0;\n for (let i=0; i maxArraySum {\n maxArray = currentArray;\n maxArraySum = maxArray.reduce(add);\n }\n }\n console.log(maxArray.map(kitai).reduce(add));\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "sample_input": "5 3\n1 2 2 4 5\n"}, "reference_outputs": ["7.000000000000\n"], "source_document_id": "p02780", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N dice arranged in a line from left to right. The i-th die from the left shows p_i numbers from 1 to p_i with equal probability when thrown.\n\nWe will choose K adjacent dice, throw each of them independently, and compute the sum of the numbers shown. Find the maximum possible value of the expected value of this sum.\n\nConstraints\n\n1 ≤ K ≤ N ≤ 200000\n\n1 ≤ p_i ≤ 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\np_1 ... p_N\n\nOutput\n\nPrint the maximum possible value of the expected value of the sum of the numbers shown.\n\nYour output will be considered correct when its absolute or relative error from our answer is at most 10^{-6}.\n\nSample Input 1\n\n5 3\n1 2 2 4 5\n\nSample Output 1\n\n7.000000000000\n\nWhen we throw the third, fourth, and fifth dice from the left, the expected value of the sum of the numbers shown is 7. This is the maximum value we can achieve.\n\nSample Input 2\n\n4 1\n6 6 6 6\n\nSample Output 2\n\n3.500000000000\n\nRegardless of which die we choose, the expected value of the number shown is 3.5.\n\nSample Input 3\n\n10 4\n17 13 13 12 15 20 10 13 17 11\n\nSample Output 3\n\n32.000000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 832, "cpu_time_ms": 52, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s048005948", "group_id": "codeNet:p02784", "input_text": "const Main = (input) => {\n const dataArray = input.split('\\n');\n \t\tconst strength = dataArray[0].split(' ')[0];\n \t\tconst deathblowType = dataArray[0].split(' ')[1];\n\t\tconst deathblowList = dataArray[1].split(' ');\n \t\tvar totalAttack = 0;\n for (var i = 0; i < deathblowList.length; i ++){\n totalAttack += deathblowList[i];\n }\n if (totalAttack >= 0) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n }\n\n Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1580165619, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02784.html", "problem_id": "p02784", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02784/input.txt", "sample_output_relpath": "derived/input_output/data/p02784/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02784/JavaScript/s048005948.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s048005948", "user_id": "u332593126"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "const Main = (input) => {\n const dataArray = input.split('\\n');\n \t\tconst strength = dataArray[0].split(' ')[0];\n \t\tconst deathblowType = dataArray[0].split(' ')[1];\n\t\tconst deathblowList = dataArray[1].split(' ');\n \t\tvar totalAttack = 0;\n for (var i = 0; i < deathblowList.length; i ++){\n totalAttack += deathblowList[i];\n }\n if (totalAttack >= 0) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n }\n\n Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "sample_input": "10 3\n4 5 6\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02784", "source_text": "Score : 200 points\n\nProblem Statement\n\nRaccoon is fighting with a monster.\n\nThe health of the monster is H.\n\nRaccoon can use N kinds of special moves. Using the i-th move decreases the monster's health by A_i.\nThere is no other way to decrease the monster's health.\n\nRaccoon wins when the monster's health becomes 0 or below.\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nConstraints\n\n1 \\leq H \\leq 10^9\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^4\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH N\nA_1 A_2 ... A_N\n\nOutput\n\nIf Raccoon can win without using the same move twice or more, print Yes; otherwise, print No.\n\nSample Input 1\n\n10 3\n4 5 6\n\nSample Output 1\n\nYes\n\nThe monster's health will become 0 or below after, for example, using the second and third moves.\n\nSample Input 2\n\n20 3\n4 5 6\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n210 5\n31 41 59 26 53\n\nSample Output 3\n\nYes\n\nSample Input 4\n\n211 5\n31 41 59 26 53\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 494, "cpu_time_ms": 244, "memory_kb": 28492}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s237121376", "group_id": "codeNet:p02785", "input_text": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n↑入力 ↓出力');\n Main();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n var N = one[0];\n var K = one[1];\n var list = nextIntArray();\n list.sort(function(a,b){\n return b - a;\n });\n var output = 0;\n for(var i = K; i < N; i++){\n output += list[i];\n }\n myout(output);\n\n}\n", "language": "JavaScript", "metadata": {"date": 1598990319, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/JavaScript/s237121376.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s237121376", "user_id": "u222822036"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n↑入力 ↓出力');\n Main();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var one = nextIntArray();\n var N = one[0];\n var K = one[1];\n var list = nextIntArray();\n list.sort(function(a,b){\n return b - a;\n });\n var output = 0;\n for(var i = K; i < N; i++){\n output += list[i];\n }\n myout(output);\n\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2021, "cpu_time_ms": 196, "memory_kb": 53488}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s198839789", "group_id": "codeNet:p02785", "input_text": "\"use strict\";\n\nconst main = arg => {\n // 標準入力の不要な空白と改行を削除し、配列に格納する\n let input = arg.trim().split(\"\\n\").map(low => low.split(\" \").map(str => Math.floor(str, 10)));\n\n if (input[0][1] >= input[0][0]) {\n console.log(0);\n return;\n }\n const returnSum = (a, n) => a + n;\n console.log(input[1].sort((a, b) => b - a).slice(input[0][1]).reduce(returnSum));\n \n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "language": "JavaScript", "metadata": {"date": 1581110159, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/JavaScript/s198839789.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s198839789", "user_id": "u280818020"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n // 標準入力の不要な空白と改行を削除し、配列に格納する\n let input = arg.trim().split(\"\\n\").map(low => low.split(\" \").map(str => Math.floor(str, 10)));\n\n if (input[0][1] >= input[0][0]) {\n console.log(0);\n return;\n }\n const returnSum = (a, n) => a + n;\n console.log(input[1].sort((a, b) => b - a).slice(input[0][1]).reduce(returnSum));\n \n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 494, "cpu_time_ms": 193, "memory_kb": 37328}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s230590788", "group_id": "codeNet:p02785", "input_text": "function Main(input) {\n input = input.trim().split('\\n');\n K = input[0].split(' ')[1];\n Ni = input[1].split(' ');\n if (K >= Ni.length) {\n console.log('0');\n return;\n }\n console.log(Ni.sort((a,b) => b-a).map(Number).reduce((a,v,i) => i < K ? a : a + v, 0));\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1580947296, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02785.html", "problem_id": "p02785", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02785/input.txt", "sample_output_relpath": "derived/input_output/data/p02785/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02785/JavaScript/s230590788.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s230590788", "user_id": "u443208331"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function Main(input) {\n input = input.trim().split('\\n');\n K = input[0].split(' ')[1];\n Ni = input[1].split(' ');\n if (K >= Ni.length) {\n console.log('0');\n return;\n }\n console.log(Ni.sort((a,b) => b-a).map(Number).reduce((a,v,i) => i < K ? a : a + v, 0));\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "sample_input": "3 1\n4 1 5\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02785", "source_text": "Score : 300 points\n\nProblem Statement\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\nAttack: Fennec chooses one monster. That monster's health will decrease by 1.\n\nSpecial Move: Fennec chooses one monster. That monster's health will become 0.\n\nThere is no way other than Attack and Special Move to decrease the monsters' health.\n\nFennec wins when all the monsters' healths become 0 or below.\n\nFind the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning when she can use Special Move at most K times.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n0 \\leq K \\leq 2 \\times 10^5\n\n1 \\leq H_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nH_1 ... H_N\n\nOutput\n\nPrint the minimum number of times Fennec needs to do Attack (not counting Special Move) before winning.\n\nSample Input 1\n\n3 1\n4 1 5\n\nSample Output 1\n\n5\n\nBy using Special Move on the third monster, and doing Attack four times on the first monster and once on the second monster, Fennec can win with five Attacks.\n\nSample Input 2\n\n8 9\n7 9 3 2 3 8 4 6\n\nSample Output 2\n\n0\n\nShe can use Special Move on all the monsters.\n\nSample Input 3\n\n3 0\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n3000000000\n\nWatch out for overflow.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 326, "cpu_time_ms": 607, "memory_kb": 35744}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s495890088", "group_id": "codeNet:p02785", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.split(\"\\n\");\n tmp = input[1];\n tmp1 = input[0].split(\" \");\n n = parseInt(tmp1[0], 10);\n k = parseInt(tmp1[1], 10);\n //出力\n count = 0;\n\n if(n<=k){\n console.log(\"0\");\n }else if(k==0){\n m = tmp.split(\" \");\n for(j=0;j a-b);\n //console.log('%d',k);\n for(i=0;i a-b);\n //console.log('%d',k);\n for(i=0;iv-0));\n }\n list = list.sort((a,b)=>a[0]-b[0]);\n\n var ans = 0;\n for (var i = 0; i < N; i++) {\n var x = list[i];\n if(x[1] > 0){\n var time = Math.ceil(x[1]/A);\n ans += time;\n for(var j=i;jv-0));\n }\n list = list.sort((a,b)=>a[0]-b[0]);\n\n var ans = 0;\n for (var i = 0; i < N; i++) {\n var x = list[i];\n if(x[1] > 0){\n var time = Math.ceil(x[1]/A);\n ans += time;\n for(var j=i;j parseInt(s, 10));\n let m = 200001, ans = 0;\n for (let p of P) {\n if (p < m) ans++;\n m = Math.min(m, p);\n }\n console.log(ans);\n \n}\nconst iter = main();\niter.next();\nrequire(\"readline\").createInterface({input: process.stdin, output: process.stdout}).on(\"line\", line => iter.next(line));", "language": "JavaScript", "metadata": {"date": 1593829189, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/JavaScript/s491874581.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s491874581", "user_id": "u347948131"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function *main() {\n \n const N = parseInt((yield), 10);\n const P = (yield).split(\" \").map(s => parseInt(s, 10));\n let m = 200001, ans = 0;\n for (let p of P) {\n if (p < m) ans++;\n m = Math.min(m, p);\n }\n console.log(ans);\n \n}\nconst iter = main();\niter.next();\nrequire(\"readline\").createInterface({input: process.stdin, output: process.stdout}).on(\"line\", line => iter.next(line));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 134, "memory_kb": 50624}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s401309114", "group_id": "codeNet:p02791", "input_text": "function *main() {\n \n const N = +(yield);\n const P = (yield).trim().split(\" \").map(s => +s);\n let m = 20001, ans = 0;\n for (let p of P) {\n if (p < m) ans++;\n m = Math.min(m, p);\n }\n console.log(ans);\n \n}\nconst iter = main();\niter.next();\nrequire(\"readline\").createInterface({input: process.stdin, output: process.stdout}).on(\"line\", line => iter.next(line));", "language": "JavaScript", "metadata": {"date": 1593828860, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/JavaScript/s401309114.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s401309114", "user_id": "u347948131"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function *main() {\n \n const N = +(yield);\n const P = (yield).trim().split(\" \").map(s => +s);\n let m = 20001, ans = 0;\n for (let p of P) {\n if (p < m) ans++;\n m = Math.min(m, p);\n }\n console.log(ans);\n \n}\nconst iter = main();\niter.next();\nrequire(\"readline\").createInterface({input: process.stdin, output: process.stdout}).on(\"line\", line => iter.next(line));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 372, "cpu_time_ms": 124, "memory_kb": 50704}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s699066187", "group_id": "codeNet:p02791", "input_text": "\"use strict\";\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"UTF-8\"));\n\nfunction main(input) {\n input = input.split(\"\\n\");\n const N = input.shift();\n const permutation = input[0].split(\" \");\n\n let result = 0;\n\n for (let i = 0; i < N; i++) {\n let tmp = permutation.slice(0, permutation[i]).sort();\n\n if (permutation[permutation[i] - 1] <= tmp) {\n result++;\n }\n }\n console.log(result);\n}\n", "language": "JavaScript", "metadata": {"date": 1580511913, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02791.html", "problem_id": "p02791", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02791/input.txt", "sample_output_relpath": "derived/input_output/data/p02791/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02791/JavaScript/s699066187.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s699066187", "user_id": "u846403188"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\"use strict\";\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"UTF-8\"));\n\nfunction main(input) {\n input = input.split(\"\\n\");\n const N = input.shift();\n const permutation = input[0].split(\" \");\n\n let result = 0;\n\n for (let i = 0; i < N; i++) {\n let tmp = permutation.slice(0, permutation[i]).sort();\n\n if (permutation[permutation[i] - 1] <= tmp) {\n result++;\n }\n }\n console.log(result);\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "sample_input": "5\n4 2 5 1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02791", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a permutation P_1, \\ldots, P_N of 1, \\ldots, N.\nFind the number of integers i (1 \\leq i \\leq N) that satisfy the following condition:\n\nFor any integer j (1 \\leq j \\leq i), P_i \\leq P_j.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nP_1, \\ldots, P_N is a permutation of 1, \\ldots, N.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nP_1 ... P_N\n\nOutput\n\nPrint the number of integers i that satisfy the condition.\n\nSample Input 1\n\n5\n4 2 5 1 3\n\nSample Output 1\n\n3\n\ni=1, 2, and 4 satisfy the condition, but i=3 does not - for example, P_i > P_j holds for j = 1.\n\nSimilarly, i=5 does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.\n\nSample Input 2\n\n4\n4 3 2 1\n\nSample Output 2\n\n4\n\nAll integers i (1 \\leq i \\leq N) satisfy the condition.\n\nSample Input 3\n\n6\n1 2 3 4 5 6\n\nSample Output 3\n\n1\n\nOnly i=1 satisfies the condition.\n\nSample Input 4\n\n8\n5 7 4 2 6 8 1 3\n\nSample Output 4\n\n4\n\nSample Input 5\n\n1\n1\n\nSample Output 5\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 407, "cpu_time_ms": 2113, "memory_kb": 102944}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s406832420", "group_id": "codeNet:p02792", "input_text": "'use strict'\n\n\nconst pair = (x) => {\n const a = x%10 // 末尾の一桁\n let b = 0\n\n // 一桁目の取得\n while(x) {\n b = x\n x = Math.floor(x/10)\n }\n\n return [a, b]\n}\n\nfunction Main(input) {\n input = input.trim()\n const N = parseInt(input)\n let c = 0\n let map = {}\n\n // 組み合わせのマップを作成する\n for(let i = 1; i <= N; ++i) {\n let p = pair(i)\n if(!map[p]) map[p] = 0\n map[p]++\n }\n\n // 組み合わせマップから答えを算出する\n for(let i = 1; i <= N; ++i) {\n let p = pair(i)\n let q = [p[1], p[0]]\n if(map[q]) {\n c += map[q]\n }\n }\n\n console.log(c)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1579481089, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02792.html", "problem_id": "p02792", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02792/input.txt", "sample_output_relpath": "derived/input_output/data/p02792/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02792/JavaScript/s406832420.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s406832420", "user_id": "u177274511"}, "prompt_components": {"gold_output": "17\n", "input_to_evaluate": "'use strict'\n\n\nconst pair = (x) => {\n const a = x%10 // 末尾の一桁\n let b = 0\n\n // 一桁目の取得\n while(x) {\n b = x\n x = Math.floor(x/10)\n }\n\n return [a, b]\n}\n\nfunction Main(input) {\n input = input.trim()\n const N = parseInt(input)\n let c = 0\n let map = {}\n\n // 組み合わせのマップを作成する\n for(let i = 1; i <= N; ++i) {\n let p = pair(i)\n if(!map[p]) map[p] = 0\n map[p]++\n }\n\n // 組み合わせマップから答えを算出する\n for(let i = 1; i <= N; ++i) {\n let p = pair(i)\n let q = [p[1], p[0]]\n if(map[q]) {\n c += map[q]\n }\n }\n\n console.log(c)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "sample_input": "25\n"}, "reference_outputs": ["17\n"], "source_document_id": "p02792", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 683, "cpu_time_ms": 1034, "memory_kb": 26016}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s457893871", "group_id": "codeNet:p02792", "input_text": "'use strict'\n\nfunction Main(input) {\n\n input = input.trim()\n const N = parseInt(input)\n\n let c = 0\n for(let i = 1; i <= N; ++i) {\n const a = `${i}`\n for(let j = 1; j <= N; ++j) {\n const b = `${j}`\n\n const al = a[a.length - 1]\n const bt = b[0]\n\n const at = a[0]\n const bl = b[b.length - 1]\n\n if (al === bt && at === bl) c++\n\n\n }\n }\n\n console.log(c)\n \n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1579467262, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02792.html", "problem_id": "p02792", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02792/input.txt", "sample_output_relpath": "derived/input_output/data/p02792/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02792/JavaScript/s457893871.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s457893871", "user_id": "u177274511"}, "prompt_components": {"gold_output": "17\n", "input_to_evaluate": "'use strict'\n\nfunction Main(input) {\n\n input = input.trim()\n const N = parseInt(input)\n\n let c = 0\n for(let i = 1; i <= N; ++i) {\n const a = `${i}`\n for(let j = 1; j <= N; ++j) {\n const b = `${j}`\n\n const al = a[a.length - 1]\n const bt = b[0]\n\n const at = a[0]\n const bl = b[b.length - 1]\n\n if (al === bt && at === bl) c++\n\n\n }\n }\n\n console.log(c)\n \n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "sample_input": "25\n"}, "reference_outputs": ["17\n"], "source_document_id": "p02792", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a positive integer N.\n\nFind the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition:\n\nWhen A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B, and the first digit of A is equal to the last digit of B.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n25\n\nSample Output 1\n\n17\n\nThe following 17 pairs satisfy the condition: (1,1), (1,11), (2,2), (2,22), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8), (9,9), (11,1), (11,11), (12,21), (21,12), (22,2), and (22,22).\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100\n\nSample Output 3\n\n108\n\nSample Input 4\n\n2020\n\nSample Output 4\n\n40812\n\nSample Input 5\n\n200000\n\nSample Output 5\n\n400000008", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 453, "cpu_time_ms": 2133, "memory_kb": 402508}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s304167196", "group_id": "codeNet:p02793", "input_text": "function Main(input) {\n\tinput = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n\tlet C = 1e9 + 7;\n\tlet C2 = 1e5;\n\tlet N = parseInt(input[0][0], 10);\n\tlet v_A = input[1].map(e => parseInt(e, 10));\n\n\tlet v_TF = Array.from({length: 1e3}, () => true);\n\tfor (let i = 2; i <= 1e3 / 2; i++){\n\t\tfor (let j = 2; j <= 1e3 / i; j++){\n\t\t\tv_TF[i * j - 1] = false;\n\t\t}\n\t}\n\tlet v_prime = [];\n\tfor (let i = 1; i < v_TF.length; i++){\n\t\tif (v_TF[i]) v_prime.push(i + 1);\n\t}\n\n\t//calculate saishokobaisu\n\tlet v_howManyTimes = Array.from({length: v_prime.length}, () => 0);\n\tlet tmp;\n\tlet arr_soinsu = Array.from({length: N}, () => []);\n\twhole_loop:\n\tfor (let i = 0; i < N; i ++){\n\t\ttmp = v_A[i];\n\t\tfor (let j = 0; j < v_prime.length; j++){\n\t\t\tlet count = 0;\n\t\t\twhile (tmp % v_prime[j] === 0){\n\t\t\t\ttmp /= v_prime[j];\n\t\t\t\tcount ++;\n\t\t\t}\n\t\t\tarr_soinsu[i][j] = count;\n\t\t\tv_howManyTimes[j] = Math.max(v_howManyTimes[j], count);\n\t\t\tif (tmp === 1) continue whole_loop;\n\t\t}\n\t}\n\n\tlet P = 1;\n\tfor (let i = 0; i < v_prime.length; i ++){\n\t\tfor (let j = 1; j <= v_howManyTimes[i]; j ++){\n\t\t\tP = kakeruR(P, v_prime[i], C, C2);\n\t\t}\n\t}\n\n\t//calculate inverse\n\tlet v_INV = INV(1e3, C, C2);\n\n\t//calculate ans\n\n\tlet ans = 0;\n\tfor (let i = 0; i < N; i ++){\n\t\ttmp = P;\n\t\tfor (let j = 0; j < v_prime.length; j ++){\n\t\t\tif (arr_soinsu[i][j] !== 0){\n\t\t\t\tfor (let k = 1; k <= arr_soinsu[i][j]; k ++){\n\t\t\t\t\ttmp = kakeruR(tmp, v_INV[v_prime[j]], C, C2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans += tmp;\n\t\tans %= C;\n\t}\n\tconsole.log(ans); \n}\n\nfunction INV(n, MOD, C2) { //return [0!^-1, 1!^-1, 2!^-1, ..., n!^-1]\n let inv;\n inv = [0,1];\n for (var i = 2; i <= n; i++){\n inv.push(MOD - kakeruR(inv[MOD%i], (MOD / i | 0), MOD, C2) % MOD);\n }\n return inv;\n}\n\nfunction kakeruR(a, b, C, C2){\n var tmpQ, tmpR, ans;\n tmpQ = (b / C2 | 0);\n tmpR = b - (tmpQ * C2);\n ans = (a * tmpQ % C) * C2 % C + (a * tmpR);\n ans %= C;\n return ans;\n}\n\n// function saishoKobai(x, y){\n// if (x < y) [x, y] = [y, x];\n// var tmp1 = x;\n// var tmp2 = y;\n// while (tmp2 != 0){\n// [tmp1, tmp2] = [tmp2, tmp1 % tmp2];\n// }\n// return (BigInt(x) * BigInt(y) / BigInt(tmp1));\n// }\n\n\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1596292600, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02793.html", "problem_id": "p02793", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02793/input.txt", "sample_output_relpath": "derived/input_output/data/p02793/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02793/JavaScript/s304167196.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s304167196", "user_id": "u624950076"}, "prompt_components": {"gold_output": "13\n", "input_to_evaluate": "function Main(input) {\n\tinput = input.trim().split(\"\\n\").map(function(x) { return x.split(\" \")});\n\tlet C = 1e9 + 7;\n\tlet C2 = 1e5;\n\tlet N = parseInt(input[0][0], 10);\n\tlet v_A = input[1].map(e => parseInt(e, 10));\n\n\tlet v_TF = Array.from({length: 1e3}, () => true);\n\tfor (let i = 2; i <= 1e3 / 2; i++){\n\t\tfor (let j = 2; j <= 1e3 / i; j++){\n\t\t\tv_TF[i * j - 1] = false;\n\t\t}\n\t}\n\tlet v_prime = [];\n\tfor (let i = 1; i < v_TF.length; i++){\n\t\tif (v_TF[i]) v_prime.push(i + 1);\n\t}\n\n\t//calculate saishokobaisu\n\tlet v_howManyTimes = Array.from({length: v_prime.length}, () => 0);\n\tlet tmp;\n\tlet arr_soinsu = Array.from({length: N}, () => []);\n\twhole_loop:\n\tfor (let i = 0; i < N; i ++){\n\t\ttmp = v_A[i];\n\t\tfor (let j = 0; j < v_prime.length; j++){\n\t\t\tlet count = 0;\n\t\t\twhile (tmp % v_prime[j] === 0){\n\t\t\t\ttmp /= v_prime[j];\n\t\t\t\tcount ++;\n\t\t\t}\n\t\t\tarr_soinsu[i][j] = count;\n\t\t\tv_howManyTimes[j] = Math.max(v_howManyTimes[j], count);\n\t\t\tif (tmp === 1) continue whole_loop;\n\t\t}\n\t}\n\n\tlet P = 1;\n\tfor (let i = 0; i < v_prime.length; i ++){\n\t\tfor (let j = 1; j <= v_howManyTimes[i]; j ++){\n\t\t\tP = kakeruR(P, v_prime[i], C, C2);\n\t\t}\n\t}\n\n\t//calculate inverse\n\tlet v_INV = INV(1e3, C, C2);\n\n\t//calculate ans\n\n\tlet ans = 0;\n\tfor (let i = 0; i < N; i ++){\n\t\ttmp = P;\n\t\tfor (let j = 0; j < v_prime.length; j ++){\n\t\t\tif (arr_soinsu[i][j] !== 0){\n\t\t\t\tfor (let k = 1; k <= arr_soinsu[i][j]; k ++){\n\t\t\t\t\ttmp = kakeruR(tmp, v_INV[v_prime[j]], C, C2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tans += tmp;\n\t\tans %= C;\n\t}\n\tconsole.log(ans); \n}\n\nfunction INV(n, MOD, C2) { //return [0!^-1, 1!^-1, 2!^-1, ..., n!^-1]\n let inv;\n inv = [0,1];\n for (var i = 2; i <= n; i++){\n inv.push(MOD - kakeruR(inv[MOD%i], (MOD / i | 0), MOD, C2) % MOD);\n }\n return inv;\n}\n\nfunction kakeruR(a, b, C, C2){\n var tmpQ, tmpR, ans;\n tmpQ = (b / C2 | 0);\n tmpR = b - (tmpQ * C2);\n ans = (a * tmpQ % C) * C2 % C + (a * tmpR);\n ans %= C;\n return ans;\n}\n\n// function saishoKobai(x, y){\n// if (x < y) [x, y] = [y, x];\n// var tmp1 = x;\n// var tmp2 = y;\n// while (tmp2 != 0){\n// [tmp1, tmp2] = [tmp2, tmp1 % tmp2];\n// }\n// return (BigInt(x) * BigInt(y) / BigInt(tmp1));\n// }\n\n\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n2 3 4\n"}, "reference_outputs": ["13\n"], "source_document_id": "p02793", "source_text": "Score : 500 points\n\nProblem Statement\n\nGiven are N positive integers A_1,...,A_N.\n\nConsider positive integers B_1, ..., B_N that satisfy the following condition.\n\nCondition: For any i, j such that 1 \\leq i < j \\leq N, A_i B_i = A_j B_j holds.\n\nFind the minimum possible value of B_1 + ... + B_N for such B_1,...,B_N.\n\nSince the answer can be enormous, print the sum modulo (10^9 +7).\n\nConstraints\n\n1 \\leq N \\leq 10^4\n\n1 \\leq A_i \\leq 10^6\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 ... A_N\n\nOutput\n\nPrint the minimum possible value of B_1 + ... + B_N for B_1,...,B_N that satisfy the condition, modulo (10^9 +7).\n\nSample Input 1\n\n3\n2 3 4\n\nSample Output 1\n\n13\n\nLet B_1=6, B_2=4, and B_3=3, and the condition will be satisfied.\n\nSample Input 2\n\n5\n12 12 12 12 12\n\nSample Output 2\n\n5\n\nWe can let all B_i be 1.\n\nSample Input 3\n\n3\n1000000 999999 999998\n\nSample Output 3\n\n996989508\n\nPrint the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2225, "cpu_time_ms": 169, "memory_kb": 65648}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s099095835", "group_id": "codeNet:p02795", "input_text": "\"use strict\"\n\nfunction Main(s) {\n s = s.split('\\n');\n const h = Number(s[0]);\n const w = Number(s[1]);\n const n = Number(s[2]);\n \n if(h>w){\n console.log(Math.ceil(n/h));\n }else{\n console.log(Math.ceil(n/h));\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1579378134, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02795.html", "problem_id": "p02795", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02795/input.txt", "sample_output_relpath": "derived/input_output/data/p02795/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02795/JavaScript/s099095835.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s099095835", "user_id": "u634079249"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\"\n\nfunction Main(s) {\n s = s.split('\\n');\n const h = Number(s[0]);\n const w = Number(s[1]);\n const n = Number(s[2]);\n \n if(h>w){\n console.log(Math.ceil(n/h));\n }else{\n console.log(Math.ceil(n/h));\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "sample_input": "3\n7\n10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02795", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have a grid with H rows and W columns, where all the squares are initially white.\n\nYou will perform some number of painting operations on the grid.\nIn one operation, you can do one of the following two actions:\n\nChoose one row, then paint all the squares in that row black.\n\nChoose one column, then paint all the squares in that column black.\n\nAt least how many operations do you need in order to have N or more black squares in the grid?\nIt is guaranteed that, under the conditions in Constraints, having N or more black squares is always possible by performing some number of operations.\n\nConstraints\n\n1 \\leq H \\leq 100\n\n1 \\leq W \\leq 100\n\n1 \\leq N \\leq H \\times W\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH\nW\nN\n\nOutput\n\nPrint the minimum number of operations needed.\n\nSample Input 1\n\n3\n7\n10\n\nSample Output 1\n\n2\n\nYou can have 14 black squares in the grid by performing the \"row\" operation twice, on different rows.\n\nSample Input 2\n\n14\n12\n112\n\nSample Output 2\n\n8\n\nSample Input 3\n\n2\n100\n200\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 283, "cpu_time_ms": 52, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s301780831", "group_id": "codeNet:p02801", "input_text": "//inputに入力データ全体が入る\nvar alphabet=\"abcdefghijklmnopqrstuvwxyz\"\nfunction Main(input) {\n var tmp=inputting(input)\n console.log(alphabet.charAt(1+alphabet.indexOf(tmp[0][0])))//標準出力\n}\nfunction inputting(input){\n //標準入力で受け取ったデータを、改行区切りでi行目、空白区切りでj番目のデータが[i][j]に格納される配列に変換する\n input = input.split(\"\\n\");\n var tmp=[]\n for(var i=0;i {\n var psArray = ps.split(/\\s/);\n psArray[0] = parseInt(psArray[0], 10);\n return psArray;\n });\n\n var ACList = new Array(N);\n ACList.fill(0);\n var WAList = new Array(N);\n WAList.fill(0);\n\n for (var i = 0; i < M; i++) {\n if (ACList[PS[i][0] - 1] === 0) {\n if (PS[i][1] === 'AC') {\n ACList[PS[i][0] - 1] = 1;\n } else {\n WAList[[PS[i][0] - 1]]++;\n }\n }\n }\n\n var AC = 0;\n var WA = 0;\n for (var i = 0; i < ACList.length; i++) {\n AC += ACList[i];\n WA += ACList[i] === 1 ? WAList[i] : 0;\n }\n\n console.log(`${AC} ${WA}`);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n/));", "language": "JavaScript", "metadata": {"date": 1578884208, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02802.html", "problem_id": "p02802", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02802/input.txt", "sample_output_relpath": "derived/input_output/data/p02802/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02802/JavaScript/s894476529.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s894476529", "user_id": "u709108999"}, "prompt_components": {"gold_output": "2 2\n", "input_to_evaluate": "function Main(input) {\n var firstLine = input[0].split(/\\s/);\n var N = parseInt(firstLine[0], 10);\n var M = parseInt(firstLine[1], 10);\n var PS = input.slice(1).map(ps => {\n var psArray = ps.split(/\\s/);\n psArray[0] = parseInt(psArray[0], 10);\n return psArray;\n });\n\n var ACList = new Array(N);\n ACList.fill(0);\n var WAList = new Array(N);\n WAList.fill(0);\n\n for (var i = 0; i < M; i++) {\n if (ACList[PS[i][0] - 1] === 0) {\n if (PS[i][1] === 'AC') {\n ACList[PS[i][0] - 1] = 1;\n } else {\n WAList[[PS[i][0] - 1]]++;\n }\n }\n }\n\n var AC = 0;\n var WA = 0;\n for (var i = 0; i < ACList.length; i++) {\n AC += ACList[i];\n WA += ACList[i] === 1 ? WAList[i] : 0;\n }\n\n console.log(`${AC} ${WA}`);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n/));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "sample_input": "2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n"}, "reference_outputs": ["2 2\n"], "source_document_id": "p02802", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi participated in a contest on AtCoder.\n\nThe contest had N problems.\n\nTakahashi made M submissions during the contest.\n\nThe i-th submission was made for the p_i-th problem and received the verdict S_i (AC or WA).\n\nThe number of Takahashi's correct answers is the number of problems on which he received an AC once or more.\n\nThe number of Takahashi's penalties is the sum of the following count for the problems on which he received an AC once or more: the number of WAs received before receiving an AC for the first time on that problem.\n\nFind the numbers of Takahashi's correct answers and penalties.\n\nConstraints\n\nN, M, and p_i are integers.\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq 10^5\n\n1 \\leq p_i \\leq N\n\nS_i is AC or WA.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\np_1 S_1\n:\np_M S_M\n\nOutput\n\nPrint the number of Takahashi's correct answers and the number of Takahashi's penalties.\n\nSample Input 1\n\n2 5\n1 WA\n1 AC\n2 WA\n2 AC\n2 WA\n\nSample Output 1\n\n2 2\n\nIn his second submission, he received an AC on the first problem for the first time. Before this, he received one WA on this problem.\n\nIn his fourth submission, he received an AC on the second problem for the first time. Before this, he received one WA on this problem.\n\nThus, he has two correct answers and two penalties.\n\nSample Input 2\n\n100000 3\n7777 AC\n7777 AC\n7777 AC\n\nSample Output 2\n\n1 0\n\nNote that it is pointless to get an AC more than once on the same problem.\n\nSample Input 3\n\n6 0\n\nSample Output 3\n\n0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 921, "cpu_time_ms": 341, "memory_kb": 62664}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s447119825", "group_id": "codeNet:p02803", "input_text": "Main(myin());\nfunction myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim();}\nfunction myout(t){console.log(t);}//standard output\nfunction myerr(t){console.error(t);}//standard error\n//[no]param\n//不明値:何もしない 1:数値へ変換 2:半角SPで分割 3:改行で分割 4:半角SPで分割し、数値配列へ\n//5:改行で分割し、数値配列へ 6:1文字に分割 7:1文字に分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 3:return i.split(\"\\n\");case 4:return i.split(\" \").map((a)=>Number(a));case 5:return i.split(\"\\n\").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}\nfunction Main(input) {\n input = myconv(input,3);\n var H = myconv(input[0],4)[0];\n var W = myconv(input[0],4)[1];\n input.shift();\n var output = 0;\n for(var i = 0; i < H; i++){\n for(var j = 0; j < W; j++){\n var tmp = myconv(input[i],6);\n if(tmp[j] == \".\"){\n for(var k = 0; k < H; k++){\n for(var l = 0; l < W; l++){\n var tmp2 = myconv(input[k],6);\n if(i == k && j == l){\n continue;\n }\n if(tmp2[l] == \".\"){\n //ここでij地をスタート、kl地をゴールとしてtestに放り込む。\n //その時の距離をoutputに投げる\n //myout(test(i+1,j+1,k+1,l+1));\n output = Math.max(output,test(i,j,k,l));\n }\n }\n }\n }\n }\n }\n //test(1,1,3,4)\n myout(output);\n \n function test(sy, sx, gy, gx) {\n var count = 0;\n var r, c, sy, sx, gy, gx,q;\n r = H;\n c = W;\n var maze = input;\n var ds = [0, 1, 0, -1, 0];\n var queue = [[0, sy, sx]];\n var visited = new Array(r * c); // \n for(var i=0;iNumber(a));case 5:return i.split(\"\\n\").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}\nfunction Main(input) {\n input = myconv(input,3);\n var H = myconv(input[0],4)[0];\n var W = myconv(input[0],4)[1];\n input.shift();\n var output = 0;\n for(var i = 0; i < H; i++){\n for(var j = 0; j < W; j++){\n var tmp = myconv(input[i],6);\n if(tmp[j] == \".\"){\n for(var k = 0; k < H; k++){\n for(var l = 0; l < W; l++){\n var tmp2 = myconv(input[k],6);\n if(i == k && j == l){\n continue;\n }\n if(tmp2[l] == \".\"){\n //ここでij地をスタート、kl地をゴールとしてtestに放り込む。\n //その時の距離をoutputに投げる\n //myout(test(i+1,j+1,k+1,l+1));\n output = Math.max(output,test(i,j,k,l));\n }\n }\n }\n }\n }\n }\n //test(1,1,3,4)\n myout(output);\n \n function test(sy, sx, gy, gx) {\n var count = 0;\n var r, c, sy, sx, gy, gx,q;\n r = H;\n c = W;\n var maze = input;\n var ds = [0, 1, 0, -1, 0];\n var queue = [[0, sy, sx]];\n var visited = new Array(r * c); // \n for(var i=0;i b - a)\n var a = _a.filter(function (x, i, self) {\n return self.indexOf(x) === i;\n });\n var base = a.shift()\n var records = []\n var ans = 0\n for (var p = 1; ; p++) {\n var x = base * (p + 0.5)\n if (x > m) {\n break\n }\n var has_error = false\n for (var i = 0; i < a.length; i++) {\n var _p = x / a[i] - 0.5\n if (! Number.isInteger(_p)) {\n has_error = true\n break\n }\n }\n if (!has_error) {\n ans++\n }\n }\n console.log(ans)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n\n", "language": "JavaScript", "metadata": {"date": 1578712755, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02814.html", "problem_id": "p02814", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02814/input.txt", "sample_output_relpath": "derived/input_output/data/p02814/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02814/JavaScript/s152477804.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s152477804", "user_id": "u063969814"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\"\nfunction main(arg) {\n var data = arg.trim().split(\"\\n\")\n var m = data[0].split(\" \").map(Number)[1]\n var _a = data[1].split(\" \").map(Number).sort((a,b) => b - a)\n var a = _a.filter(function (x, i, self) {\n return self.indexOf(x) === i;\n });\n var base = a.shift()\n var records = []\n var ans = 0\n for (var p = 1; ; p++) {\n var x = base * (p + 0.5)\n if (x > m) {\n break\n }\n var has_error = false\n for (var i = 0; i < a.length; i++) {\n var _p = x / a[i] - 0.5\n if (! Number.isInteger(_p)) {\n has_error = true\n break\n }\n }\n if (!has_error) {\n ans++\n }\n }\n console.log(ans)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "sample_input": "2 50\n6 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02814", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven are a sequence A= {a_1,a_2,......a_N} of N positive even numbers, and an integer M.\n\nLet a semi-common multiple of A be a positive integer X that satisfies the following condition for every k (1 \\leq k \\leq N):\n\nThere exists a non-negative integer p such that X= a_k \\times (p+0.5).\n\nFind the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\n2 \\leq a_i \\leq 10^9\n\na_i is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 a_2 ... a_N\n\nOutput\n\nPrint the number of semi-common multiples of A among the integers between 1 and M (inclusive).\n\nSample Input 1\n\n2 50\n6 10\n\nSample Output 1\n\n2\n\n15 = 6 \\times 2.5\n\n15 = 10 \\times 1.5\n\n45 = 6 \\times 7.5\n\n45 = 10 \\times 4.5\n\nThus, 15 and 45 are semi-common multiples of A. There are no other semi-common multiples of A between 1 and 50, so the answer is 2.\n\nSample Input 2\n\n3 100\n14 22 40\n\nSample Output 2\n\n0\n\nThe answer can be 0.\n\nSample Input 3\n\n5 1000000000\n6 6 2 6 2\n\nSample Output 3\n\n166666667", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 821, "cpu_time_ms": 2109, "memory_kb": 30628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s000341785", "group_id": "codeNet:p02817", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = [];\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nreader.on('line', (line) => {\n lines.push(line);\n});\nreader.on('close', () => {\n var ary = lines[0].split(\" \");\n var ary[0] = ary[1];\n var ary[1] = ary[0];\n var str = ary.join(\"\");\n console.log(str);\n});", "language": "JavaScript", "metadata": {"date": 1577708224, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02817.html", "problem_id": "p02817", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02817/input.txt", "sample_output_relpath": "derived/input_output/data/p02817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02817/JavaScript/s000341785.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s000341785", "user_id": "u262466216"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = [];\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nreader.on('line', (line) => {\n lines.push(line);\n});\nreader.on('close', () => {\n var ary = lines[0].split(\" \");\n var ary[0] = ary[1];\n var ary[1] = ary[0];\n var str = ary.join(\"\");\n console.log(str);\n});", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 389, "cpu_time_ms": 199, "memory_kb": 20936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s411370813", "group_id": "codeNet:p02817", "input_text": "'use strict';\nconst main = input => {\n const str = input[0].split(' ');\n let s = str[0], t = str[1];\n console.log(t+s);\n \n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split('\\n'));", "language": "JavaScript", "metadata": {"date": 1577668521, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02817.html", "problem_id": "p02817", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02817/input.txt", "sample_output_relpath": "derived/input_output/data/p02817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02817/JavaScript/s411370813.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s411370813", "user_id": "u415865011"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "'use strict';\nconst main = input => {\n const str = input[0].split(' ');\n let s = str[0], t = str[1];\n console.log(t+s);\n \n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split('\\n'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 195, "cpu_time_ms": 204, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s391832374", "group_id": "codeNet:p02817", "input_text": "'use strict'\n\nfunction main(inp) {\n inp = inp.trim().split(' ')\n console.log(inp[1]+inp[0])\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1577667640, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02817.html", "problem_id": "p02817", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02817/input.txt", "sample_output_relpath": "derived/input_output/data/p02817/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02817/JavaScript/s391832374.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s391832374", "user_id": "u621374656"}, "prompt_components": {"gold_output": "atcoder\n", "input_to_evaluate": "'use strict'\n\nfunction main(inp) {\n inp = inp.trim().split(' ')\n console.log(inp[1]+inp[0])\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "sample_input": "oder atc\n"}, "reference_outputs": ["atcoder\n"], "source_document_id": "p02817", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are two strings S and T consisting of lowercase English letters. Concatenate T and S in this order, without space in between, and print the resulting string.\n\nConstraints\n\nS and T are strings consisting of lowercase English letters.\n\nThe lengths of S and T are between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS T\n\nOutput\n\nPrint the resulting string.\n\nSample Input 1\n\noder atc\n\nSample Output 1\n\natcoder\n\nWhen S = oder and T = atc, concatenating T and S in this order results in atcoder.\n\nSample Input 2\n\nhumu humu\n\nSample Output 2\n\nhumuhumu", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 152, "cpu_time_ms": 316, "memory_kb": 22964}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s840448561", "group_id": "codeNet:p02818", "input_text": "'use strict';\nfunction Main(inputs) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n const input = inputs.split(\"\\n\");\n const a = Number(input[0].split(' ')[0]);\n const b = Number(input[0].split(' ')[1]);\n const k = Number(input[0].split(' ')[2]);\n\n console.log((a > k ? a - k : 0), (a + b > k ? a + b - k : 0));\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1578696735, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/JavaScript/s840448561.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s840448561", "user_id": "u203527087"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "'use strict';\nfunction Main(inputs) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n const input = inputs.split(\"\\n\");\n const a = Number(input[0].split(' ')[0]);\n const b = Number(input[0].split(' ')[1]);\n const k = Number(input[0].split(' ')[2]);\n\n console.log((a > k ? a - k : 0), (a + b > k ? a + b - k : 0));\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 516, "cpu_time_ms": 53, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s147609441", "group_id": "codeNet:p02818", "input_text": "\"use strict\";\nfunction Main(input) {\n const args = input.trim().split(' ').map(Number);\n const r1 = Math.max(args[0] - args[2], 0);\n const r2 = args[0] + args[1] - args[2] - r1;\n console.log('%s %s', r1, r2);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1577770840, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/JavaScript/s147609441.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s147609441", "user_id": "u649769812"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "\"use strict\";\nfunction Main(input) {\n const args = input.trim().split(' ').map(Number);\n const r1 = Math.max(args[0] - args[2], 0);\n const r2 = args[0] + args[1] - args[2] - r1;\n console.log('%s %s', r1, r2);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 278, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s203939820", "group_id": "codeNet:p02818", "input_text": "'use strict'\n\nfunction main(inp) {\n inp = inp.trim().split(' ').map(n => Number(n));\n if (inp[0] > inp[2]) {\n inp[0] = inp[0] - inp[2]\n inp[2] = 0\n } else {\n inp[2] = inp[2] - inp[0]\n inp[0] = 0\n inp[1] = inp[1] > inp[2] ? inp[1] - inp[2] : 0\n }\n\n console.log(inp[0] + ' ' + inp[1])\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1577667892, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02818.html", "problem_id": "p02818", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02818/input.txt", "sample_output_relpath": "derived/input_output/data/p02818/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02818/JavaScript/s203939820.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s203939820", "user_id": "u621374656"}, "prompt_components": {"gold_output": "0 2\n", "input_to_evaluate": "'use strict'\n\nfunction main(inp) {\n inp = inp.trim().split(' ').map(n => Number(n));\n if (inp[0] > inp[2]) {\n inp[0] = inp[0] - inp[2]\n inp[2] = 0\n } else {\n inp[2] = inp[2] - inp[0]\n inp[0] = 0\n inp[1] = inp[1] > inp[2] ? inp[1] - inp[2] : 0\n }\n\n console.log(inp[0] + ' ' + inp[1])\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "sample_input": "2 3 3\n"}, "reference_outputs": ["0 2\n"], "source_document_id": "p02818", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A cookies, and Aoki has B cookies.\nTakahashi will do the following action K times:\n\nIf Takahashi has one or more cookies, eat one of his cookies.\n\nOtherwise, if Aoki has one or more cookies, eat one of Aoki's cookies.\n\nIf they both have no cookies, do nothing.\n\nIn the end, how many cookies will Takahashi and Aoki have, respectively?\n\nConstraints\n\n0 \\leq A \\leq 10^{12}\n\n0 \\leq B \\leq 10^{12}\n\n0 \\leq K \\leq 10^{12}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the numbers of Takahashi's and Aoki's cookies after K actions.\n\nSample Input 1\n\n2 3 3\n\nSample Output 1\n\n0 2\n\nTakahashi will do the following:\n\nHe has two cookies, so he eats one of them.\n\nNow he has one cookie left, and he eats it.\n\nNow he has no cookies left, but Aoki has three, so Takahashi eats one of them.\n\nThus, in the end, Takahashi will have 0 cookies, and Aoki will have 2.\n\nSample Input 2\n\n500000000000 500000000000 1000000000000\n\nSample Output 2\n\n0 0\n\nWatch out for overflows.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 361, "cpu_time_ms": 182, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s582345791", "group_id": "codeNet:p02819", "input_text": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = nextInt();\n while(!isPrime(N)){\n N++;\n }\n myout(N);\n}\nfunction isPrime(val){\n if(val == null || val <= 1 || (val != 2 && val % 2 == 0)){\n return false;\n }else if(val == 2){\n return true;\n }\n var root = Math.floor(Math.sqrt(val));\n for(var i = 3; i <= root; i += 2){\n if(val % i == 0){\n return false;\n }\n }\n return true;\n}\n", "language": "JavaScript", "metadata": {"date": 1583448094, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02819.html", "problem_id": "p02819", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02819/input.txt", "sample_output_relpath": "derived/input_output/data/p02819/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02819/JavaScript/s582345791.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s582345791", "user_id": "u222822036"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = nextInt();\n while(!isPrime(N)){\n N++;\n }\n myout(N);\n}\nfunction isPrime(val){\n if(val == null || val <= 1 || (val != 2 && val % 2 == 0)){\n return false;\n }else if(val == 2){\n return true;\n }\n var root = Math.floor(Math.sqrt(val));\n for(var i = 3; i <= root; i += 2){\n if(val % i == 0){\n return false;\n }\n }\n return true;\n}\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1865, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s763719821", "group_id": "codeNet:p02819", "input_text": "/**\n * @param input number\n */\nfunction Main(input) {\n // 偶数のみで検証するため2は含まない\n const prevPrimes = [];\n\n if (num === 2) {\n console.log(2);\n return;\n }\n\n var num;\n const sqrt = Math.sqrt(input);\n for (num = 3; num <= sqrt; num += 2) {\n if (isPrime(num, prevPrimes)) {\n prevPrimes.push(num);\n }\n }\n for (; true; num += 2) {\n if (isPrime(num, prevPrimes)) {\n break;\n }\n }\n\n console.log(prevPrimes);\n\n console.log(num);\n}\n\nfunction isPrime(num, prevPrimes) {\n return prevPrimes.every((prime) => num % prime);\n}\n\nMain(+require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "language": "JavaScript", "metadata": {"date": 1577673491, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02819.html", "problem_id": "p02819", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02819/input.txt", "sample_output_relpath": "derived/input_output/data/p02819/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02819/JavaScript/s763719821.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s763719821", "user_id": "u687533220"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "/**\n * @param input number\n */\nfunction Main(input) {\n // 偶数のみで検証するため2は含まない\n const prevPrimes = [];\n\n if (num === 2) {\n console.log(2);\n return;\n }\n\n var num;\n const sqrt = Math.sqrt(input);\n for (num = 3; num <= sqrt; num += 2) {\n if (isPrime(num, prevPrimes)) {\n prevPrimes.push(num);\n }\n }\n for (; true; num += 2) {\n if (isPrime(num, prevPrimes)) {\n break;\n }\n }\n\n console.log(prevPrimes);\n\n console.log(num);\n}\n\nfunction isPrime(num, prevPrimes) {\n return prevPrimes.every((prime) => num % prime);\n}\n\nMain(+require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());", "problem_context": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "sample_input": "20\n"}, "reference_outputs": ["23\n"], "source_document_id": "p02819", "source_text": "Score: 300 points\n\nProblem Statement\n\nFind the minimum prime number greater than or equal to X.\n\nNotes\n\nA prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself.\n\nFor example, 2, 3, and 5 are prime numbers, while 4 and 6 are not.\n\nConstraints\n\n2 \\le X \\le 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nPrint the minimum prime number greater than or equal to X.\n\nSample Input 1\n\n20\n\nSample Output 1\n\n23\n\nThe minimum prime number greater than or equal to 20 is 23.\n\nSample Input 2\n\n2\n\nSample Output 2\n\n2\n\nX itself can be a prime number.\n\nSample Input 3\n\n99992\n\nSample Output 3\n\n100003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 641, "cpu_time_ms": 58, "memory_kb": 7884}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s331033152", "group_id": "codeNet:p02824", "input_text": "/**\n * @param input string[]\n */\nfunction Main(input) {\n /** @type number[] */\n const input0Numbered = input[0].split(' ').map(Number);\n const N = input0Numbered[0];\n const M = input0Numbered[1];\n const V = input0Numbered[2];\n const P = input0Numbered[3];\n /**\n * 昇順ソートしたもの\n * @type number[]\n */\n const alist = input[1].split(' ').map(Number).sort((v1, v2) => v1 - v2);\n\n /**\n * まず、昇順ソート\n * 1. 配列の最小数Kの重複分を配列から抜いて投票可能数もその分減らす\n * 2. 投票数 -= 1 ... Kに全票を入れるため\n * 3. KにM票入れた結果K2より少ない数がK以降にあれば、その差を抜いていく。その合計がMになったらv-=1これを繰り返し、余った分をRとする\n * 4. 配列の最後からv番目の数にM-Rを足した数がK2以下であれば5へ、それ以外は配列からKを抜いて1に戻る\n * 5. P位以内になれるものが見つかったら、それより少ない数を引いた問題数が結果となる\n */\n\n v = V;\n var ai, ai2, aj, r, j, reducedV, max = null;\n // 選ばれるための最小スコアを検索\n for (var i = 0; i < alist.length; i++) {\n // この問題と同等のスコアのものに投票していく\n while (alist[i] === alist[i + 1]) {\n i++;\n v--;\n }\n v--;\n // この問題の点数\n ai = alist[i];\n // この問題の最大点数\n ai2 = ai + M;\n\n r = 0;\n // aiより大きいもののうち、ai2より小さいものに順に投票していく\n for (j = i + 1; alist[j] < k2; j++) {\n r += k2 - alist[j];\n }\n reducedV = Math.floor(r / M);\n r = r % M;\n\n if (v <= reducedV) {\n // この時点ですべて投票済みならすべてにおいて最大となるため終了\n max = ai;\n break;\n }\n\n // この時点で v < alist.length - (i + 1)\n\n // 残りはすべてスコアが大きい順に投票\n voteds = alist.slice(-(v - reducedV)).map((aj) => aj + M);\n // 部分的に投票済みならそのうち最も少ない数から引いていく\n if (r > 0) {\n for (j = 0; j < voteds.length; j++) {\n aj = voteds[j];\n // ai2より少なくなる場合、同じ数になるまで引く\n if (aj - r < ai2) {\n voteds[j] = ai2;\n r -= aj - ai2;\n } else {\n voteds[j] -= r;\n r = 0;\n break;\n }\n }\n\n if (r > 0) {\n voteds[voteds.length - 1] -= r;\n }\n }\n\n for (k = 0; k < P; k++) {\n cmp = (k < veteds.length)\n ? veteds[veteds.length - k - 1]\n : alist[alist.length - k - 1];\n\n if (ai2 >= cmp) {\n max = ai;\n break;\n }\n }\n if (max) {\n break;\n }\n }\n\n // 最小値のインデックに戻す\n for (; i > 0; i--) {\n if (alist[i] !== alist[i - 1]) {\n break;\n }\n }\n\n answer = alist.length - i;\n\n console.log(answer);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\"));", "language": "JavaScript", "metadata": {"date": 1577593770, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02824.html", "problem_id": "p02824", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02824/input.txt", "sample_output_relpath": "derived/input_output/data/p02824/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02824/JavaScript/s331033152.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s331033152", "user_id": "u687533220"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "/**\n * @param input string[]\n */\nfunction Main(input) {\n /** @type number[] */\n const input0Numbered = input[0].split(' ').map(Number);\n const N = input0Numbered[0];\n const M = input0Numbered[1];\n const V = input0Numbered[2];\n const P = input0Numbered[3];\n /**\n * 昇順ソートしたもの\n * @type number[]\n */\n const alist = input[1].split(' ').map(Number).sort((v1, v2) => v1 - v2);\n\n /**\n * まず、昇順ソート\n * 1. 配列の最小数Kの重複分を配列から抜いて投票可能数もその分減らす\n * 2. 投票数 -= 1 ... Kに全票を入れるため\n * 3. KにM票入れた結果K2より少ない数がK以降にあれば、その差を抜いていく。その合計がMになったらv-=1これを繰り返し、余った分をRとする\n * 4. 配列の最後からv番目の数にM-Rを足した数がK2以下であれば5へ、それ以外は配列からKを抜いて1に戻る\n * 5. P位以内になれるものが見つかったら、それより少ない数を引いた問題数が結果となる\n */\n\n v = V;\n var ai, ai2, aj, r, j, reducedV, max = null;\n // 選ばれるための最小スコアを検索\n for (var i = 0; i < alist.length; i++) {\n // この問題と同等のスコアのものに投票していく\n while (alist[i] === alist[i + 1]) {\n i++;\n v--;\n }\n v--;\n // この問題の点数\n ai = alist[i];\n // この問題の最大点数\n ai2 = ai + M;\n\n r = 0;\n // aiより大きいもののうち、ai2より小さいものに順に投票していく\n for (j = i + 1; alist[j] < k2; j++) {\n r += k2 - alist[j];\n }\n reducedV = Math.floor(r / M);\n r = r % M;\n\n if (v <= reducedV) {\n // この時点ですべて投票済みならすべてにおいて最大となるため終了\n max = ai;\n break;\n }\n\n // この時点で v < alist.length - (i + 1)\n\n // 残りはすべてスコアが大きい順に投票\n voteds = alist.slice(-(v - reducedV)).map((aj) => aj + M);\n // 部分的に投票済みならそのうち最も少ない数から引いていく\n if (r > 0) {\n for (j = 0; j < voteds.length; j++) {\n aj = voteds[j];\n // ai2より少なくなる場合、同じ数になるまで引く\n if (aj - r < ai2) {\n voteds[j] = ai2;\n r -= aj - ai2;\n } else {\n voteds[j] -= r;\n r = 0;\n break;\n }\n }\n\n if (r > 0) {\n voteds[voteds.length - 1] -= r;\n }\n }\n\n for (k = 0; k < P; k++) {\n cmp = (k < veteds.length)\n ? veteds[veteds.length - k - 1]\n : alist[alist.length - k - 1];\n\n if (ai2 >= cmp) {\n max = ai;\n break;\n }\n }\n if (max) {\n break;\n }\n }\n\n // 最小値のインデックに戻す\n for (; i > 0; i--) {\n if (alist[i] !== alist[i - 1]) {\n break;\n }\n }\n\n answer = alist.length - i;\n\n console.log(answer);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\"));", "problem_context": "Score : 700 points\n\nProblem Statement\n\nN problems are proposed for an upcoming contest. Problem i has an initial integer score of A_i points.\n\nM judges are about to vote for problems they like. Each judge will choose exactly V problems, independently from the other judges,\nand increase the score of each chosen problem by 1.\n\nAfter all M judges cast their vote, the problems will be sorted in non-increasing order of score, and the first P problems will be chosen for the problemset.\nProblems with the same score can be ordered arbitrarily, this order is decided by the chief judge.\n\nHow many problems out of the given N have a chance to be chosen for the problemset?\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le M \\le 10^9\n\n1 \\le V \\le N - 1\n\n1 \\le P \\le N - 1\n\n0 \\le A_i \\le 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M V P\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of problems that have a chance to be chosen for the problemset.\n\nSample Input 1\n\n6 1 2 2\n2 1 1 3 0 2\n\nSample Output 1\n\n5\n\nIf the only judge votes for problems 2 and 5, the scores will be 2 2 1 3 1 2.\nThe problemset will consist of problem 4 and one of problems 1, 2, or 6.\n\nIf the only judge votes for problems 3 and 4, the scores will be 2 1 2 4 0 2.\nThe problemset will consist of problem 4 and one of problems 1, 3, or 6.\n\nThus, problems 1, 2, 3, 4, and 6 have a chance to be chosen for the problemset. On the contrary, there is no way for problem 5 to be chosen.\n\nSample Input 2\n\n6 1 5 2\n2 1 1 3 0 2\n\nSample Output 2\n\n3\n\nOnly problems 1, 4, and 6 have a chance to be chosen.\n\nSample Input 3\n\n10 4 8 5\n7 2 3 6 1 6 5 4 6 5\n\nSample Output 3\n\n8", "sample_input": "6 1 2 2\n2 1 1 3 0 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02824", "source_text": "Score : 700 points\n\nProblem Statement\n\nN problems are proposed for an upcoming contest. Problem i has an initial integer score of A_i points.\n\nM judges are about to vote for problems they like. Each judge will choose exactly V problems, independently from the other judges,\nand increase the score of each chosen problem by 1.\n\nAfter all M judges cast their vote, the problems will be sorted in non-increasing order of score, and the first P problems will be chosen for the problemset.\nProblems with the same score can be ordered arbitrarily, this order is decided by the chief judge.\n\nHow many problems out of the given N have a chance to be chosen for the problemset?\n\nConstraints\n\n2 \\le N \\le 10^5\n\n1 \\le M \\le 10^9\n\n1 \\le V \\le N - 1\n\n1 \\le P \\le N - 1\n\n0 \\le A_i \\le 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M V P\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the number of problems that have a chance to be chosen for the problemset.\n\nSample Input 1\n\n6 1 2 2\n2 1 1 3 0 2\n\nSample Output 1\n\n5\n\nIf the only judge votes for problems 2 and 5, the scores will be 2 2 1 3 1 2.\nThe problemset will consist of problem 4 and one of problems 1, 2, or 6.\n\nIf the only judge votes for problems 3 and 4, the scores will be 2 1 2 4 0 2.\nThe problemset will consist of problem 4 and one of problems 1, 3, or 6.\n\nThus, problems 1, 2, 3, 4, and 6 have a chance to be chosen for the problemset. On the contrary, there is no way for problem 5 to be chosen.\n\nSample Input 2\n\n6 1 5 2\n2 1 1 3 0 2\n\nSample Output 2\n\n3\n\nOnly problems 1, 4, and 6 have a chance to be chosen.\n\nSample Input 3\n\n10 4 8 5\n7 2 3 6 1 6 5 4 6 5\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3031, "cpu_time_ms": 121, "memory_kb": 28504}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s714671392", "group_id": "codeNet:p02829", "input_text": "var a = prompt(\"Number A?\")\nvar b = prompt(\"Number B?\")\n\nconsole.log(6-a-b)", "language": "JavaScript", "metadata": {"date": 1593440454, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02829.html", "problem_id": "p02829", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02829/input.txt", "sample_output_relpath": "derived/input_output/data/p02829/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02829/JavaScript/s714671392.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s714671392", "user_id": "u557992810"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "var a = prompt(\"Number A?\")\nvar b = prompt(\"Number B?\")\n\nconsole.log(6-a-b)", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "sample_input": "3\n1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02829", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 75, "cpu_time_ms": 53, "memory_kb": 29760}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s196551022", "group_id": "codeNet:p02829", "input_text": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n \nfunction print(x) {\n console.log(x);\n}\n \nlet inputString = \"\";\nlet currentLine = 0;\n \nprocess.stdin.on(\"data\", inputStdin => {\n inputString += inputStdin;\n});\nprocess.stdin.on(\"end\", () => {\n inputString = inputString.split(\"\\n\");\n main();\n});\nfunction readline() {\n return inputString[currentLine++];\n}\n \n// ************************ Ignore above this Line ******************************\n// **************************** Main Code Start *********************************\n \nfunction main() {\n \n var ar = readline().split(\" \").map(x => parseInt(x));\n var a = ar[0],b = ar[1];\n if (a == 1 && b == 2) print('3');\n else if (a == 2 && b == 3) print('1');\n else if (a == 3 && b == 1) print('2');\n}", "language": "JavaScript", "metadata": {"date": 1577070460, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02829.html", "problem_id": "p02829", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02829/input.txt", "sample_output_relpath": "derived/input_output/data/p02829/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02829/JavaScript/s196551022.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s196551022", "user_id": "u972726147"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf-8\");\n \nfunction print(x) {\n console.log(x);\n}\n \nlet inputString = \"\";\nlet currentLine = 0;\n \nprocess.stdin.on(\"data\", inputStdin => {\n inputString += inputStdin;\n});\nprocess.stdin.on(\"end\", () => {\n inputString = inputString.split(\"\\n\");\n main();\n});\nfunction readline() {\n return inputString[currentLine++];\n}\n \n// ************************ Ignore above this Line ******************************\n// **************************** Main Code Start *********************************\n \nfunction main() {\n \n var ar = readline().split(\" \").map(x => parseInt(x));\n var a = ar[0],b = ar[1];\n if (a == 1 && b == 2) print('3');\n else if (a == 2 && b == 3) print('1');\n else if (a == 3 && b == 1) print('2');\n}", "problem_context": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "sample_input": "3\n1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02829", "source_text": "Score: 100 points\n\nProblem Statement\n\nTakahashi is solving quizzes. He has easily solved all but the last one.\n\nThe last quiz has three choices: 1, 2, and 3.\n\nWith his supernatural power, Takahashi has found out that the choices A and B are both wrong.\n\nPrint the correct choice for this problem.\n\nConstraints\n\nEach of the numbers A and B is 1, 2, or 3.\n\nA and B are different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\n\nOutput\n\nPrint the correct choice.\n\nSample Input 1\n\n3\n1\n\nSample Output 1\n\n2\n\nWhen we know 3 and 1 are both wrong, the correct choice is 2.\n\nSample Input 2\n\n1\n2\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 776, "cpu_time_ms": 54, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s830357444", "group_id": "codeNet:p02830", "input_text": "function Main(input) {\n const N = input[0]\n const rest = input.trim().split('\\n').slice(1).join()\n const array = rest.split(' ')\n const S = array[0]\n const T = array[1]\n let ans = ''\n for(let i = 0; i < N; ++i) {\n ans += S[i]\n ans += T[i]\n }\n\n console.log(ans)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1577606280, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02830/input.txt", "sample_output_relpath": "derived/input_output/data/p02830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02830/JavaScript/s830357444.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s830357444", "user_id": "u177274511"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "function Main(input) {\n const N = input[0]\n const rest = input.trim().split('\\n').slice(1).join()\n const array = rest.split(' ')\n const S = array[0]\n const T = array[1]\n let ans = ''\n for(let i = 0; i < N; ++i) {\n ans += S[i]\n ans += T[i]\n }\n\n console.log(ans)\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "sample_input": "2\nip cc\n"}, "reference_outputs": ["icpc\n"], "source_document_id": "p02830", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 56, "memory_kb": 7756}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s472285826", "group_id": "codeNet:p02830", "input_text": "function main(input) {\n var arr1 = input.split('\\n')\n var n = arr1[0]\n var arr2 = arr1[1].split(' ')\n var s = arr2[0]\n var t = arr2[1]\n \n var acc = ''\n for(var i = 0; i < n; i++){\n acc += s[i]\n acc += t[i]\n }\n console.log(acc)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1577066747, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02830.html", "problem_id": "p02830", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02830/input.txt", "sample_output_relpath": "derived/input_output/data/p02830/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02830/JavaScript/s472285826.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s472285826", "user_id": "u783149039"}, "prompt_components": {"gold_output": "icpc\n", "input_to_evaluate": "function main(input) {\n var arr1 = input.split('\\n')\n var n = arr1[0]\n var arr2 = arr1[1].split(' ')\n var s = arr2[0]\n var t = arr2[1]\n \n var acc = ''\n for(var i = 0; i < n; i++){\n acc += s[i]\n acc += t[i]\n }\n console.log(acc)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "sample_input": "2\nip cc\n"}, "reference_outputs": ["icpc\n"], "source_document_id": "p02830", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are strings s and t of length N each, both consisting of lowercase English letters.\n\nLet us form a new string by alternating the characters of S and the characters of T, as follows: the first character of S, the first character of T, the second character of S, the second character of T, ..., the N-th character of S, the N-th character of T. Print this new string.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|S| = |T| = N\n\nS and T are strings consisting of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS T\n\nOutput\n\nPrint the string formed.\n\nSample Input 1\n\n2\nip cc\n\nSample Output 1\n\nicpc\n\nSample Input 2\n\n8\nhmhmnknk uuuuuuuu\n\nSample Output 2\n\nhumuhumunukunuku\n\nSample Input 3\n\n5\naaaaa aaaaa\n\nSample Output 3\n\naaaaaaaaaa", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 328, "cpu_time_ms": 205, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s403724471", "group_id": "codeNet:p02831", "input_text": "function min(A,B){\ni=1\n while(i>0)\n i++;\n if(i%A==0)\n {\n \tif(i%B==0)\n break;\n }\n \n return i;\n}", "language": "JavaScript", "metadata": {"date": 1577478852, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02831.html", "problem_id": "p02831", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02831/input.txt", "sample_output_relpath": "derived/input_output/data/p02831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02831/JavaScript/s403724471.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s403724471", "user_id": "u631998785"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function min(A,B){\ni=1\n while(i>0)\n i++;\n if(i%A==0)\n {\n \tif(i%B==0)\n break;\n }\n \n return i;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 109, "cpu_time_ms": 232, "memory_kb": 20936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s950634572", "group_id": "codeNet:p02831", "input_text": "function gcd(m, n) {\n // 剰余\n var r;\n\n if(m < n) { // m >= nにする\n r = m; //一時退避\n m = n;\n n = r;\n }\n\n while ((r = m % n) != 0) {\n m = n;\n n = r;\n }\n\n return n;\n}\nfunction Main(input){\n\tvar a = parseInt(input[0],10);\n \tvar b = parseInt(input[1],10);\n console.log('%d',a * b / gcd(a, b));\n}\n", "language": "JavaScript", "metadata": {"date": 1577072250, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02831.html", "problem_id": "p02831", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02831/input.txt", "sample_output_relpath": "derived/input_output/data/p02831/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02831/JavaScript/s950634572.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s950634572", "user_id": "u982749462"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function gcd(m, n) {\n // 剰余\n var r;\n\n if(m < n) { // m >= nにする\n r = m; //一時退避\n m = n;\n n = r;\n }\n\n while ((r = m % n) != 0) {\n m = n;\n n = r;\n }\n\n return n;\n}\nfunction Main(input){\n\tvar a = parseInt(input[0],10);\n \tvar b = parseInt(input[1],10);\n console.log('%d',a * b / gcd(a, b));\n}\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "sample_input": "2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02831", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is organizing a party.\n\nAt the party, each guest will receive one or more snack pieces.\n\nTakahashi predicts that the number of guests at this party will be A or B.\n\nFind the minimum number of pieces that can be evenly distributed to the guests in both of the cases predicted.\n\nWe assume that a piece cannot be divided and distributed to multiple guests.\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\nA \\neq B\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of pieces that can be evenly distributed to the guests in both of the cases with A guests and B guests.\n\nSample Input 1\n\n2 3\n\nSample Output 1\n\n6\n\nWhen we have six snack pieces, each guest can take three pieces if we have two guests, and each guest can take two if we have three guests.\n\nSample Input 2\n\n123 456\n\nSample Output 2\n\n18696\n\nSample Input 3\n\n100000 99999\n\nSample Output 3\n\n9999900000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 332, "cpu_time_ms": 51, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s130089752", "group_id": "codeNet:p02832", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n \n var n = Number(input[0]);\n var rengaArr = input[1].split(\" \");\n \n if(Math.min.apply(null,rengaArr) > 1){\n console.log(\"-1\");\n }else{\n var res = 0;\n var ord = 1;\n for(var i=0; i 1){\n console.log(\"-1\");\n }else{\n var res = 0;\n var ord = 1;\n for(var i=0; i0){\n result += checkZero(input)\n input = input -2;\n }\n console.log(result)\n \n}\n \nfunction checkZero(multi){\n var i = true;\n multi = multi.toString()\n var index=multi.toString().length-1;\n var result = 0;\n while(i){\n if(multi[index] == \"0\"){\n index--;\n result++;\n }\n else{\n i = false;\n }\n }\n return result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1577072275, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02833.html", "problem_id": "p02833", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02833/input.txt", "sample_output_relpath": "derived/input_output/data/p02833/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02833/JavaScript/s750987007.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s750987007", "user_id": "u396460578"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n input = parseInt(input);\n var result = 0;\n while(input>0){\n result += checkZero(input)\n input = input -2;\n }\n console.log(result)\n \n}\n \nfunction checkZero(multi){\n var i = true;\n multi = multi.toString()\n var index=multi.toString().length-1;\n var result = 0;\n while(i){\n if(multi[index] == \"0\"){\n index--;\n result++;\n }\n else{\n i = false;\n }\n }\n return result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "sample_input": "12\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02833", "source_text": "Score : 500 points\n\nProblem Statement\n\nFor an integer n not less than 0, let us define f(n) as follows:\n\nf(n) = 1 (if n < 2)\n\nf(n) = n f(n-2) (if n \\geq 2)\n\nGiven is an integer N. Find the number of trailing zeros in the decimal notation of f(N).\n\nConstraints\n\n0 \\leq N \\leq 10^{18}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of trailing zeros in the decimal notation of f(N).\n\nSample Input 1\n\n12\n\nSample Output 1\n\n1\n\nf(12) = 12 × 10 × 8 × 6 × 4 × 2 = 46080, which has one trailing zero.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0\n\nf(5) = 5 × 3 × 1 = 15, which has no trailing zeros.\n\nSample Input 3\n\n1000000000000000000\n\nSample Output 3\n\n124999999999999995", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 553, "cpu_time_ms": 2152, "memory_kb": 709952}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s011062152", "group_id": "codeNet:p02835", "input_text": "\"use strict\";\n\nconst main = arg => {\n const a = arg.split(\" \").map(x=>parseInt(x));\n if(a[0]+a[1]+a[2]>21){\n \tconsole.log(\"bust\");\n }\n else{\n console.log(\"win\");\n }\n return;\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "language": "JavaScript", "metadata": {"date": 1576893461, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02835/input.txt", "sample_output_relpath": "derived/input_output/data/p02835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02835/JavaScript/s011062152.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s011062152", "user_id": "u745477486"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n const a = arg.split(\" \").map(x=>parseInt(x));\n if(a[0]+a[1]+a[2]>21){\n \tconsole.log(\"bust\");\n }\n else{\n console.log(\"win\");\n }\n return;\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8')); ", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "sample_input": "5 7 9\n"}, "reference_outputs": ["win\n"], "source_document_id": "p02835", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 242, "cpu_time_ms": 54, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s095952066", "group_id": "codeNet:p02835", "input_text": "'use strict'\nfunction Main(input) {\n\n let Aset = input.split(\" \").map(v => parseInt(v));\n // console.log({ Aset });\n\n let Answer = Aset[0] + Aset[1] + Aset[2];\n // console.log({ Answer });\n console.log(Answer >= 22 ? 'bust' : 'win');\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1576032319, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02835/input.txt", "sample_output_relpath": "derived/input_output/data/p02835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02835/JavaScript/s095952066.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s095952066", "user_id": "u880930934"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "'use strict'\nfunction Main(input) {\n\n let Aset = input.split(\" \").map(v => parseInt(v));\n // console.log({ Aset });\n\n let Answer = Aset[0] + Aset[1] + Aset[2];\n // console.log({ Answer });\n console.log(Answer >= 22 ? 'bust' : 'win');\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "sample_input": "5 7 9\n"}, "reference_outputs": ["win\n"], "source_document_id": "p02835", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 298, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s674367183", "group_id": "codeNet:p02835", "input_text": "\"use strict\";\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"UTF-8\"));\n\nfunction main(input) {\n let result = 0;\n input\n .split(\"\\n\")[0]\n .split(\" \")\n .map(n => (result += Number(n)));\n if (result < 22) {\n console.log(\"win\");\n } else {\n console.log(\"bust\");\n }\n}\n", "language": "JavaScript", "metadata": {"date": 1575858461, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02835.html", "problem_id": "p02835", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02835/input.txt", "sample_output_relpath": "derived/input_output/data/p02835/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02835/JavaScript/s674367183.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s674367183", "user_id": "u846403188"}, "prompt_components": {"gold_output": "win\n", "input_to_evaluate": "\"use strict\";\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"UTF-8\"));\n\nfunction main(input) {\n let result = 0;\n input\n .split(\"\\n\")[0]\n .split(\" \")\n .map(n => (result += Number(n)));\n if (result < 22) {\n console.log(\"win\");\n } else {\n console.log(\"bust\");\n }\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "sample_input": "5 7 9\n"}, "reference_outputs": ["win\n"], "source_document_id": "p02835", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven are three integers A_1, A_2, and A_3.\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nConstraints\n\n1 \\leq A_i \\leq 13 \\ \\ (i=1,2,3)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA_1 A_2 A_3\n\nOutput\n\nIf A_1+A_2+A_3 is greater than or equal to 22, print bust; otherwise, print win.\n\nSample Input 1\n\n5 7 9\n\nSample Output 1\n\nwin\n\n5+7+9=21, so print win.\n\nSample Input 2\n\n13 7 2\n\nSample Output 2\n\nbust\n\n13+7+2=22, so print bust.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 282, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s047610486", "group_id": "codeNet:p02836", "input_text": "function Main(input) {\n var count = 0;\n var i = 0;\n \n var string = input.split('');\n \n while (i < input.length / 2) {\n var last = input.length - i - 1;\n \n if (string[i] !== string[last]) {\n count++;\n }\n i++;\n }\n \n console.log(count);\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1575859787, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/JavaScript/s047610486.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s047610486", "user_id": "u506671931"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n var count = 0;\n var i = 0;\n \n var string = input.split('');\n \n while (i < input.length / 2) {\n var last = input.length - i - 1;\n \n if (string[i] !== string[last]) {\n count++;\n }\n i++;\n }\n \n console.log(count);\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 318, "cpu_time_ms": 52, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s841975700", "group_id": "codeNet:p02836", "input_text": "function main(input){\n\n var leng = input.length;\n var count = 0;\n var count_max = leng/2;\n var out = 0 ;\n\n while(count < count_max){\n if(input[count]!=input[leng-count-1]){\n out++;\n }\n count++;\n }\n console.log(out);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1575858944, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02836.html", "problem_id": "p02836", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02836/input.txt", "sample_output_relpath": "derived/input_output/data/p02836/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02836/JavaScript/s841975700.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s841975700", "user_id": "u486205579"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function main(input){\n\n var leng = input.length;\n var count = 0;\n var count_max = leng/2;\n var out = 0 ;\n\n while(count < count_max){\n if(input[count]!=input[leng-count-1]){\n out++;\n }\n count++;\n }\n console.log(out);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "sample_input": "redcoder\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02836", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.\n\nGiven is a string S. Find the minimum number of hugs needed to make S palindromic.\n\nConstraints\n\nS is a string consisting of lowercase English letters.\n\nThe length of S is between 1 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of hugs needed to make S palindromic.\n\nSample Input 1\n\nredcoder\n\nSample Output 1\n\n1\n\nFor example, we can change the fourth character to o and get a palindrome redooder.\n\nSample Input 2\n\nvvvvvv\n\nSample Output 2\n\n0\n\nWe might need no hugs at all.\n\nSample Input 3\n\nabcdabc\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 295, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s508237877", "group_id": "codeNet:p02838", "input_text": "'use strict';\n\nlet bigInt = function (undefined) { var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), LOG_MAX_INT = Math.log(MAX_INT); function Integer(v, radix) { if (typeof v === \"undefined\") return Integer[0]; if (typeof radix !== \"undefined\") return +radix === 10 ? parseValue(v) : parseBase(v, radix); return parseValue(v) } function BigInteger(value, sign) { this.value = value; this.sign = sign; this.isSmall = false } BigInteger.prototype = Object.create(Integer.prototype); function SmallInteger(value) { this.value = value; this.sign = value < 0; this.isSmall = true } SmallInteger.prototype = Object.create(Integer.prototype); function isPrecise(n) { return -MAX_INT < n && n < MAX_INT } function smallToArray(n) { if (n < 1e7) return [n]; if (n < 1e14) return [n % 1e7, Math.floor(n / 1e7)]; return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)] } function arrayToSmall(arr) { trim(arr); var length = arr.length; if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) { switch (length) { case 0: return 0; case 1: return arr[0]; case 2: return arr[0] + arr[1] * BASE; default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE } } return arr } function trim(v) { var i = v.length; while (v[--i] === 0); v.length = i + 1 } function createArray(length) { var x = new Array(length); var i = -1; while (++i < length) { x[i] = 0 } return x } function truncate(n) { if (n > 0) return Math.floor(n); return Math.ceil(n) } function add(a, b) { var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i; for (i = 0; i < l_b; i++) { sum = a[i] + b[i] + carry; carry = sum >= base ? 1 : 0; r[i] = sum - carry * base } while (i < l_a) { sum = a[i] + carry; carry = sum === base ? 1 : 0; r[i++] = sum - carry * base } if (carry > 0) r.push(carry); return r } function addAny(a, b) { if (a.length >= b.length) return add(a, b); return add(b, a) } function addSmall(a, carry) { var l = a.length, r = new Array(l), base = BASE, sum, i; for (i = 0; i < l; i++) { sum = a[i] - base + carry; carry = Math.floor(sum / base); r[i] = sum - carry * base; carry += 1 } while (carry > 0) { r[i++] = carry % base; carry = Math.floor(carry / base) } return r } BigInteger.prototype.add = function (v) { var n = parseValue(v); if (this.sign !== n.sign) { return this.subtract(n.negate()) } var a = this.value, b = n.value; if (n.isSmall) { return new BigInteger(addSmall(a, Math.abs(b)), this.sign) } return new BigInteger(addAny(a, b), this.sign) }; BigInteger.prototype.plus = BigInteger.prototype.add; SmallInteger.prototype.add = function (v) { var n = parseValue(v); var a = this.value; if (a < 0 !== n.sign) { return this.subtract(n.negate()) } var b = n.value; if (n.isSmall) { if (isPrecise(a + b)) return new SmallInteger(a + b); b = smallToArray(Math.abs(b)) } return new BigInteger(addSmall(b, Math.abs(a)), a < 0) }; SmallInteger.prototype.plus = SmallInteger.prototype.add; function subtract(a, b) { var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i, difference; for (i = 0; i < b_l; i++) { difference = a[i] - borrow - b[i]; if (difference < 0) { difference += base; borrow = 1 } else borrow = 0; r[i] = difference } for (i = b_l; i < a_l; i++) { difference = a[i] - borrow; if (difference < 0) difference += base; else { r[i++] = difference; break } r[i] = difference } for (; i < a_l; i++) { r[i] = a[i] } trim(r); return r } function subtractAny(a, b, sign) { var value; if (compareAbs(a, b) >= 0) { value = subtract(a, b) } else { value = subtract(b, a); sign = !sign } value = arrayToSmall(value); if (typeof value === \"number\") { if (sign) value = -value; return new SmallInteger(value) } return new BigInteger(value, sign) } function subtractSmall(a, b, sign) { var l = a.length, r = new Array(l), carry = -b, base = BASE, i, difference; for (i = 0; i < l; i++) { difference = a[i] + carry; carry = Math.floor(difference / base); difference %= base; r[i] = difference < 0 ? difference + base : difference } r = arrayToSmall(r); if (typeof r === \"number\") { if (sign) r = -r; return new SmallInteger(r) } return new BigInteger(r, sign) } BigInteger.prototype.subtract = function (v) { var n = parseValue(v); if (this.sign !== n.sign) { return this.add(n.negate()) } var a = this.value, b = n.value; if (n.isSmall) return subtractSmall(a, Math.abs(b), this.sign); return subtractAny(a, b, this.sign) }; BigInteger.prototype.minus = BigInteger.prototype.subtract; SmallInteger.prototype.subtract = function (v) { var n = parseValue(v); var a = this.value; if (a < 0 !== n.sign) { return this.add(n.negate()) } var b = n.value; if (n.isSmall) { return new SmallInteger(a - b) } return subtractSmall(b, Math.abs(a), a >= 0) }; SmallInteger.prototype.minus = SmallInteger.prototype.subtract; BigInteger.prototype.negate = function () { return new BigInteger(this.value, !this.sign) }; SmallInteger.prototype.negate = function () { var sign = this.sign; var small = new SmallInteger(-this.value); small.sign = !sign; return small }; BigInteger.prototype.abs = function () { return new BigInteger(this.value, false) }; SmallInteger.prototype.abs = function () { return new SmallInteger(Math.abs(this.value)) }; function multiplyLong(a, b) { var a_l = a.length, b_l = b.length, l = a_l + b_l, r = createArray(l), base = BASE, product, carry, i, a_i, b_j; for (i = 0; i < a_l; ++i) { a_i = a[i]; for (var j = 0; j < b_l; ++j) { b_j = b[j]; product = a_i * b_j + r[i + j]; carry = Math.floor(product / base); r[i + j] = product - carry * base; r[i + j + 1] += carry } } trim(r); return r } function multiplySmall(a, b) { var l = a.length, r = new Array(l), base = BASE, carry = 0, product, i; for (i = 0; i < l; i++) { product = a[i] * b + carry; carry = Math.floor(product / base); r[i] = product - carry * base } while (carry > 0) { r[i++] = carry % base; carry = Math.floor(carry / base) } return r } function shiftLeft(x, n) { var r = []; while (n-- > 0) r.push(0); return r.concat(x) } function multiplyKaratsuba(x, y) { var n = Math.max(x.length, y.length); if (n <= 30) return multiplyLong(x, y); n = Math.ceil(n / 2); var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n); var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)); var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); trim(product); return product } function useKaratsuba(l1, l2) { return -.012 * l1 - .012 * l2 + 15e-6 * l1 * l2 > 0 } BigInteger.prototype.multiply = function (v) { var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs; if (n.isSmall) { if (b === 0) return Integer[0]; if (b === 1) return this; if (b === -1) return this.negate(); abs = Math.abs(b); if (abs < BASE) { return new BigInteger(multiplySmall(a, abs), sign) } b = smallToArray(abs) } if (useKaratsuba(a.length, b.length)) return new BigInteger(multiplyKaratsuba(a, b), sign); return new BigInteger(multiplyLong(a, b), sign) }; BigInteger.prototype.times = BigInteger.prototype.multiply; function multiplySmallAndArray(a, b, sign) { if (a < BASE) { return new BigInteger(multiplySmall(b, a), sign) } return new BigInteger(multiplyLong(b, smallToArray(a)), sign) } SmallInteger.prototype._multiplyBySmall = function (a) { if (isPrecise(a.value * this.value)) { return new SmallInteger(a.value * this.value) } return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign) }; BigInteger.prototype._multiplyBySmall = function (a) { if (a.value === 0) return Integer[0]; if (a.value === 1) return this; if (a.value === -1) return this.negate(); return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign) }; SmallInteger.prototype.multiply = function (v) { return parseValue(v)._multiplyBySmall(this) }; SmallInteger.prototype.times = SmallInteger.prototype.multiply; function square(a) { var l = a.length, r = createArray(l + l), base = BASE, product, carry, i, a_i, a_j; for (i = 0; i < l; i++) { a_i = a[i]; carry = 0 - a_i * a_i; for (var j = i; j < l; j++) { a_j = a[j]; product = 2 * (a_i * a_j) + r[i + j] + carry; carry = Math.floor(product / base); r[i + j] = product - carry * base } r[i + l] = carry } trim(r); return r } BigInteger.prototype.square = function () { return new BigInteger(square(this.value), false) }; SmallInteger.prototype.square = function () { var value = this.value * this.value; if (isPrecise(value)) return new SmallInteger(value); return new BigInteger(square(smallToArray(Math.abs(this.value))), false) }; function divMod1(a, b) { var a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length), divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda), quotientDigit, shift, carry, borrow, i, l, q; if (remainder.length <= a_l) remainder.push(0); divisor.push(0); divisorMostSignificantDigit = divisor[b_l - 1]; for (shift = a_l - b_l; shift >= 0; shift--) { quotientDigit = base - 1; if (remainder[shift + b_l] !== divisorMostSignificantDigit) { quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit) } carry = 0; borrow = 0; l = divisor.length; for (i = 0; i < l; i++) { carry += quotientDigit * divisor[i]; q = Math.floor(carry / base); borrow += remainder[shift + i] - (carry - q * base); carry = q; if (borrow < 0) { remainder[shift + i] = borrow + base; borrow = -1 } else { remainder[shift + i] = borrow; borrow = 0 } } while (borrow !== 0) { quotientDigit -= 1; carry = 0; for (i = 0; i < l; i++) { carry += remainder[shift + i] - base + divisor[i]; if (carry < 0) { remainder[shift + i] = carry + base; carry = 0 } else { remainder[shift + i] = carry; carry = 1 } } borrow += carry } result[shift] = quotientDigit } remainder = divModSmall(remainder, lambda)[0]; return [arrayToSmall(result), arrayToSmall(remainder)] } function divMod2(a, b) { var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check; while (a_l) { part.unshift(a[--a_l]); trim(part); if (compareAbs(part, b) < 0) { result.push(0); continue } xlen = part.length; highx = part[xlen - 1] * base + part[xlen - 2]; highy = b[b_l - 1] * base + b[b_l - 2]; if (xlen > b_l) { highx = (highx + 1) * base } guess = Math.ceil(highx / highy); do { check = multiplySmall(b, guess); if (compareAbs(check, part) <= 0) break; guess-- } while (guess); result.push(guess); part = subtract(part, check) } result.reverse(); return [arrayToSmall(result), arrayToSmall(part)] } function divModSmall(value, lambda) { var length = value.length, quotient = createArray(length), base = BASE, i, q, remainder, divisor; remainder = 0; for (i = length - 1; i >= 0; --i) { divisor = remainder * base + value[i]; q = truncate(divisor / lambda); remainder = divisor - q * lambda; quotient[i] = q | 0 } return [quotient, remainder | 0] } function divModAny(self, v) { var value, n = parseValue(v); var a = self.value, b = n.value; var quotient; if (b === 0) throw new Error(\"Cannot divide by zero\"); if (self.isSmall) { if (n.isSmall) { return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)] } return [Integer[0], self] } if (n.isSmall) { if (b === 1) return [self, Integer[0]]; if (b == -1) return [self.negate(), Integer[0]]; var abs = Math.abs(b); if (abs < BASE) { value = divModSmall(a, abs); quotient = arrayToSmall(value[0]); var remainder = value[1]; if (self.sign) remainder = -remainder; if (typeof quotient === \"number\") { if (self.sign !== n.sign) quotient = -quotient; return [new SmallInteger(quotient), new SmallInteger(remainder)] } return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)] } b = smallToArray(abs) } var comparison = compareAbs(a, b); if (comparison === -1) return [Integer[0], self]; if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]]; if (a.length + b.length <= 200) value = divMod1(a, b); else value = divMod2(a, b); quotient = value[0]; var qSign = self.sign !== n.sign, mod = value[1], mSign = self.sign; if (typeof quotient === \"number\") { if (qSign) quotient = -quotient; quotient = new SmallInteger(quotient) } else quotient = new BigInteger(quotient, qSign); if (typeof mod === \"number\") { if (mSign) mod = -mod; mod = new SmallInteger(mod) } else mod = new BigInteger(mod, mSign); return [quotient, mod] } BigInteger.prototype.divmod = function (v) { var result = divModAny(this, v); return { quotient: result[0], remainder: result[1] } }; SmallInteger.prototype.divmod = BigInteger.prototype.divmod; BigInteger.prototype.divide = function (v) { return divModAny(this, v)[0] }; SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide; BigInteger.prototype.mod = function (v) { return divModAny(this, v)[1] }; SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod; BigInteger.prototype.pow = function (v) { var n = parseValue(v), a = this.value, b = n.value, value, x, y; if (b === 0) return Integer[1]; if (a === 0) return Integer[0]; if (a === 1) return Integer[1]; if (a === -1) return n.isEven() ? Integer[1] : Integer[-1]; if (n.sign) { return Integer[0] } if (!n.isSmall) throw new Error(\"The exponent \" + n.toString() + \" is too large.\"); if (this.isSmall) { if (isPrecise(value = Math.pow(a, b))) return new SmallInteger(truncate(value)) } x = this; y = Integer[1]; while (true) { if (b & 1 === 1) { y = y.times(x); --b } if (b === 0) break; b /= 2; x = x.square() } return y }; SmallInteger.prototype.pow = BigInteger.prototype.pow; BigInteger.prototype.modPow = function (exp, mod) { exp = parseValue(exp); mod = parseValue(mod); if (mod.isZero()) throw new Error(\"Cannot take modPow with modulus 0\"); var r = Integer[1], base = this.mod(mod); while (exp.isPositive()) { if (base.isZero()) return Integer[0]; if (exp.isOdd()) r = r.multiply(base).mod(mod); exp = exp.divide(2); base = base.square().mod(mod) } return r }; SmallInteger.prototype.modPow = BigInteger.prototype.modPow; function compareAbs(a, b) { if (a.length !== b.length) { return a.length > b.length ? 1 : -1 } for (var i = a.length - 1; i >= 0; i--) { if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1 } return 0 } BigInteger.prototype.compareAbs = function (v) { var n = parseValue(v), a = this.value, b = n.value; if (n.isSmall) return 1; return compareAbs(a, b) }; SmallInteger.prototype.compareAbs = function (v) { var n = parseValue(v), a = Math.abs(this.value), b = n.value; if (n.isSmall) { b = Math.abs(b); return a === b ? 0 : a > b ? 1 : -1 } return -1 }; BigInteger.prototype.compare = function (v) { if (v === Infinity) { return -1 } if (v === -Infinity) { return 1 } var n = parseValue(v), a = this.value, b = n.value; if (this.sign !== n.sign) { return n.sign ? 1 : -1 } if (n.isSmall) { return this.sign ? -1 : 1 } return compareAbs(a, b) * (this.sign ? -1 : 1) }; BigInteger.prototype.compareTo = BigInteger.prototype.compare; SmallInteger.prototype.compare = function (v) { if (v === Infinity) { return -1 } if (v === -Infinity) { return 1 } var n = parseValue(v), a = this.value, b = n.value; if (n.isSmall) { return a == b ? 0 : a > b ? 1 : -1 } if (a < 0 !== n.sign) { return a < 0 ? -1 : 1 } return a < 0 ? 1 : -1 }; SmallInteger.prototype.compareTo = SmallInteger.prototype.compare; BigInteger.prototype.equals = function (v) { return this.compare(v) === 0 }; SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals; BigInteger.prototype.notEquals = function (v) { return this.compare(v) !== 0 }; SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals; BigInteger.prototype.greater = function (v) { return this.compare(v) > 0 }; SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater; BigInteger.prototype.lesser = function (v) { return this.compare(v) < 0 }; SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser; BigInteger.prototype.greaterOrEquals = function (v) { return this.compare(v) >= 0 }; SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals; BigInteger.prototype.lesserOrEquals = function (v) { return this.compare(v) <= 0 }; SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals; BigInteger.prototype.isEven = function () { return (this.value[0] & 1) === 0 }; SmallInteger.prototype.isEven = function () { return (this.value & 1) === 0 }; BigInteger.prototype.isOdd = function () { return (this.value[0] & 1) === 1 }; SmallInteger.prototype.isOdd = function () { return (this.value & 1) === 1 }; BigInteger.prototype.isPositive = function () { return !this.sign }; SmallInteger.prototype.isPositive = function () { return this.value > 0 }; BigInteger.prototype.isNegative = function () { return this.sign }; SmallInteger.prototype.isNegative = function () { return this.value < 0 }; BigInteger.prototype.isUnit = function () { return false }; SmallInteger.prototype.isUnit = function () { return Math.abs(this.value) === 1 }; BigInteger.prototype.isZero = function () { return false }; SmallInteger.prototype.isZero = function () { return this.value === 0 }; BigInteger.prototype.isDivisibleBy = function (v) { var n = parseValue(v); var value = n.value; if (value === 0) return false; if (value === 1) return true; if (value === 2) return this.isEven(); return this.mod(n).equals(Integer[0]) }; SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy; function isBasicPrime(v) { var n = v.abs(); if (n.isUnit()) return false; if (n.equals(2) || n.equals(3) || n.equals(5)) return true; if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false; if (n.lesser(25)) return true } BigInteger.prototype.isPrime = function () { var isPrime = isBasicPrime(this); if (isPrime !== undefined) return isPrime; var n = this.abs(), nPrev = n.prev(); var a = [2, 3, 5, 7, 11, 13, 17, 19], b = nPrev, d, t, i, x; while (b.isEven()) b = b.divide(2); for (i = 0; i < a.length; i++) { x = bigInt(a[i]).modPow(b, n); if (x.equals(Integer[1]) || x.equals(nPrev)) continue; for (t = true, d = b; t && d.lesser(nPrev); d = d.multiply(2)) { x = x.square().mod(n); if (x.equals(nPrev)) t = false } if (t) return false } return true }; SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime; BigInteger.prototype.isProbablePrime = function (iterations) { var isPrime = isBasicPrime(this); if (isPrime !== undefined) return isPrime; var n = this.abs(); var t = iterations === undefined ? 5 : iterations; for (var i = 0; i < t; i++) { var a = bigInt.randBetween(2, n.minus(2)); if (!a.modPow(n.prev(), n).isUnit()) return false } return true }; SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; BigInteger.prototype.modInv = function (n) { var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; while (!newR.equals(bigInt.zero)) { q = r.divide(newR); lastT = t; lastR = r; t = newT; r = newR; newT = lastT.subtract(q.multiply(newT)); newR = lastR.subtract(q.multiply(newR)) } if (!r.equals(1)) throw new Error(this.toString() + \" and \" + n.toString() + \" are not co-prime\"); if (t.compare(0) === -1) { t = t.add(n) } if (this.isNegative()) { return t.negate() } return t }; SmallInteger.prototype.modInv = BigInteger.prototype.modInv; BigInteger.prototype.next = function () { var value = this.value; if (this.sign) { return subtractSmall(value, 1, this.sign) } return new BigInteger(addSmall(value, 1), this.sign) }; SmallInteger.prototype.next = function () { var value = this.value; if (value + 1 < MAX_INT) return new SmallInteger(value + 1); return new BigInteger(MAX_INT_ARR, false) }; BigInteger.prototype.prev = function () { var value = this.value; if (this.sign) { return new BigInteger(addSmall(value, 1), true) } return subtractSmall(value, 1, this.sign) }; SmallInteger.prototype.prev = function () { var value = this.value; if (value - 1 > -MAX_INT) return new SmallInteger(value - 1); return new BigInteger(MAX_INT_ARR, true) }; var powersOfTwo = [1]; while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; function shift_isSmall(n) { return (typeof n === \"number\" || typeof n === \"string\") && +Math.abs(n) <= BASE || n instanceof BigInteger && n.value.length <= 1 } BigInteger.prototype.shiftLeft = function (n) { if (!shift_isSmall(n)) { throw new Error(String(n) + \" is too large for shifting.\") } n = +n; if (n < 0) return this.shiftRight(-n); var result = this; if (result.isZero()) return result; while (n >= powers2Length) { result = result.multiply(highestPower2); n -= powers2Length - 1 } return result.multiply(powersOfTwo[n]) }; SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft; BigInteger.prototype.shiftRight = function (n) { var remQuo; if (!shift_isSmall(n)) { throw new Error(String(n) + \" is too large for shifting.\") } n = +n; if (n < 0) return this.shiftLeft(-n); var result = this; while (n >= powers2Length) { if (result.isZero() || result.isNegative() && result.isUnit()) return result; remQuo = divModAny(result, highestPower2); result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; n -= powers2Length - 1 } remQuo = divModAny(result, powersOfTwo[n]); return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0] }; SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight; function bitwise(x, y, fn) { y = parseValue(y); var xSign = x.isNegative(), ySign = y.isNegative(); var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y; var xDigit = 0, yDigit = 0; var xDivMod = null, yDivMod = null; var result = []; while (!xRem.isZero() || !yRem.isZero()) { xDivMod = divModAny(xRem, highestPower2); xDigit = xDivMod[1].toJSNumber(); if (xSign) { xDigit = highestPower2 - 1 - xDigit } yDivMod = divModAny(yRem, highestPower2); yDigit = yDivMod[1].toJSNumber(); if (ySign) { yDigit = highestPower2 - 1 - yDigit } xRem = xDivMod[0]; yRem = yDivMod[0]; result.push(fn(xDigit, yDigit)) } var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); for (var i = result.length - 1; i >= 0; i -= 1) { sum = sum.multiply(highestPower2).add(bigInt(result[i])) } return sum } BigInteger.prototype.not = function () { return this.negate().prev() }; SmallInteger.prototype.not = BigInteger.prototype.not; BigInteger.prototype.and = function (n) { return bitwise(this, n, function (a, b) { return a & b }) }; SmallInteger.prototype.and = BigInteger.prototype.and; BigInteger.prototype.or = function (n) { return bitwise(this, n, function (a, b) { return a | b }) }; SmallInteger.prototype.or = BigInteger.prototype.or; BigInteger.prototype.xor = function (n) { return bitwise(this, n, function (a, b) { return a ^ b }) }; SmallInteger.prototype.xor = BigInteger.prototype.xor; var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I; function roughLOB(n) { var v = n.value, x = typeof v === \"number\" ? v | LOBMASK_I : v[0] + v[1] * BASE | LOBMASK_BI; return x & -x } function integerLogarithm(value, base) { if (base.compareTo(value) <= 0) { var tmp = integerLogarithm(value, base.square(base)); var p = tmp.p; var e = tmp.e; var t = p.multiply(base); return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 } } return { p: bigInt(1), e: 0 } } BigInteger.prototype.bitLength = function () { var n = this; if (n.compareTo(bigInt(0)) < 0) { n = n.negate().subtract(bigInt(1)) } if (n.compareTo(bigInt(0)) === 0) { return bigInt(0) } return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)) }; SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; function max(a, b) { a = parseValue(a); b = parseValue(b); return a.greater(b) ? a : b } function min(a, b) { a = parseValue(a); b = parseValue(b); return a.lesser(b) ? a : b } function gcd(a, b) { a = parseValue(a).abs(); b = parseValue(b).abs(); if (a.equals(b)) return a; if (a.isZero()) return b; if (b.isZero()) return a; var c = Integer[1], d, t; while (a.isEven() && b.isEven()) { d = Math.min(roughLOB(a), roughLOB(b)); a = a.divide(d); b = b.divide(d); c = c.multiply(d) } while (a.isEven()) { a = a.divide(roughLOB(a)) } do { while (b.isEven()) { b = b.divide(roughLOB(b)) } if (a.greater(b)) { t = b; b = a; a = t } b = b.subtract(a) } while (!b.isZero()); return c.isUnit() ? a : a.multiply(c) } function lcm(a, b) { a = parseValue(a).abs(); b = parseValue(b).abs(); return a.divide(gcd(a, b)).multiply(b) } function randBetween(a, b) { a = parseValue(a); b = parseValue(b); var low = min(a, b), high = max(a, b); var range = high.subtract(low).add(1); if (range.isSmall) return low.add(Math.floor(Math.random() * range)); var length = range.value.length - 1; var result = [], restricted = true; for (var i = length; i >= 0; i--) { var top = restricted ? range.value[i] : BASE; var digit = truncate(Math.random() * top); result.unshift(digit); if (digit < top) restricted = false } result = arrayToSmall(result); return low.add(typeof result === \"number\" ? new SmallInteger(result) : new BigInteger(result, false)) } var parseBase = function (text, base) { var length = text.length; var i; var absBase = Math.abs(base); for (var i = 0; i < length; i++) { var c = text[i].toLowerCase(); if (c === \"-\") continue; if (/[a-z0-9]/.test(c)) { if (/[0-9]/.test(c) && +c >= absBase) { if (c === \"1\" && absBase === 1) continue; throw new Error(c + \" is not a valid digit in base \" + base + \".\") } else if (c.charCodeAt(0) - 87 >= absBase) { throw new Error(c + \" is not a valid digit in base \" + base + \".\") } } } if (2 <= base && base <= 36) { if (length <= LOG_MAX_INT / Math.log(base)) { var result = parseInt(text, base); if (isNaN(result)) { throw new Error(c + \" is not a valid digit in base \" + base + \".\") } return new SmallInteger(parseInt(text, base)) } } base = parseValue(base); var digits = []; var isNegative = text[0] === \"-\"; for (i = isNegative ? 1 : 0; i < text.length; i++) { var c = text[i].toLowerCase(), charCode = c.charCodeAt(0); if (48 <= charCode && charCode <= 57) digits.push(parseValue(c)); else if (97 <= charCode && charCode <= 122) digits.push(parseValue(c.charCodeAt(0) - 87)); else if (c === \"<\") { var start = i; do { i++ } while (text[i] !== \">\"); digits.push(parseValue(text.slice(start + 1, i))) } else throw new Error(c + \" is not a valid character\") } return parseBaseFromArray(digits, base, isNegative) }; function parseBaseFromArray(digits, base, isNegative) { var val = Integer[0], pow = Integer[1], i; for (i = digits.length - 1; i >= 0; i--) { val = val.add(digits[i].times(pow)); pow = pow.times(base) } return isNegative ? val.negate() : val } function stringify(digit) { if (digit <= 35) { return \"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(digit) } return \"<\" + digit + \">\" } function toBase(n, base) { base = bigInt(base); if (base.isZero()) { if (n.isZero()) return { value: [0], isNegative: false }; throw new Error(\"Cannot convert nonzero numbers to base 0.\") } if (base.equals(-1)) { if (n.isZero()) return { value: [0], isNegative: false }; if (n.isNegative()) return { value: [].concat.apply([], Array.apply(null, Array(-n)).map(Array.prototype.valueOf, [1, 0])), isNegative: false }; var arr = Array.apply(null, Array(+n - 1)).map(Array.prototype.valueOf, [0, 1]); arr.unshift([1]); return { value: [].concat.apply([], arr), isNegative: false } } var neg = false; if (n.isNegative() && base.isPositive()) { neg = true; n = n.abs() } if (base.equals(1)) { if (n.isZero()) return { value: [0], isNegative: false }; return { value: Array.apply(null, Array(+n)).map(Number.prototype.valueOf, 1), isNegative: neg } } var out = []; var left = n, divmod; while (left.isNegative() || left.compareAbs(base) >= 0) { divmod = left.divmod(base); left = divmod.quotient; var digit = divmod.remainder; if (digit.isNegative()) { digit = base.minus(digit).abs(); left = left.next() } out.push(digit.toJSNumber()) } out.push(left.toJSNumber()); return { value: out.reverse(), isNegative: neg } } function toBaseString(n, base) { var arr = toBase(n, base); return (arr.isNegative ? \"-\" : \"\") + arr.value.map(stringify).join(\"\") } BigInteger.prototype.toArray = function (radix) { return toBase(this, radix) }; SmallInteger.prototype.toArray = function (radix) { return toBase(this, radix) }; BigInteger.prototype.toString = function (radix) { if (radix === undefined) radix = 10; if (radix !== 10) return toBaseString(this, radix); var v = this.value, l = v.length, str = String(v[--l]), zeros = \"0000000\", digit; while (--l >= 0) { digit = String(v[l]); str += zeros.slice(digit.length) + digit } var sign = this.sign ? \"-\" : \"\"; return sign + str }; SmallInteger.prototype.toString = function (radix) { if (radix === undefined) radix = 10; if (radix != 10) return toBaseString(this, radix); return String(this.value) }; BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString() }; BigInteger.prototype.valueOf = function () { return parseInt(this.toString(), 10) }; BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf; SmallInteger.prototype.valueOf = function () { return this.value }; SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; function parseStringValue(v) { if (isPrecise(+v)) { var x = +v; if (x === truncate(x)) return new SmallInteger(x); throw new Error(\"Invalid integer: \" + v) } var sign = v[0] === \"-\"; if (sign) v = v.slice(1); var split = v.split(/e/i); if (split.length > 2) throw new Error(\"Invalid integer: \" + split.join(\"e\")); if (split.length === 2) { var exp = split[1]; if (exp[0] === \"+\") exp = exp.slice(1); exp = +exp; if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error(\"Invalid integer: \" + exp + \" is not a valid exponent.\"); var text = split[0]; var decimalPlace = text.indexOf(\".\"); if (decimalPlace >= 0) { exp -= text.length - decimalPlace - 1; text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1) } if (exp < 0) throw new Error(\"Cannot include negative exponent part for integers\"); text += new Array(exp + 1).join(\"0\"); v = text } var isValid = /^([0-9][0-9]*)$/.test(v); if (!isValid) throw new Error(\"Invalid integer: \" + v); var r = [], max = v.length, l = LOG_BASE, min = max - l; while (max > 0) { r.push(+v.slice(min, max)); min -= l; if (min < 0) min = 0; max -= l } trim(r); return new BigInteger(r, sign) } function parseNumberValue(v) { if (isPrecise(v)) { if (v !== truncate(v)) throw new Error(v + \" is not an integer.\"); return new SmallInteger(v) } return parseStringValue(v.toString()) } function parseValue(v) { if (typeof v === \"number\") { return parseNumberValue(v) } if (typeof v === \"string\") { return parseStringValue(v) } return v } for (var i = 0; i < 1e3; i++) { Integer[i] = new SmallInteger(i); if (i > 0) Integer[-i] = new SmallInteger(-i) } Integer.one = Integer[1]; Integer.zero = Integer[0]; Integer.minusOne = Integer[-1]; Integer.max = max; Integer.min = min; Integer.gcd = gcd; Integer.lcm = lcm; Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger }; Integer.randBetween = randBetween; Integer.fromArray = function (digits, base, isNegative) { return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative) }; return Integer }();\n\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nconst rows = input.trim().split('\\n');\n\nconst N = Number(rows[0].trim());\nconst An = rows[1].trim().split(' ').map((v) => {\n return bigInt(v);\n});\n\nlet sum = bigInt(0);\nfor (let i = 0; i < N - 1; i++) {\n for (let j = i + 1; j < N; j++) {\n sum = sum.add(An[i].xor(An[j]));\n }\n}\n\nconsole.log(sum.mod(1000000007).toString());\n", "language": "JavaScript", "metadata": {"date": 1575862434, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02838.html", "problem_id": "p02838", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02838/input.txt", "sample_output_relpath": "derived/input_output/data/p02838/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02838/JavaScript/s508237877.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s508237877", "user_id": "u817160604"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "'use strict';\n\nlet bigInt = function (undefined) { var BASE = 1e7, LOG_BASE = 7, MAX_INT = 9007199254740992, MAX_INT_ARR = smallToArray(MAX_INT), LOG_MAX_INT = Math.log(MAX_INT); function Integer(v, radix) { if (typeof v === \"undefined\") return Integer[0]; if (typeof radix !== \"undefined\") return +radix === 10 ? parseValue(v) : parseBase(v, radix); return parseValue(v) } function BigInteger(value, sign) { this.value = value; this.sign = sign; this.isSmall = false } BigInteger.prototype = Object.create(Integer.prototype); function SmallInteger(value) { this.value = value; this.sign = value < 0; this.isSmall = true } SmallInteger.prototype = Object.create(Integer.prototype); function isPrecise(n) { return -MAX_INT < n && n < MAX_INT } function smallToArray(n) { if (n < 1e7) return [n]; if (n < 1e14) return [n % 1e7, Math.floor(n / 1e7)]; return [n % 1e7, Math.floor(n / 1e7) % 1e7, Math.floor(n / 1e14)] } function arrayToSmall(arr) { trim(arr); var length = arr.length; if (length < 4 && compareAbs(arr, MAX_INT_ARR) < 0) { switch (length) { case 0: return 0; case 1: return arr[0]; case 2: return arr[0] + arr[1] * BASE; default: return arr[0] + (arr[1] + arr[2] * BASE) * BASE } } return arr } function trim(v) { var i = v.length; while (v[--i] === 0); v.length = i + 1 } function createArray(length) { var x = new Array(length); var i = -1; while (++i < length) { x[i] = 0 } return x } function truncate(n) { if (n > 0) return Math.floor(n); return Math.ceil(n) } function add(a, b) { var l_a = a.length, l_b = b.length, r = new Array(l_a), carry = 0, base = BASE, sum, i; for (i = 0; i < l_b; i++) { sum = a[i] + b[i] + carry; carry = sum >= base ? 1 : 0; r[i] = sum - carry * base } while (i < l_a) { sum = a[i] + carry; carry = sum === base ? 1 : 0; r[i++] = sum - carry * base } if (carry > 0) r.push(carry); return r } function addAny(a, b) { if (a.length >= b.length) return add(a, b); return add(b, a) } function addSmall(a, carry) { var l = a.length, r = new Array(l), base = BASE, sum, i; for (i = 0; i < l; i++) { sum = a[i] - base + carry; carry = Math.floor(sum / base); r[i] = sum - carry * base; carry += 1 } while (carry > 0) { r[i++] = carry % base; carry = Math.floor(carry / base) } return r } BigInteger.prototype.add = function (v) { var n = parseValue(v); if (this.sign !== n.sign) { return this.subtract(n.negate()) } var a = this.value, b = n.value; if (n.isSmall) { return new BigInteger(addSmall(a, Math.abs(b)), this.sign) } return new BigInteger(addAny(a, b), this.sign) }; BigInteger.prototype.plus = BigInteger.prototype.add; SmallInteger.prototype.add = function (v) { var n = parseValue(v); var a = this.value; if (a < 0 !== n.sign) { return this.subtract(n.negate()) } var b = n.value; if (n.isSmall) { if (isPrecise(a + b)) return new SmallInteger(a + b); b = smallToArray(Math.abs(b)) } return new BigInteger(addSmall(b, Math.abs(a)), a < 0) }; SmallInteger.prototype.plus = SmallInteger.prototype.add; function subtract(a, b) { var a_l = a.length, b_l = b.length, r = new Array(a_l), borrow = 0, base = BASE, i, difference; for (i = 0; i < b_l; i++) { difference = a[i] - borrow - b[i]; if (difference < 0) { difference += base; borrow = 1 } else borrow = 0; r[i] = difference } for (i = b_l; i < a_l; i++) { difference = a[i] - borrow; if (difference < 0) difference += base; else { r[i++] = difference; break } r[i] = difference } for (; i < a_l; i++) { r[i] = a[i] } trim(r); return r } function subtractAny(a, b, sign) { var value; if (compareAbs(a, b) >= 0) { value = subtract(a, b) } else { value = subtract(b, a); sign = !sign } value = arrayToSmall(value); if (typeof value === \"number\") { if (sign) value = -value; return new SmallInteger(value) } return new BigInteger(value, sign) } function subtractSmall(a, b, sign) { var l = a.length, r = new Array(l), carry = -b, base = BASE, i, difference; for (i = 0; i < l; i++) { difference = a[i] + carry; carry = Math.floor(difference / base); difference %= base; r[i] = difference < 0 ? difference + base : difference } r = arrayToSmall(r); if (typeof r === \"number\") { if (sign) r = -r; return new SmallInteger(r) } return new BigInteger(r, sign) } BigInteger.prototype.subtract = function (v) { var n = parseValue(v); if (this.sign !== n.sign) { return this.add(n.negate()) } var a = this.value, b = n.value; if (n.isSmall) return subtractSmall(a, Math.abs(b), this.sign); return subtractAny(a, b, this.sign) }; BigInteger.prototype.minus = BigInteger.prototype.subtract; SmallInteger.prototype.subtract = function (v) { var n = parseValue(v); var a = this.value; if (a < 0 !== n.sign) { return this.add(n.negate()) } var b = n.value; if (n.isSmall) { return new SmallInteger(a - b) } return subtractSmall(b, Math.abs(a), a >= 0) }; SmallInteger.prototype.minus = SmallInteger.prototype.subtract; BigInteger.prototype.negate = function () { return new BigInteger(this.value, !this.sign) }; SmallInteger.prototype.negate = function () { var sign = this.sign; var small = new SmallInteger(-this.value); small.sign = !sign; return small }; BigInteger.prototype.abs = function () { return new BigInteger(this.value, false) }; SmallInteger.prototype.abs = function () { return new SmallInteger(Math.abs(this.value)) }; function multiplyLong(a, b) { var a_l = a.length, b_l = b.length, l = a_l + b_l, r = createArray(l), base = BASE, product, carry, i, a_i, b_j; for (i = 0; i < a_l; ++i) { a_i = a[i]; for (var j = 0; j < b_l; ++j) { b_j = b[j]; product = a_i * b_j + r[i + j]; carry = Math.floor(product / base); r[i + j] = product - carry * base; r[i + j + 1] += carry } } trim(r); return r } function multiplySmall(a, b) { var l = a.length, r = new Array(l), base = BASE, carry = 0, product, i; for (i = 0; i < l; i++) { product = a[i] * b + carry; carry = Math.floor(product / base); r[i] = product - carry * base } while (carry > 0) { r[i++] = carry % base; carry = Math.floor(carry / base) } return r } function shiftLeft(x, n) { var r = []; while (n-- > 0) r.push(0); return r.concat(x) } function multiplyKaratsuba(x, y) { var n = Math.max(x.length, y.length); if (n <= 30) return multiplyLong(x, y); n = Math.ceil(n / 2); var b = x.slice(n), a = x.slice(0, n), d = y.slice(n), c = y.slice(0, n); var ac = multiplyKaratsuba(a, c), bd = multiplyKaratsuba(b, d), abcd = multiplyKaratsuba(addAny(a, b), addAny(c, d)); var product = addAny(addAny(ac, shiftLeft(subtract(subtract(abcd, ac), bd), n)), shiftLeft(bd, 2 * n)); trim(product); return product } function useKaratsuba(l1, l2) { return -.012 * l1 - .012 * l2 + 15e-6 * l1 * l2 > 0 } BigInteger.prototype.multiply = function (v) { var n = parseValue(v), a = this.value, b = n.value, sign = this.sign !== n.sign, abs; if (n.isSmall) { if (b === 0) return Integer[0]; if (b === 1) return this; if (b === -1) return this.negate(); abs = Math.abs(b); if (abs < BASE) { return new BigInteger(multiplySmall(a, abs), sign) } b = smallToArray(abs) } if (useKaratsuba(a.length, b.length)) return new BigInteger(multiplyKaratsuba(a, b), sign); return new BigInteger(multiplyLong(a, b), sign) }; BigInteger.prototype.times = BigInteger.prototype.multiply; function multiplySmallAndArray(a, b, sign) { if (a < BASE) { return new BigInteger(multiplySmall(b, a), sign) } return new BigInteger(multiplyLong(b, smallToArray(a)), sign) } SmallInteger.prototype._multiplyBySmall = function (a) { if (isPrecise(a.value * this.value)) { return new SmallInteger(a.value * this.value) } return multiplySmallAndArray(Math.abs(a.value), smallToArray(Math.abs(this.value)), this.sign !== a.sign) }; BigInteger.prototype._multiplyBySmall = function (a) { if (a.value === 0) return Integer[0]; if (a.value === 1) return this; if (a.value === -1) return this.negate(); return multiplySmallAndArray(Math.abs(a.value), this.value, this.sign !== a.sign) }; SmallInteger.prototype.multiply = function (v) { return parseValue(v)._multiplyBySmall(this) }; SmallInteger.prototype.times = SmallInteger.prototype.multiply; function square(a) { var l = a.length, r = createArray(l + l), base = BASE, product, carry, i, a_i, a_j; for (i = 0; i < l; i++) { a_i = a[i]; carry = 0 - a_i * a_i; for (var j = i; j < l; j++) { a_j = a[j]; product = 2 * (a_i * a_j) + r[i + j] + carry; carry = Math.floor(product / base); r[i + j] = product - carry * base } r[i + l] = carry } trim(r); return r } BigInteger.prototype.square = function () { return new BigInteger(square(this.value), false) }; SmallInteger.prototype.square = function () { var value = this.value * this.value; if (isPrecise(value)) return new SmallInteger(value); return new BigInteger(square(smallToArray(Math.abs(this.value))), false) }; function divMod1(a, b) { var a_l = a.length, b_l = b.length, base = BASE, result = createArray(b.length), divisorMostSignificantDigit = b[b_l - 1], lambda = Math.ceil(base / (2 * divisorMostSignificantDigit)), remainder = multiplySmall(a, lambda), divisor = multiplySmall(b, lambda), quotientDigit, shift, carry, borrow, i, l, q; if (remainder.length <= a_l) remainder.push(0); divisor.push(0); divisorMostSignificantDigit = divisor[b_l - 1]; for (shift = a_l - b_l; shift >= 0; shift--) { quotientDigit = base - 1; if (remainder[shift + b_l] !== divisorMostSignificantDigit) { quotientDigit = Math.floor((remainder[shift + b_l] * base + remainder[shift + b_l - 1]) / divisorMostSignificantDigit) } carry = 0; borrow = 0; l = divisor.length; for (i = 0; i < l; i++) { carry += quotientDigit * divisor[i]; q = Math.floor(carry / base); borrow += remainder[shift + i] - (carry - q * base); carry = q; if (borrow < 0) { remainder[shift + i] = borrow + base; borrow = -1 } else { remainder[shift + i] = borrow; borrow = 0 } } while (borrow !== 0) { quotientDigit -= 1; carry = 0; for (i = 0; i < l; i++) { carry += remainder[shift + i] - base + divisor[i]; if (carry < 0) { remainder[shift + i] = carry + base; carry = 0 } else { remainder[shift + i] = carry; carry = 1 } } borrow += carry } result[shift] = quotientDigit } remainder = divModSmall(remainder, lambda)[0]; return [arrayToSmall(result), arrayToSmall(remainder)] } function divMod2(a, b) { var a_l = a.length, b_l = b.length, result = [], part = [], base = BASE, guess, xlen, highx, highy, check; while (a_l) { part.unshift(a[--a_l]); trim(part); if (compareAbs(part, b) < 0) { result.push(0); continue } xlen = part.length; highx = part[xlen - 1] * base + part[xlen - 2]; highy = b[b_l - 1] * base + b[b_l - 2]; if (xlen > b_l) { highx = (highx + 1) * base } guess = Math.ceil(highx / highy); do { check = multiplySmall(b, guess); if (compareAbs(check, part) <= 0) break; guess-- } while (guess); result.push(guess); part = subtract(part, check) } result.reverse(); return [arrayToSmall(result), arrayToSmall(part)] } function divModSmall(value, lambda) { var length = value.length, quotient = createArray(length), base = BASE, i, q, remainder, divisor; remainder = 0; for (i = length - 1; i >= 0; --i) { divisor = remainder * base + value[i]; q = truncate(divisor / lambda); remainder = divisor - q * lambda; quotient[i] = q | 0 } return [quotient, remainder | 0] } function divModAny(self, v) { var value, n = parseValue(v); var a = self.value, b = n.value; var quotient; if (b === 0) throw new Error(\"Cannot divide by zero\"); if (self.isSmall) { if (n.isSmall) { return [new SmallInteger(truncate(a / b)), new SmallInteger(a % b)] } return [Integer[0], self] } if (n.isSmall) { if (b === 1) return [self, Integer[0]]; if (b == -1) return [self.negate(), Integer[0]]; var abs = Math.abs(b); if (abs < BASE) { value = divModSmall(a, abs); quotient = arrayToSmall(value[0]); var remainder = value[1]; if (self.sign) remainder = -remainder; if (typeof quotient === \"number\") { if (self.sign !== n.sign) quotient = -quotient; return [new SmallInteger(quotient), new SmallInteger(remainder)] } return [new BigInteger(quotient, self.sign !== n.sign), new SmallInteger(remainder)] } b = smallToArray(abs) } var comparison = compareAbs(a, b); if (comparison === -1) return [Integer[0], self]; if (comparison === 0) return [Integer[self.sign === n.sign ? 1 : -1], Integer[0]]; if (a.length + b.length <= 200) value = divMod1(a, b); else value = divMod2(a, b); quotient = value[0]; var qSign = self.sign !== n.sign, mod = value[1], mSign = self.sign; if (typeof quotient === \"number\") { if (qSign) quotient = -quotient; quotient = new SmallInteger(quotient) } else quotient = new BigInteger(quotient, qSign); if (typeof mod === \"number\") { if (mSign) mod = -mod; mod = new SmallInteger(mod) } else mod = new BigInteger(mod, mSign); return [quotient, mod] } BigInteger.prototype.divmod = function (v) { var result = divModAny(this, v); return { quotient: result[0], remainder: result[1] } }; SmallInteger.prototype.divmod = BigInteger.prototype.divmod; BigInteger.prototype.divide = function (v) { return divModAny(this, v)[0] }; SmallInteger.prototype.over = SmallInteger.prototype.divide = BigInteger.prototype.over = BigInteger.prototype.divide; BigInteger.prototype.mod = function (v) { return divModAny(this, v)[1] }; SmallInteger.prototype.remainder = SmallInteger.prototype.mod = BigInteger.prototype.remainder = BigInteger.prototype.mod; BigInteger.prototype.pow = function (v) { var n = parseValue(v), a = this.value, b = n.value, value, x, y; if (b === 0) return Integer[1]; if (a === 0) return Integer[0]; if (a === 1) return Integer[1]; if (a === -1) return n.isEven() ? Integer[1] : Integer[-1]; if (n.sign) { return Integer[0] } if (!n.isSmall) throw new Error(\"The exponent \" + n.toString() + \" is too large.\"); if (this.isSmall) { if (isPrecise(value = Math.pow(a, b))) return new SmallInteger(truncate(value)) } x = this; y = Integer[1]; while (true) { if (b & 1 === 1) { y = y.times(x); --b } if (b === 0) break; b /= 2; x = x.square() } return y }; SmallInteger.prototype.pow = BigInteger.prototype.pow; BigInteger.prototype.modPow = function (exp, mod) { exp = parseValue(exp); mod = parseValue(mod); if (mod.isZero()) throw new Error(\"Cannot take modPow with modulus 0\"); var r = Integer[1], base = this.mod(mod); while (exp.isPositive()) { if (base.isZero()) return Integer[0]; if (exp.isOdd()) r = r.multiply(base).mod(mod); exp = exp.divide(2); base = base.square().mod(mod) } return r }; SmallInteger.prototype.modPow = BigInteger.prototype.modPow; function compareAbs(a, b) { if (a.length !== b.length) { return a.length > b.length ? 1 : -1 } for (var i = a.length - 1; i >= 0; i--) { if (a[i] !== b[i]) return a[i] > b[i] ? 1 : -1 } return 0 } BigInteger.prototype.compareAbs = function (v) { var n = parseValue(v), a = this.value, b = n.value; if (n.isSmall) return 1; return compareAbs(a, b) }; SmallInteger.prototype.compareAbs = function (v) { var n = parseValue(v), a = Math.abs(this.value), b = n.value; if (n.isSmall) { b = Math.abs(b); return a === b ? 0 : a > b ? 1 : -1 } return -1 }; BigInteger.prototype.compare = function (v) { if (v === Infinity) { return -1 } if (v === -Infinity) { return 1 } var n = parseValue(v), a = this.value, b = n.value; if (this.sign !== n.sign) { return n.sign ? 1 : -1 } if (n.isSmall) { return this.sign ? -1 : 1 } return compareAbs(a, b) * (this.sign ? -1 : 1) }; BigInteger.prototype.compareTo = BigInteger.prototype.compare; SmallInteger.prototype.compare = function (v) { if (v === Infinity) { return -1 } if (v === -Infinity) { return 1 } var n = parseValue(v), a = this.value, b = n.value; if (n.isSmall) { return a == b ? 0 : a > b ? 1 : -1 } if (a < 0 !== n.sign) { return a < 0 ? -1 : 1 } return a < 0 ? 1 : -1 }; SmallInteger.prototype.compareTo = SmallInteger.prototype.compare; BigInteger.prototype.equals = function (v) { return this.compare(v) === 0 }; SmallInteger.prototype.eq = SmallInteger.prototype.equals = BigInteger.prototype.eq = BigInteger.prototype.equals; BigInteger.prototype.notEquals = function (v) { return this.compare(v) !== 0 }; SmallInteger.prototype.neq = SmallInteger.prototype.notEquals = BigInteger.prototype.neq = BigInteger.prototype.notEquals; BigInteger.prototype.greater = function (v) { return this.compare(v) > 0 }; SmallInteger.prototype.gt = SmallInteger.prototype.greater = BigInteger.prototype.gt = BigInteger.prototype.greater; BigInteger.prototype.lesser = function (v) { return this.compare(v) < 0 }; SmallInteger.prototype.lt = SmallInteger.prototype.lesser = BigInteger.prototype.lt = BigInteger.prototype.lesser; BigInteger.prototype.greaterOrEquals = function (v) { return this.compare(v) >= 0 }; SmallInteger.prototype.geq = SmallInteger.prototype.greaterOrEquals = BigInteger.prototype.geq = BigInteger.prototype.greaterOrEquals; BigInteger.prototype.lesserOrEquals = function (v) { return this.compare(v) <= 0 }; SmallInteger.prototype.leq = SmallInteger.prototype.lesserOrEquals = BigInteger.prototype.leq = BigInteger.prototype.lesserOrEquals; BigInteger.prototype.isEven = function () { return (this.value[0] & 1) === 0 }; SmallInteger.prototype.isEven = function () { return (this.value & 1) === 0 }; BigInteger.prototype.isOdd = function () { return (this.value[0] & 1) === 1 }; SmallInteger.prototype.isOdd = function () { return (this.value & 1) === 1 }; BigInteger.prototype.isPositive = function () { return !this.sign }; SmallInteger.prototype.isPositive = function () { return this.value > 0 }; BigInteger.prototype.isNegative = function () { return this.sign }; SmallInteger.prototype.isNegative = function () { return this.value < 0 }; BigInteger.prototype.isUnit = function () { return false }; SmallInteger.prototype.isUnit = function () { return Math.abs(this.value) === 1 }; BigInteger.prototype.isZero = function () { return false }; SmallInteger.prototype.isZero = function () { return this.value === 0 }; BigInteger.prototype.isDivisibleBy = function (v) { var n = parseValue(v); var value = n.value; if (value === 0) return false; if (value === 1) return true; if (value === 2) return this.isEven(); return this.mod(n).equals(Integer[0]) }; SmallInteger.prototype.isDivisibleBy = BigInteger.prototype.isDivisibleBy; function isBasicPrime(v) { var n = v.abs(); if (n.isUnit()) return false; if (n.equals(2) || n.equals(3) || n.equals(5)) return true; if (n.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false; if (n.lesser(25)) return true } BigInteger.prototype.isPrime = function () { var isPrime = isBasicPrime(this); if (isPrime !== undefined) return isPrime; var n = this.abs(), nPrev = n.prev(); var a = [2, 3, 5, 7, 11, 13, 17, 19], b = nPrev, d, t, i, x; while (b.isEven()) b = b.divide(2); for (i = 0; i < a.length; i++) { x = bigInt(a[i]).modPow(b, n); if (x.equals(Integer[1]) || x.equals(nPrev)) continue; for (t = true, d = b; t && d.lesser(nPrev); d = d.multiply(2)) { x = x.square().mod(n); if (x.equals(nPrev)) t = false } if (t) return false } return true }; SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime; BigInteger.prototype.isProbablePrime = function (iterations) { var isPrime = isBasicPrime(this); if (isPrime !== undefined) return isPrime; var n = this.abs(); var t = iterations === undefined ? 5 : iterations; for (var i = 0; i < t; i++) { var a = bigInt.randBetween(2, n.minus(2)); if (!a.modPow(n.prev(), n).isUnit()) return false } return true }; SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; BigInteger.prototype.modInv = function (n) { var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; while (!newR.equals(bigInt.zero)) { q = r.divide(newR); lastT = t; lastR = r; t = newT; r = newR; newT = lastT.subtract(q.multiply(newT)); newR = lastR.subtract(q.multiply(newR)) } if (!r.equals(1)) throw new Error(this.toString() + \" and \" + n.toString() + \" are not co-prime\"); if (t.compare(0) === -1) { t = t.add(n) } if (this.isNegative()) { return t.negate() } return t }; SmallInteger.prototype.modInv = BigInteger.prototype.modInv; BigInteger.prototype.next = function () { var value = this.value; if (this.sign) { return subtractSmall(value, 1, this.sign) } return new BigInteger(addSmall(value, 1), this.sign) }; SmallInteger.prototype.next = function () { var value = this.value; if (value + 1 < MAX_INT) return new SmallInteger(value + 1); return new BigInteger(MAX_INT_ARR, false) }; BigInteger.prototype.prev = function () { var value = this.value; if (this.sign) { return new BigInteger(addSmall(value, 1), true) } return subtractSmall(value, 1, this.sign) }; SmallInteger.prototype.prev = function () { var value = this.value; if (value - 1 > -MAX_INT) return new SmallInteger(value - 1); return new BigInteger(MAX_INT_ARR, true) }; var powersOfTwo = [1]; while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; function shift_isSmall(n) { return (typeof n === \"number\" || typeof n === \"string\") && +Math.abs(n) <= BASE || n instanceof BigInteger && n.value.length <= 1 } BigInteger.prototype.shiftLeft = function (n) { if (!shift_isSmall(n)) { throw new Error(String(n) + \" is too large for shifting.\") } n = +n; if (n < 0) return this.shiftRight(-n); var result = this; if (result.isZero()) return result; while (n >= powers2Length) { result = result.multiply(highestPower2); n -= powers2Length - 1 } return result.multiply(powersOfTwo[n]) }; SmallInteger.prototype.shiftLeft = BigInteger.prototype.shiftLeft; BigInteger.prototype.shiftRight = function (n) { var remQuo; if (!shift_isSmall(n)) { throw new Error(String(n) + \" is too large for shifting.\") } n = +n; if (n < 0) return this.shiftLeft(-n); var result = this; while (n >= powers2Length) { if (result.isZero() || result.isNegative() && result.isUnit()) return result; remQuo = divModAny(result, highestPower2); result = remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0]; n -= powers2Length - 1 } remQuo = divModAny(result, powersOfTwo[n]); return remQuo[1].isNegative() ? remQuo[0].prev() : remQuo[0] }; SmallInteger.prototype.shiftRight = BigInteger.prototype.shiftRight; function bitwise(x, y, fn) { y = parseValue(y); var xSign = x.isNegative(), ySign = y.isNegative(); var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y; var xDigit = 0, yDigit = 0; var xDivMod = null, yDivMod = null; var result = []; while (!xRem.isZero() || !yRem.isZero()) { xDivMod = divModAny(xRem, highestPower2); xDigit = xDivMod[1].toJSNumber(); if (xSign) { xDigit = highestPower2 - 1 - xDigit } yDivMod = divModAny(yRem, highestPower2); yDigit = yDivMod[1].toJSNumber(); if (ySign) { yDigit = highestPower2 - 1 - yDigit } xRem = xDivMod[0]; yRem = yDivMod[0]; result.push(fn(xDigit, yDigit)) } var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); for (var i = result.length - 1; i >= 0; i -= 1) { sum = sum.multiply(highestPower2).add(bigInt(result[i])) } return sum } BigInteger.prototype.not = function () { return this.negate().prev() }; SmallInteger.prototype.not = BigInteger.prototype.not; BigInteger.prototype.and = function (n) { return bitwise(this, n, function (a, b) { return a & b }) }; SmallInteger.prototype.and = BigInteger.prototype.and; BigInteger.prototype.or = function (n) { return bitwise(this, n, function (a, b) { return a | b }) }; SmallInteger.prototype.or = BigInteger.prototype.or; BigInteger.prototype.xor = function (n) { return bitwise(this, n, function (a, b) { return a ^ b }) }; SmallInteger.prototype.xor = BigInteger.prototype.xor; var LOBMASK_I = 1 << 30, LOBMASK_BI = (BASE & -BASE) * (BASE & -BASE) | LOBMASK_I; function roughLOB(n) { var v = n.value, x = typeof v === \"number\" ? v | LOBMASK_I : v[0] + v[1] * BASE | LOBMASK_BI; return x & -x } function integerLogarithm(value, base) { if (base.compareTo(value) <= 0) { var tmp = integerLogarithm(value, base.square(base)); var p = tmp.p; var e = tmp.e; var t = p.multiply(base); return t.compareTo(value) <= 0 ? { p: t, e: e * 2 + 1 } : { p: p, e: e * 2 } } return { p: bigInt(1), e: 0 } } BigInteger.prototype.bitLength = function () { var n = this; if (n.compareTo(bigInt(0)) < 0) { n = n.negate().subtract(bigInt(1)) } if (n.compareTo(bigInt(0)) === 0) { return bigInt(0) } return bigInt(integerLogarithm(n, bigInt(2)).e).add(bigInt(1)) }; SmallInteger.prototype.bitLength = BigInteger.prototype.bitLength; function max(a, b) { a = parseValue(a); b = parseValue(b); return a.greater(b) ? a : b } function min(a, b) { a = parseValue(a); b = parseValue(b); return a.lesser(b) ? a : b } function gcd(a, b) { a = parseValue(a).abs(); b = parseValue(b).abs(); if (a.equals(b)) return a; if (a.isZero()) return b; if (b.isZero()) return a; var c = Integer[1], d, t; while (a.isEven() && b.isEven()) { d = Math.min(roughLOB(a), roughLOB(b)); a = a.divide(d); b = b.divide(d); c = c.multiply(d) } while (a.isEven()) { a = a.divide(roughLOB(a)) } do { while (b.isEven()) { b = b.divide(roughLOB(b)) } if (a.greater(b)) { t = b; b = a; a = t } b = b.subtract(a) } while (!b.isZero()); return c.isUnit() ? a : a.multiply(c) } function lcm(a, b) { a = parseValue(a).abs(); b = parseValue(b).abs(); return a.divide(gcd(a, b)).multiply(b) } function randBetween(a, b) { a = parseValue(a); b = parseValue(b); var low = min(a, b), high = max(a, b); var range = high.subtract(low).add(1); if (range.isSmall) return low.add(Math.floor(Math.random() * range)); var length = range.value.length - 1; var result = [], restricted = true; for (var i = length; i >= 0; i--) { var top = restricted ? range.value[i] : BASE; var digit = truncate(Math.random() * top); result.unshift(digit); if (digit < top) restricted = false } result = arrayToSmall(result); return low.add(typeof result === \"number\" ? new SmallInteger(result) : new BigInteger(result, false)) } var parseBase = function (text, base) { var length = text.length; var i; var absBase = Math.abs(base); for (var i = 0; i < length; i++) { var c = text[i].toLowerCase(); if (c === \"-\") continue; if (/[a-z0-9]/.test(c)) { if (/[0-9]/.test(c) && +c >= absBase) { if (c === \"1\" && absBase === 1) continue; throw new Error(c + \" is not a valid digit in base \" + base + \".\") } else if (c.charCodeAt(0) - 87 >= absBase) { throw new Error(c + \" is not a valid digit in base \" + base + \".\") } } } if (2 <= base && base <= 36) { if (length <= LOG_MAX_INT / Math.log(base)) { var result = parseInt(text, base); if (isNaN(result)) { throw new Error(c + \" is not a valid digit in base \" + base + \".\") } return new SmallInteger(parseInt(text, base)) } } base = parseValue(base); var digits = []; var isNegative = text[0] === \"-\"; for (i = isNegative ? 1 : 0; i < text.length; i++) { var c = text[i].toLowerCase(), charCode = c.charCodeAt(0); if (48 <= charCode && charCode <= 57) digits.push(parseValue(c)); else if (97 <= charCode && charCode <= 122) digits.push(parseValue(c.charCodeAt(0) - 87)); else if (c === \"<\") { var start = i; do { i++ } while (text[i] !== \">\"); digits.push(parseValue(text.slice(start + 1, i))) } else throw new Error(c + \" is not a valid character\") } return parseBaseFromArray(digits, base, isNegative) }; function parseBaseFromArray(digits, base, isNegative) { var val = Integer[0], pow = Integer[1], i; for (i = digits.length - 1; i >= 0; i--) { val = val.add(digits[i].times(pow)); pow = pow.times(base) } return isNegative ? val.negate() : val } function stringify(digit) { if (digit <= 35) { return \"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(digit) } return \"<\" + digit + \">\" } function toBase(n, base) { base = bigInt(base); if (base.isZero()) { if (n.isZero()) return { value: [0], isNegative: false }; throw new Error(\"Cannot convert nonzero numbers to base 0.\") } if (base.equals(-1)) { if (n.isZero()) return { value: [0], isNegative: false }; if (n.isNegative()) return { value: [].concat.apply([], Array.apply(null, Array(-n)).map(Array.prototype.valueOf, [1, 0])), isNegative: false }; var arr = Array.apply(null, Array(+n - 1)).map(Array.prototype.valueOf, [0, 1]); arr.unshift([1]); return { value: [].concat.apply([], arr), isNegative: false } } var neg = false; if (n.isNegative() && base.isPositive()) { neg = true; n = n.abs() } if (base.equals(1)) { if (n.isZero()) return { value: [0], isNegative: false }; return { value: Array.apply(null, Array(+n)).map(Number.prototype.valueOf, 1), isNegative: neg } } var out = []; var left = n, divmod; while (left.isNegative() || left.compareAbs(base) >= 0) { divmod = left.divmod(base); left = divmod.quotient; var digit = divmod.remainder; if (digit.isNegative()) { digit = base.minus(digit).abs(); left = left.next() } out.push(digit.toJSNumber()) } out.push(left.toJSNumber()); return { value: out.reverse(), isNegative: neg } } function toBaseString(n, base) { var arr = toBase(n, base); return (arr.isNegative ? \"-\" : \"\") + arr.value.map(stringify).join(\"\") } BigInteger.prototype.toArray = function (radix) { return toBase(this, radix) }; SmallInteger.prototype.toArray = function (radix) { return toBase(this, radix) }; BigInteger.prototype.toString = function (radix) { if (radix === undefined) radix = 10; if (radix !== 10) return toBaseString(this, radix); var v = this.value, l = v.length, str = String(v[--l]), zeros = \"0000000\", digit; while (--l >= 0) { digit = String(v[l]); str += zeros.slice(digit.length) + digit } var sign = this.sign ? \"-\" : \"\"; return sign + str }; SmallInteger.prototype.toString = function (radix) { if (radix === undefined) radix = 10; if (radix != 10) return toBaseString(this, radix); return String(this.value) }; BigInteger.prototype.toJSON = SmallInteger.prototype.toJSON = function () { return this.toString() }; BigInteger.prototype.valueOf = function () { return parseInt(this.toString(), 10) }; BigInteger.prototype.toJSNumber = BigInteger.prototype.valueOf; SmallInteger.prototype.valueOf = function () { return this.value }; SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; function parseStringValue(v) { if (isPrecise(+v)) { var x = +v; if (x === truncate(x)) return new SmallInteger(x); throw new Error(\"Invalid integer: \" + v) } var sign = v[0] === \"-\"; if (sign) v = v.slice(1); var split = v.split(/e/i); if (split.length > 2) throw new Error(\"Invalid integer: \" + split.join(\"e\")); if (split.length === 2) { var exp = split[1]; if (exp[0] === \"+\") exp = exp.slice(1); exp = +exp; if (exp !== truncate(exp) || !isPrecise(exp)) throw new Error(\"Invalid integer: \" + exp + \" is not a valid exponent.\"); var text = split[0]; var decimalPlace = text.indexOf(\".\"); if (decimalPlace >= 0) { exp -= text.length - decimalPlace - 1; text = text.slice(0, decimalPlace) + text.slice(decimalPlace + 1) } if (exp < 0) throw new Error(\"Cannot include negative exponent part for integers\"); text += new Array(exp + 1).join(\"0\"); v = text } var isValid = /^([0-9][0-9]*)$/.test(v); if (!isValid) throw new Error(\"Invalid integer: \" + v); var r = [], max = v.length, l = LOG_BASE, min = max - l; while (max > 0) { r.push(+v.slice(min, max)); min -= l; if (min < 0) min = 0; max -= l } trim(r); return new BigInteger(r, sign) } function parseNumberValue(v) { if (isPrecise(v)) { if (v !== truncate(v)) throw new Error(v + \" is not an integer.\"); return new SmallInteger(v) } return parseStringValue(v.toString()) } function parseValue(v) { if (typeof v === \"number\") { return parseNumberValue(v) } if (typeof v === \"string\") { return parseStringValue(v) } return v } for (var i = 0; i < 1e3; i++) { Integer[i] = new SmallInteger(i); if (i > 0) Integer[-i] = new SmallInteger(-i) } Integer.one = Integer[1]; Integer.zero = Integer[0]; Integer.minusOne = Integer[-1]; Integer.max = max; Integer.min = min; Integer.gcd = gcd; Integer.lcm = lcm; Integer.isInstance = function (x) { return x instanceof BigInteger || x instanceof SmallInteger }; Integer.randBetween = randBetween; Integer.fromArray = function (digits, base, isNegative) { return parseBaseFromArray(digits.map(parseValue), parseValue(base || 10), isNegative) }; return Integer }();\n\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nconst rows = input.trim().split('\\n');\n\nconst N = Number(rows[0].trim());\nconst An = rows[1].trim().split(' ').map((v) => {\n return bigInt(v);\n});\n\nlet sum = bigInt(0);\nfor (let i = 0; i < N - 1; i++) {\n for (let j = i + 1; j < N; j++) {\n sum = sum.add(An[i].xor(An[j]));\n }\n}\n\nconsole.log(sum.mod(1000000007).toString());\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have N integers. The i-th integer is A_i.\n\nFind \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n0 \\leq A_i < 2^{60}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the value \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n6\n\nWe have (1\\mbox{ XOR } 2)+(1\\mbox{ XOR } 3)+(2\\mbox{ XOR } 3)=3+2+1=6.\n\nSample Input 2\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 2\n\n237\n\nSample Input 3\n\n10\n3 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820\n\nSample Output 3\n\n103715602\n\nPrint the sum modulo (10^9+7).", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p02838", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have N integers. The i-th integer is A_i.\n\nFind \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nWhat is \\mbox{ XOR }?\n\nThe XOR of integers A and B, A \\mbox{ XOR } B, is defined as follows:\n\nWhen A \\mbox{ XOR } B is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if either A or B, but not both, has 1 in the 2^k's place, and 0 otherwise.\n\nFor example, 3 \\mbox{ XOR } 5 = 6. (In base two: 011 \\mbox{ XOR } 101 = 110.)\n\nConstraints\n\n2 \\leq N \\leq 3 \\times 10^5\n\n0 \\leq A_i < 2^{60}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the value \\sum_{i=1}^{N-1}\\sum_{j=i+1}^{N} (A_i \\mbox{ XOR } A_j), modulo (10^9+7).\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n6\n\nWe have (1\\mbox{ XOR } 2)+(1\\mbox{ XOR } 3)+(2\\mbox{ XOR } 3)=3+2+1=6.\n\nSample Input 2\n\n10\n3 1 4 1 5 9 2 6 5 3\n\nSample Output 2\n\n237\n\nSample Input 3\n\n10\n3 14 159 2653 58979 323846 2643383 27950288 419716939 9375105820\n\nSample Output 3\n\n103715602\n\nPrint the sum modulo (10^9+7).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 32201, "cpu_time_ms": 2109, "memory_kb": 106192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s675849132", "group_id": "codeNet:p02843", "input_text": "function main(arg) {\n var price = parseInt(arg)\n var result = false\n var max = 1000000\n\n for (var i100 = 0; i100 < max; i100++) {\n if (result) break\n for (var i101 = 0; i101 < max; i101++) {\n if (result) break\n for (var i102 = 0; i102 < max; i102++) {\n if (result) break\n for (var i103 = 0; i103 < max; i103++) {\n if (result) break\n for (var i104 = 0; i104 < max; i104++) {\n if (result) break\n for (var i105 = 0; i105 < max; i105++) {\n total =\n 100 * i100 +\n 101 * i101 +\n 102 * i102 +\n 103 * i103 +\n 104 * i104 +\n 105 * i105\n if (total === price) {\n result = true\n break\n }\n }\n }\n }\n }\n }\n }\n console.log(result ? 1 : 0)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))", "language": "JavaScript", "metadata": {"date": 1575256392, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02843.html", "problem_id": "p02843", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02843/input.txt", "sample_output_relpath": "derived/input_output/data/p02843/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02843/JavaScript/s675849132.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s675849132", "user_id": "u935252032"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function main(arg) {\n var price = parseInt(arg)\n var result = false\n var max = 1000000\n\n for (var i100 = 0; i100 < max; i100++) {\n if (result) break\n for (var i101 = 0; i101 < max; i101++) {\n if (result) break\n for (var i102 = 0; i102 < max; i102++) {\n if (result) break\n for (var i103 = 0; i103 < max; i103++) {\n if (result) break\n for (var i104 = 0; i104 < max; i104++) {\n if (result) break\n for (var i105 = 0; i105 < max; i105++) {\n total =\n 100 * i100 +\n 101 * i101 +\n 102 * i102 +\n 103 * i103 +\n 104 * i104 +\n 105 * i105\n if (total === price) {\n result = true\n break\n }\n }\n }\n }\n }\n }\n }\n console.log(result ? 1 : 0)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "sample_input": "615\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02843", "source_text": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 949, "cpu_time_ms": 2108, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s936843379", "group_id": "codeNet:p02843", "input_text": "function Main(input) {\n var ans = Math.floor(input);\n var flag = true;\n var yesKosu = 1;\n\n while (flag) {\n var yesLine = 100;\n yesLine *= yesKosu;\n if (ans < yesLine) {\n console.log('0');\n flag = false;\n break;\n }\n if (ans >= yesLine && ans <= yesLine + yesKosu * 5) {\n console.log('1');\n flag = false;\n break;\n }\n yesKosu++;\n }\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1575256258, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02843.html", "problem_id": "p02843", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02843/input.txt", "sample_output_relpath": "derived/input_output/data/p02843/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02843/JavaScript/s936843379.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s936843379", "user_id": "u506671931"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n var ans = Math.floor(input);\n var flag = true;\n var yesKosu = 1;\n\n while (flag) {\n var yesLine = 100;\n yesLine *= yesKosu;\n if (ans < yesLine) {\n console.log('0');\n flag = false;\n break;\n }\n if (ans >= yesLine && ans <= yesLine + yesKosu * 5) {\n console.log('1');\n flag = false;\n break;\n }\n yesKosu++;\n }\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "sample_input": "615\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02843", "source_text": "Score: 300 points\n\nProblem Statement\n\nAtCoder Mart sells 1000000 of each of the six items below:\n\nRiceballs, priced at 100 yen (the currency of Japan) each\n\nSandwiches, priced at 101 yen each\n\nCookies, priced at 102 yen each\n\nCakes, priced at 103 yen each\n\nCandies, priced at 104 yen each\n\nComputers, priced at 105 yen each\n\nTakahashi wants to buy some of them that cost exactly X yen in total.\nDetermine whether this is possible.\n\n(Ignore consumption tax.)\n\nConstraints\n\n1 \\leq X \\leq 100000\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf it is possible to buy some set of items that cost exactly X yen in total, print 1; otherwise, print 0.\n\nSample Input 1\n\n615\n\nSample Output 1\n\n1\n\nFor example, we can buy one of each kind of item, which will cost 100+101+102+103+104+105=615 yen in total.\n\nSample Input 2\n\n217\n\nSample Output 2\n\n0\n\nNo set of items costs 217 yen in total.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 442, "cpu_time_ms": 74, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s854596451", "group_id": "codeNet:p02844", "input_text": "function Main(input) {\n var nums = input.split('\\n');\n \n var keta = Math.floor(nums[0]);\n \n function product_Range(a, b) {\n var prd = a,\n i = a;\n \n while (i++ < b) {\n prd *= i;\n }\n return prd;\n }\n \n function combinations(n, r) {\n if (n == r) {\n return 1;\n } else {\n r = r < n - r ? n - r : r;\n return product_Range(r + 1, n) / product_Range(1, n - r);\n }\n }\n \n var ans = combinations(keta, keta - 3) - (keta - 3);\n \n console.log(ans);\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1575257930, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02844.html", "problem_id": "p02844", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02844/input.txt", "sample_output_relpath": "derived/input_output/data/p02844/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02844/JavaScript/s854596451.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s854596451", "user_id": "u506671931"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function Main(input) {\n var nums = input.split('\\n');\n \n var keta = Math.floor(nums[0]);\n \n function product_Range(a, b) {\n var prd = a,\n i = a;\n \n while (i++ < b) {\n prd *= i;\n }\n return prd;\n }\n \n function combinations(n, r) {\n if (n == r) {\n return 1;\n } else {\n r = r < n - r ? n - r : r;\n return product_Range(r + 1, n) / product_Range(1, n - r);\n }\n }\n \n var ans = combinations(keta, keta - 3) - (keta - 3);\n \n console.log(ans);\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "sample_input": "4\n0224\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02844", "source_text": "Score: 400 points\n\nProblem Statement\n\nAtCoder Inc. has decided to lock the door of its office with a 3-digit PIN code.\n\nThe company has an N-digit lucky number, S. Takahashi, the president, will erase N-3 digits from S and concatenate the remaining 3 digits without changing the order to set the PIN code.\n\nHow many different PIN codes can he set this way?\n\nBoth the lucky number and the PIN code may begin with a 0.\n\nConstraints\n\n4 \\leq N \\leq 30000\n\nS is a string of length N consisting of digits.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the number of different PIN codes Takahashi can set.\n\nSample Input 1\n\n4\n0224\n\nSample Output 1\n\n3\n\nTakahashi has the following options:\n\nErase the first digit of S and set 224.\n\nErase the second digit of S and set 024.\n\nErase the third digit of S and set 024.\n\nErase the fourth digit of S and set 022.\n\nThus, he can set three different PIN codes: 022, 024, and 224.\n\nSample Input 2\n\n6\n123123\n\nSample Output 2\n\n17\n\nSample Input 3\n\n19\n3141592653589793238\n\nSample Output 3\n\n329", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 553, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s189566363", "group_id": "codeNet:p02848", "input_text": "\"use strict\";\nvar GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var s = o.a(1);\n s = s.split(\"\");\n for(var i = 0; i < s.length; i++){\n s[i] = String.fromCharCode((s[i].charCodeAt()-65+n)%26+65);\n }\n return s.join(\"\");\n}", "language": "JavaScript", "metadata": {"date": 1574647494, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02848.html", "problem_id": "p02848", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02848/input.txt", "sample_output_relpath": "derived/input_output/data/p02848/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02848/JavaScript/s189566363.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s189566363", "user_id": "u643613120"}, "prompt_components": {"gold_output": "CDEZAB\n", "input_to_evaluate": "\"use strict\";\nvar GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var s = o.a(1);\n s = s.split(\"\");\n for(var i = 0; i < s.length; i++){\n s[i] = String.fromCharCode((s[i].charCodeAt()-65+n)%26+65);\n }\n return s.join(\"\");\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "sample_input": "2\nABCXYZ\n"}, "reference_outputs": ["CDEZAB\n"], "source_document_id": "p02848", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a string S consisting of uppercase English letters. Additionally, an integer N will be given.\n\nShift each character of S by N in alphabetical order (see below), and print the resulting string.\n\nWe assume that A follows Z. For example, shifting A by 2 results in C (A \\to B \\to C), and shifting Y by 3 results in B (Y \\to Z \\to A \\to B).\n\nConstraints\n\n0 \\leq N \\leq 26\n\n1 \\leq |S| \\leq 10^4\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the string resulting from shifting each character of S by N in alphabetical order.\n\nSample Input 1\n\n2\nABCXYZ\n\nSample Output 1\n\nCDEZAB\n\nNote that A follows Z.\n\nSample Input 2\n\n0\nABCXYZ\n\nSample Output 2\n\nABCXYZ\n\nSample Input 3\n\n13\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n\nSample Output 3\n\nNOPQRSTUVWXYZABCDEFGHIJKLM", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1056, "cpu_time_ms": 1317, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s715789885", "group_id": "codeNet:p02860", "input_text": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', function(inputStdin) {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', function() {\n inputString = inputString.split('\\n');\n main();\n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n \n// main funtion .. code start ..... ///\nfunction main() {\n \n var T = parseInt(readline());\n var str = readline();\n \n var res1 = str.slice(0, Math.floor(T/2));\n var res2 = str.slice(T/2);\n \n if(str.length === 1 ) console.log('No');\n else console.log(res1 === res2 ? 'Yes': 'No');\n \n}", "language": "JavaScript", "metadata": {"date": 1576483579, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02860/input.txt", "sample_output_relpath": "derived/input_output/data/p02860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02860/JavaScript/s715789885.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s715789885", "user_id": "u018679195"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', function(inputStdin) {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', function() {\n inputString = inputString.split('\\n');\n main();\n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n \n// main funtion .. code start ..... ///\nfunction main() {\n \n var T = parseInt(readline());\n var str = readline();\n \n var res1 = str.slice(0, Math.floor(T/2));\n var res2 = str.slice(T/2);\n \n if(str.length === 1 ) console.log('No');\n else console.log(res1 === res2 ? 'Yes': 'No');\n \n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "sample_input": "6\nabcabc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02860", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 677, "cpu_time_ms": 56, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s928148411", "group_id": "codeNet:p02860", "input_text": "function main(input) {\n var inputs = input.split('\\n');\n var num = parseInt(inputs[0],10);\n var str = inputs[1];\n var strhalf = str.substring(0,num/2);\n if(str == (strhalf + strhalf))\n console.log('Yes');\n else\n console.log('No');\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1574670846, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02860/input.txt", "sample_output_relpath": "derived/input_output/data/p02860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02860/JavaScript/s928148411.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s928148411", "user_id": "u972726147"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function main(input) {\n var inputs = input.split('\\n');\n var num = parseInt(inputs[0],10);\n var str = inputs[1];\n var strhalf = str.substring(0,num/2);\n if(str == (strhalf + strhalf))\n console.log('Yes');\n else\n console.log('No');\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "sample_input": "6\nabcabc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02860", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 322, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s886863313", "group_id": "codeNet:p02860", "input_text": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', function(inputStdin) {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', function() {\n inputString = inputString.split('\\n');\n main();\n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n \n// main funtion .. code start ..... ///\nfunction main() {\n \n var T = parseInt(readline());\n var str = readline();\n \n var res1 = str.slice(0, Math.floor(T/2));\n var res2 = str.slice(T/2);\n \n if(str.length === 1) print('No');\n print(res1 === res2 ? 'Yes': 'No');\n}", "language": "JavaScript", "metadata": {"date": 1573957799, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02860.html", "problem_id": "p02860", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02860/input.txt", "sample_output_relpath": "derived/input_output/data/p02860/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02860/JavaScript/s886863313.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s886863313", "user_id": "u972726147"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', function(inputStdin) {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', function() {\n inputString = inputString.split('\\n');\n main();\n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n \n// main funtion .. code start ..... ///\nfunction main() {\n \n var T = parseInt(readline());\n var str = readline();\n \n var res1 = str.slice(0, Math.floor(T/2));\n var res2 = str.slice(T/2);\n \n if(str.length === 1) print('No');\n print(res1 === res2 ? 'Yes': 'No');\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "sample_input": "6\nabcabc\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02860", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven are a positive integer N and a string S of length N consisting of lowercase English letters.\n\nDetermine whether the string is a concatenation of two copies of some string.\nThat is, determine whether there is a string T such that S = T + T.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nS consists of lowercase English letters.\n\n|S| = N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nIf S is a concatenation of two copies of some string, print Yes; otherwise, print No.\n\nSample Input 1\n\n6\nabcabc\n\nSample Output 1\n\nYes\n\nLet T = abc, and S = T + T.\n\nSample Input 2\n\n6\nabcadc\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n1\nz\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 657, "cpu_time_ms": 203, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s724438271", "group_id": "codeNet:p02861", "input_text": "function Main(input) {\n var lines = input.split(\"\\n\").filter(v=>v!=='')\n var body = lines.slice(1)\n\n var n = +lines.slice(0,1)\n var poss = body.map(s=>s.split(' ').map(v=>+v))\n var cache = {}\n var sum = 0\n\n let diff = (x1,y1,x2,y2) => {\n var v = Math.sqrt(((x1-x2)**2) + ((y1-y2)**2))\n console.log({x1,y1,x2,y2,v})\n return v\n }\n\n let f = (past_poss,use_poss) => {\n if(use_poss.length == 0) {\n let d = 0;\n for(var i=1;i{\n //sum += diff(x,y,_x,_y)\n f([...past_poss,_pos],use_poss.filter(__pos=>__pos.toString() != _pos.toString()))\n })\n }\n poss.forEach(_pos=>{\n f([_pos],poss.filter(__pos=>__pos.toString() != _pos.toString()))\n })\n var b = 1\n for(;n>0;n--){\n b *= n\n }\n console.log(sum/b)\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1573962000, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02861.html", "problem_id": "p02861", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02861/input.txt", "sample_output_relpath": "derived/input_output/data/p02861/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02861/JavaScript/s724438271.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s724438271", "user_id": "u546278104"}, "prompt_components": {"gold_output": "2.2761423749\n", "input_to_evaluate": "function Main(input) {\n var lines = input.split(\"\\n\").filter(v=>v!=='')\n var body = lines.slice(1)\n\n var n = +lines.slice(0,1)\n var poss = body.map(s=>s.split(' ').map(v=>+v))\n var cache = {}\n var sum = 0\n\n let diff = (x1,y1,x2,y2) => {\n var v = Math.sqrt(((x1-x2)**2) + ((y1-y2)**2))\n console.log({x1,y1,x2,y2,v})\n return v\n }\n\n let f = (past_poss,use_poss) => {\n if(use_poss.length == 0) {\n let d = 0;\n for(var i=1;i{\n //sum += diff(x,y,_x,_y)\n f([...past_poss,_pos],use_poss.filter(__pos=>__pos.toString() != _pos.toString()))\n })\n }\n poss.forEach(_pos=>{\n f([_pos],poss.filter(__pos=>__pos.toString() != _pos.toString()))\n })\n var b = 1\n for(;n>0;n--){\n b *= n\n }\n console.log(sum/b)\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "sample_input": "3\n0 0\n1 0\n0 1\n"}, "reference_outputs": ["2.2761423749\n"], "source_document_id": "p02861", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N towns in a coordinate plane. Town i is located at coordinates (x_i, y_i). The distance between Town i and Town j is \\sqrt{\\left(x_i-x_j\\right)^2+\\left(y_i-y_j\\right)^2}.\n\nThere are N! possible paths to visit all of these towns once. Let the length of a path be the distance covered when we start at the first town in the path, visit the second, third, \\dots, towns, and arrive at the last town (assume that we travel in a straight line from a town to another). Compute the average length of these N! paths.\n\nConstraints\n\n2 \\leq N \\leq 8\n\n-1000 \\leq x_i \\leq 1000\n\n-1000 \\leq y_i \\leq 1000\n\n\\left(x_i, y_i\\right) \\neq \\left(x_j, y_j\\right) (if i \\neq j)\n\n(Added 21:12 JST) All values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\n:\nx_N y_N\n\nOutput\n\nPrint the average length of the paths.\nYour output will be judges as correct when the absolute difference from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n3\n0 0\n1 0\n0 1\n\nSample Output 1\n\n2.2761423749\n\nThere are six paths to visit the towns: 1 → 2 → 3, 1 → 3 → 2, 2 → 1 → 3, 2 → 3 → 1, 3 → 1 → 2, and 3 → 2 → 1.\n\nThe length of the path 1 → 2 → 3 is \\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} + \\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the average length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6} = 2.276142...\n\nSample Input 2\n\n2\n-879 981\n-866 890\n\nSample Output 2\n\n91.9238815543\n\nThere are two paths to visit the towns: 1 → 2 and 2 → 1. These paths have the same length.\n\nSample Input 3\n\n8\n-406 10\n512 859\n494 362\n-955 -475\n128 553\n-986 -885\n763 77\n449 310\n\nSample Output 3\n\n7641.9817824387", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1204, "cpu_time_ms": 253, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s810509346", "group_id": "codeNet:p02865", "input_text": "function main(input) {\n var s = input[0]-0;\n console.log(Math.ceil(s/2));\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').split(\"\\n\"))\n", "language": "JavaScript", "metadata": {"date": 1573502504, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02865.html", "problem_id": "p02865", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02865/input.txt", "sample_output_relpath": "derived/input_output/data/p02865/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02865/JavaScript/s810509346.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s810509346", "user_id": "u816097281"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function main(input) {\n var s = input[0]-0;\n console.log(Math.ceil(s/2));\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').split(\"\\n\"))\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "sample_input": "4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02865", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 146, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s105448065", "group_id": "codeNet:p02865", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0]);\n \n console.log(Math.ceil(N / 2) - 1);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1573351400, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02865.html", "problem_id": "p02865", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02865/input.txt", "sample_output_relpath": "derived/input_output/data/p02865/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02865/JavaScript/s105448065.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s105448065", "user_id": "u598795006"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0]);\n \n console.log(Math.ceil(N / 2) - 1);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "sample_input": "4\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02865", "source_text": "Score : 100 points\n\nProblem Statement\n\nHow many ways are there to choose two distinct positive integers totaling N, disregarding the order?\n\nConstraints\n\n1 \\leq N \\leq 10^6\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n1\n\nThere is only one way to choose two distinct integers totaling 4: to choose 1 and 3. (Choosing 3 and 1 is not considered different from this.)\n\nSample Input 2\n\n999999\n\nSample Output 2\n\n499999", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 208, "cpu_time_ms": 183, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s141382695", "group_id": "codeNet:p02880", "input_text": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nN = lines.shift() * 1\n\nbool = false\nfor(i=1; i<=9; i++) {\n d = N/i\n if (d <= 9 && d == ~~d) {\n bool = true\n break;\n }\n}\nconsole.log(bool ? 'Yes' : 'No')\n", "language": "JavaScript", "metadata": {"date": 1572224696, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02880.html", "problem_id": "p02880", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02880/input.txt", "sample_output_relpath": "derived/input_output/data/p02880/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02880/JavaScript/s141382695.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s141382695", "user_id": "u461478706"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nN = lines.shift() * 1\n\nbool = false\nfor(i=1; i<=9; i++) {\n d = N/i\n if (d <= 9 && d == ~~d) {\n bool = true\n break;\n }\n}\nconsole.log(bool ? 'Yes' : 'No')\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "sample_input": "10\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02880", "source_text": "Score : 200 points\n\nProblem Statement\n\nHaving learned the multiplication table, Takahashi can multiply two integers between 1 and 9 (inclusive) together.\n\nGiven an integer N, determine whether N can be represented as the product of two integers between 1 and 9. If it can, print Yes; if it cannot, print No.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf N can be represented as the product of two integers between 1 and 9 (inclusive), print Yes; if it cannot, print No.\n\nSample Input 1\n\n10\n\nSample Output 1\n\nYes\n\n10 can be represented as, for example, 2 \\times 5.\n\nSample Input 2\n\n50\n\nSample Output 2\n\nNo\n\n50 cannot be represented as the product of two integers between 1 and 9.\n\nSample Input 3\n\n81\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 259, "cpu_time_ms": 1106, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s847354720", "group_id": "codeNet:p02882", "input_text": "function Main(input) {\n input.trim().split(\"\\n\").forEach(line => {\n var nums = line.split(\" \").map(i => parseInt(i));\n var a = nums[0];\n var b = nums[1];\n var x = nums[2];\n var tan;\n if (a * a * b / 2 === x) {\n tan = b / a;\n } else if (a * a * b / 2 < x) {\n tan = a * a / 2 / (a * b - x / a)\n } else {\n tan = 2 * x / a / b / b\n }\n\n console.log(tan, (360 + 90 - Math.atan(tan) * 180 / Math.PI) % 360);\n });\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\nvar globalInput = '';\nprocess.stdin.on('data', function(chunk) {\n globalInput += chunk;\n})\nprocess.stdin.on('end', function() {\n Main(globalInput)\n})\n\n// Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1573700395, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02882.html", "problem_id": "p02882", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02882/input.txt", "sample_output_relpath": "derived/input_output/data/p02882/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02882/JavaScript/s847354720.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s847354720", "user_id": "u384026846"}, "prompt_components": {"gold_output": "45.0000000000\n", "input_to_evaluate": "function Main(input) {\n input.trim().split(\"\\n\").forEach(line => {\n var nums = line.split(\" \").map(i => parseInt(i));\n var a = nums[0];\n var b = nums[1];\n var x = nums[2];\n var tan;\n if (a * a * b / 2 === x) {\n tan = b / a;\n } else if (a * a * b / 2 < x) {\n tan = a * a / 2 / (a * b - x / a)\n } else {\n tan = 2 * x / a / b / b\n }\n\n console.log(tan, (360 + 90 - Math.atan(tan) * 180 / Math.PI) % 360);\n });\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\nvar globalInput = '';\nprocess.stdin.on('data', function(chunk) {\n globalInput += chunk;\n})\nprocess.stdin.on('end', function() {\n Main(globalInput)\n})\n\n// Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\n\nWe will pour x~\\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.\n\nWhen will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq a \\leq 100\n\n1 \\leq b \\leq 100\n\n1 \\leq x \\leq a^2b\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the maximum angle in which we can tilt the bottle without spilling any water, in degrees.\nYour output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n2 2 4\n\nSample Output 1\n\n45.0000000000\n\nThis bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.\n\nSample Input 2\n\n12 21 10\n\nSample Output 2\n\n89.7834636934\n\nThis bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.\n\nSample Input 3\n\n3 1 8\n\nSample Output 3\n\n4.2363947991\n\nThis bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.", "sample_input": "2 2 4\n"}, "reference_outputs": ["45.0000000000\n"], "source_document_id": "p02882", "source_text": "Score : 400 points\n\nProblem Statement\n\nTakahashi has a water bottle with the shape of a rectangular prism whose base is a square of side a~\\mathrm{cm} and whose height is b~\\mathrm{cm}. (The thickness of the bottle can be ignored.)\n\nWe will pour x~\\mathrm{cm}^3 of water into the bottle, and gradually tilt the bottle around one of the sides of the base.\n\nWhen will the water be spilled? More formally, find the maximum angle in which we can tilt the bottle without spilling any water.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq a \\leq 100\n\n1 \\leq b \\leq 100\n\n1 \\leq x \\leq a^2b\n\nInput\n\nInput is given from Standard Input in the following format:\n\na b x\n\nOutput\n\nPrint the maximum angle in which we can tilt the bottle without spilling any water, in degrees.\nYour output will be judged as correct when the absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n2 2 4\n\nSample Output 1\n\n45.0000000000\n\nThis bottle has a cubic shape, and it is half-full. The water gets spilled when we tilt the bottle more than 45 degrees.\n\nSample Input 2\n\n12 21 10\n\nSample Output 2\n\n89.7834636934\n\nThis bottle is almost empty. When the water gets spilled, the bottle is nearly horizontal.\n\nSample Input 3\n\n3 1 8\n\nSample Output 3\n\n4.2363947991\n\nThis bottle is almost full. When the water gets spilled, the bottle is still nearly vertical.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 792, "cpu_time_ms": 63, "memory_kb": 8140}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s676654896", "group_id": "codeNet:p02885", "input_text": "function main(input) {\n const args = input.split(' ');\n const A = parseInt(args[0], 10),\n B = parseInt(args[1], 10);\n const left = A - B * 2;\n if (left < 0) console.log(0);\n console.log(left);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1584232058, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02885.html", "problem_id": "p02885", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02885/input.txt", "sample_output_relpath": "derived/input_output/data/p02885/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02885/JavaScript/s676654896.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s676654896", "user_id": "u264201579"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "function main(input) {\n const args = input.split(' ');\n const A = parseInt(args[0], 10),\n B = parseInt(args[1], 10);\n const left = A - B * 2;\n if (left < 0) console.log(0);\n console.log(left);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\n\nWe will close the window so as to minimize the total horizontal length of the uncovered part of the window.\nFind the total horizontal length of the uncovered parts of the window then.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the total horizontal length of the uncovered parts of the window.\n\nSample Input 1\n\n12 4\n\nSample Output 1\n\n4\n\nWe have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.\n\nSample Input 2\n\n20 15\n\nSample Output 2\n\n0\n\nIf the window is completely covered, print 0.\n\nSample Input 3\n\n20 30\n\nSample Output 3\n\n0\n\nEach curtain may be longer than the window.", "sample_input": "12 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02885", "source_text": "Score : 100 points\n\nProblem Statement\n\nThe window of Takahashi's room has a width of A. There are two curtains hung over the window, each of which has a horizontal length of B. (Vertically, the curtains are long enough to cover the whole window.)\n\nWe will close the window so as to minimize the total horizontal length of the uncovered part of the window.\nFind the total horizontal length of the uncovered parts of the window then.\n\nConstraints\n\n1 \\leq A \\leq 100\n\n1 \\leq B \\leq 100\n\nA and B are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the total horizontal length of the uncovered parts of the window.\n\nSample Input 1\n\n12 4\n\nSample Output 1\n\n4\n\nWe have a window with a horizontal length of 12, and two curtains, each of length 4, that cover both ends of the window, for example. The uncovered part has a horizontal length of 4.\n\nSample Input 2\n\n20 15\n\nSample Output 2\n\n0\n\nIf the window is completely covered, print 0.\n\nSample Input 3\n\n20 30\n\nSample Output 3\n\n0\n\nEach curtain may be longer than the window.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 274, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s324971257", "group_id": "codeNet:p02889", "input_text": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input, \"index\" : 0, \"max\" : input.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n }\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var one = nextIntArray();\n var N = one[0];\n var M = one[1];\n var L = one[2];\n var kyori = new Array(N);\n var max = Math.pow(10,15);\n for(var i = 0; i < N; i++){\n kyori[i] = new Array(N).fill(max);\n kyori[i][i] = 0;\n }\n var list = new Array(M);\n for(var i = 0; i < M; i++){\n list[i] = nextIntArray();\n kyori[list[i][0] - 1][list[i][1] - 1] = list[i][2];\n kyori[list[i][1] - 1][list[i][0] - 1] = list[i][2];\n }\n for(var k = 0; k < N; k++){\n for(var i = 0; i < N; i++){\n for(var j = 0; j < N; j++){\n if(kyori[i][j] > kyori[i][k] + kyori[k][j]){\n kyori[i][j] = kyori[i][k] + kyori[k][j];\n }\n }\n }\n }\n var count = new Array(N);\n for(var i = 0; i < N; i++){\n count[i] = new Array(N).fill(max);\n for(var j = 0; j < N; j++){\n if(kyori[i][j] <= L){\n count[i][j] = 1;\n }else{\n count[i][j] = max;\n }\n }\n count[i][i] = 0;\n }\n for(var k = 0; k < N; k++){\n for(var i = 0; i < N; i++){\n for(var j = 0; j < N; j++){\n if(count[i][j] > count[i][k] + count[k][j]){\n count[i][j] = count[i][k] + count[k][j];\n }\n }\n }\n }\n //myerr(kyori);\n //myerr(count);\n var Q = nextInt();\n var output = new Array(Q);\n for(var i = 0; i < Q; i++){\n var query = nextIntArray();\n query[0]--;\n query[1]--;\n var getCount = count[query[0]][query[1]];\n if(getCount >= max){\n getCount = 0;\n }\n output[i] = getCount - 1;\n }\n myout(myconv(output,9));\n}", "language": "JavaScript", "metadata": {"date": 1584591782, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02889.html", "problem_id": "p02889", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02889/input.txt", "sample_output_relpath": "derived/input_output/data/p02889/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02889/JavaScript/s324971257.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s324971257", "user_id": "u222822036"}, "prompt_components": {"gold_output": "0\n1\n", "input_to_evaluate": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input, \"index\" : 0, \"max\" : input.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n }\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var one = nextIntArray();\n var N = one[0];\n var M = one[1];\n var L = one[2];\n var kyori = new Array(N);\n var max = Math.pow(10,15);\n for(var i = 0; i < N; i++){\n kyori[i] = new Array(N).fill(max);\n kyori[i][i] = 0;\n }\n var list = new Array(M);\n for(var i = 0; i < M; i++){\n list[i] = nextIntArray();\n kyori[list[i][0] - 1][list[i][1] - 1] = list[i][2];\n kyori[list[i][1] - 1][list[i][0] - 1] = list[i][2];\n }\n for(var k = 0; k < N; k++){\n for(var i = 0; i < N; i++){\n for(var j = 0; j < N; j++){\n if(kyori[i][j] > kyori[i][k] + kyori[k][j]){\n kyori[i][j] = kyori[i][k] + kyori[k][j];\n }\n }\n }\n }\n var count = new Array(N);\n for(var i = 0; i < N; i++){\n count[i] = new Array(N).fill(max);\n for(var j = 0; j < N; j++){\n if(kyori[i][j] <= L){\n count[i][j] = 1;\n }else{\n count[i][j] = max;\n }\n }\n count[i][i] = 0;\n }\n for(var k = 0; k < N; k++){\n for(var i = 0; i < N; i++){\n for(var j = 0; j < N; j++){\n if(count[i][j] > count[i][k] + count[k][j]){\n count[i][j] = count[i][k] + count[k][j];\n }\n }\n }\n }\n //myerr(kyori);\n //myerr(count);\n var Q = nextInt();\n var output = new Array(Q);\n for(var i = 0; i < Q; i++){\n var query = nextIntArray();\n query[0]--;\n query[1]--;\n var getCount = count[query[0]][query[1]];\n if(getCount >= max){\n getCount = 0;\n }\n output[i] = getCount - 1;\n }\n myout(myconv(output,9));\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N towns numbered 1 to N and M roads. The i-th road connects Town A_i and Town B_i bidirectionally and has a length of C_i.\n\nTakahashi will travel between these towns by car, passing through these roads. The fuel tank of his car can contain at most L liters of fuel, and one liter of fuel is consumed for each unit distance traveled. When visiting a town while traveling, he can full the tank (or choose not to do so). Travel that results in the tank becoming empty halfway on the road cannot be done.\n\nProcess the following Q queries:\n\nThe tank is now full. Find the minimum number of times he needs to full his tank while traveling from Town s_i to Town t_i. If Town t_i is unreachable, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 300\n\n0 \\leq M \\leq \\frac{N(N-1)}{2}\n\n1 \\leq L \\leq 10^9\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\n\\left(A_i, B_i\\right) \\neq \\left(A_j, B_j\\right) (if i \\neq j)\n\n\\left(A_i, B_i\\right) \\neq \\left(B_j, A_j\\right) (if i \\neq j)\n\n1 \\leq C_i \\leq 10^9\n\n1 \\leq Q \\leq N\\left(N-1\\right)\n\n1 \\leq s_i, t_i \\leq N\n\ns_i \\neq t_i\n\n\\left(s_i, t_i\\right) \\neq \\left(s_j, t_j\\right) (if i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M L\nA_1 B_1 C_1\n:\nA_M B_M C_M\nQ\ns_1 t_1\n:\ns_Q t_Q\n\nOutput\n\nPrint Q lines.\n\nThe i-th line should contain the minimum number of times the tank needs to be fulled while traveling from Town s_i to Town t_i. If Town t_i is unreachable, the line should contain -1 instead.\n\nSample Input 1\n\n3 2 5\n1 2 3\n2 3 3\n2\n3 2\n1 3\n\nSample Output 1\n\n0\n1\n\nTo travel from Town 3 to Town 2, we can use the second road to reach Town 2 without fueling the tank on the way.\n\nTo travel from Town 1 to Town 3, we can first use the first road to get to Town 2, full the tank, and use the second road to reach Town 3.\n\nSample Input 2\n\n4 0 1\n1\n2 1\n\nSample Output 2\n\n-1\n\nThere may be no road at all.\n\nSample Input 3\n\n5 4 4\n1 2 2\n2 3 2\n3 4 3\n4 5 2\n20\n2 1\n3 1\n4 1\n5 1\n1 2\n3 2\n4 2\n5 2\n1 3\n2 3\n4 3\n5 3\n1 4\n2 4\n3 4\n5 4\n1 5\n2 5\n3 5\n4 5\n\nSample Output 3\n\n0\n0\n1\n2\n0\n0\n1\n2\n0\n0\n0\n1\n1\n1\n0\n0\n2\n2\n1\n0", "sample_input": "3 2 5\n1 2 3\n2 3 3\n2\n3 2\n1 3\n"}, "reference_outputs": ["0\n1\n"], "source_document_id": "p02889", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N towns numbered 1 to N and M roads. The i-th road connects Town A_i and Town B_i bidirectionally and has a length of C_i.\n\nTakahashi will travel between these towns by car, passing through these roads. The fuel tank of his car can contain at most L liters of fuel, and one liter of fuel is consumed for each unit distance traveled. When visiting a town while traveling, he can full the tank (or choose not to do so). Travel that results in the tank becoming empty halfway on the road cannot be done.\n\nProcess the following Q queries:\n\nThe tank is now full. Find the minimum number of times he needs to full his tank while traveling from Town s_i to Town t_i. If Town t_i is unreachable, print -1.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 300\n\n0 \\leq M \\leq \\frac{N(N-1)}{2}\n\n1 \\leq L \\leq 10^9\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\n\\left(A_i, B_i\\right) \\neq \\left(A_j, B_j\\right) (if i \\neq j)\n\n\\left(A_i, B_i\\right) \\neq \\left(B_j, A_j\\right) (if i \\neq j)\n\n1 \\leq C_i \\leq 10^9\n\n1 \\leq Q \\leq N\\left(N-1\\right)\n\n1 \\leq s_i, t_i \\leq N\n\ns_i \\neq t_i\n\n\\left(s_i, t_i\\right) \\neq \\left(s_j, t_j\\right) (if i \\neq j)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M L\nA_1 B_1 C_1\n:\nA_M B_M C_M\nQ\ns_1 t_1\n:\ns_Q t_Q\n\nOutput\n\nPrint Q lines.\n\nThe i-th line should contain the minimum number of times the tank needs to be fulled while traveling from Town s_i to Town t_i. If Town t_i is unreachable, the line should contain -1 instead.\n\nSample Input 1\n\n3 2 5\n1 2 3\n2 3 3\n2\n3 2\n1 3\n\nSample Output 1\n\n0\n1\n\nTo travel from Town 3 to Town 2, we can use the second road to reach Town 2 without fueling the tank on the way.\n\nTo travel from Town 1 to Town 3, we can first use the first road to get to Town 2, full the tank, and use the second road to reach Town 3.\n\nSample Input 2\n\n4 0 1\n1\n2 1\n\nSample Output 2\n\n-1\n\nThere may be no road at all.\n\nSample Input 3\n\n5 4 4\n1 2 2\n2 3 2\n3 4 3\n4 5 2\n20\n2 1\n3 1\n4 1\n5 1\n1 2\n3 2\n4 2\n5 2\n1 3\n2 3\n4 3\n5 3\n1 4\n2 4\n3 4\n5 4\n1 5\n2 5\n3 5\n4 5\n\nSample Output 3\n\n0\n0\n1\n2\n0\n0\n1\n2\n0\n0\n0\n1\n1\n1\n0\n0\n2\n2\n1\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2993, "cpu_time_ms": 360, "memory_kb": 53484}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s217405342", "group_id": "codeNet:p02897", "input_text": "function Main(input) {\n \n var data = input.split(\"\\n\")\n var n = parseInt(data[0]);\n var ans;\n if(n%2===0){\n ans = 1/2;\n }else{\n ans = (n+1)/2/n\n }\n \n console.log('%f\\n',ans);\n}\n//(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1582365723, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/JavaScript/s217405342.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s217405342", "user_id": "u693378622"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "function Main(input) {\n \n var data = input.split(\"\\n\")\n var n = parseInt(data[0]);\n var ans;\n if(n%2===0){\n ans = 1/2;\n }else{\n ans = (n+1)/2/n\n }\n \n console.log('%f\\n',ans);\n}\n//(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 352, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s210784928", "group_id": "codeNet:p02897", "input_text": "'use strict';\n'use strict';var d,aa=\"object\"===typeof __ScalaJSEnv&&__ScalaJSEnv?__ScalaJSEnv:{},l=\"object\"===typeof aa.global&&aa.global?aa.global:\"object\"===typeof global&&global&&global.Object===Object?global:this;aa.global=l;aa.exportsNamespace=exports;l.Object.freeze(aa);var ba={envInfo:aa,semantics:{asInstanceOfs:2,arrayIndexOutOfBounds:2,moduleInit:2,strictFloats:!1,productionMode:!0},assumingES6:!1,linkerVersion:\"0.6.29\",globalThis:this};l.Object.freeze(ba);l.Object.freeze(ba.semantics);\nvar n=l.Math.imul||function(a,b){var c=a&65535,e=b&65535;return c*e+((a>>>16&65535)*e+c*(b>>>16&65535)<<16>>>0)|0},ca=l.Math.fround||function(a){return+a},da=l.Math.clz32||function(a){if(0===a)return 32;var b=1;0===(a&4294901760)&&(a<<=16,b+=16);0===(a&4278190080)&&(a<<=8,b+=8);0===(a&4026531840)&&(a<<=4,b+=4);0===(a&3221225472)&&(a<<=2,b+=2);return b+(a>>31)},fa=0,ha=l.WeakMap?new l.WeakMap:null;\nfunction ia(a){return function(b,c){return!(!b||!b.$classData||b.$classData.ih!==c||b.$classData.hh!==a)}}function ja(a){for(var b in a)return b}function ka(a,b){return new a.Ik(b)}function r(a,b){return la(a,b,0)}function la(a,b,c){var e=new a.Ik(b[c]);if(ca?-2147483648:a|0}function Ka(a,b,c,e,f){a=a.b;c=c.b;if(a!==c||e>24===a&&1/a!==1/-0}\nfunction sa(a){return\"number\"===typeof a&&a<<16>>16===a&&1/a!==1/-0}function La(a){return\"number\"===typeof a&&(a|0)===a&&1/a!==1/-0}function wa(a){return\"number\"===typeof a}function Ma(a){return null===a?y().mg:a}function Na(){this.Ij=this.Ik=void 0;this.hh=this.Xh=this.qa=null;this.ih=0;this.Ol=null;this.bj=\"\";this.Od=this.$i=this.aj=void 0;this.name=\"\";this.isRawJSType=this.isArrayClass=this.isInterface=this.isPrimitive=!1;this.isInstance=void 0}\nfunction Oa(a,b,c){var e=new Na;e.qa={};e.Xh=null;e.Ol=a;e.bj=b;e.Od=function(){return!1};e.name=c;e.isPrimitive=!0;e.isInstance=function(){return!1};return e}function z(a,b,c,e,f,g,h,k){var m=new Na,p=ja(a);h=h||function(q){return!!(q&&q.$classData&&q.$classData.qa[p])};k=k||function(q,t){return!!(q&&q.$classData&&q.$classData.ih===t&&q.$classData.hh.qa[p])};m.Ij=g;m.qa=e;m.bj=\"L\"+c+\";\";m.Od=k;m.name=c;m.isInterface=b;m.isRawJSType=!!f;m.isInstance=h;return m}\nfunction Pa(a){function b(k){if(\"number\"===typeof k){this.b=Array(k);for(var m=0;ma.Kd?0:b):0:0f)&&G(H(),c.Dd.b[1+f|0],e.Qa());break a;e=void 0}return e}}(a))):!1}function qb(a,b,c,e){for(a=a.Dd;;){var f=a.b[c];if(f===b)return c;if(null===f)return~c;c=2+c|0;c=c>>0)).toString(16);return a+\"@\"+b};rb.prototype.z=function(){return Ia(this)};rb.prototype.toString=function(){return this.n()};function ub(a,b){if(a=a&&a.$classData){var c=a.ih||0;return!(cb||!a.hh.isPrimitive)}return!1}\nvar C=z({c:0},!1,\"java.lang.Object\",{c:1},void 0,void 0,function(a){return null!==a},ub);rb.prototype.$classData=C;function vb(a,b){if(b instanceof wb)return b=null===b?0:b.s,a.yj()&&a.Xc()===b;if(pa(b))return b|=0,a.xj()&&a.Th()===b;if(sa(b))return b|=0,a.Aj()&&a.zi()===b;if(La(b))return b|=0,a.hi()&&a.Xc()===b;if(b instanceof x){var c=Ma(b);b=c.f;c=c.i;a=a.Yc();var e=a.i;return a.f===b&&e===c}return wa(b)?(b=+b,a.Kf()===b):\"number\"===typeof b?(b=+b,a.ee()===b):!1}\nfunction xb(a,b){a=yb(a);if(!a.r())return!b.r();for(var c=zb(a);b.r();)for(var e=b.u();;){var f=e|0,g=c|0;f=f===g?0:ff||!a.r())return!1;f=!0}else f=!1;if(f)c=zb(a);else break}return!0}function I(a){var b=r(D(C),[a.b.length]);Ka(a,0,b,0,a.b.length);return b}\nfunction Ab(a,b,c){if(32>c)return a.mb().b[31&b];if(1024>c)return a.L().b[31&(b>>>5|0)].b[31&b];if(32768>c)return a.X().b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];if(1048576>c)return a.ta().b[31&(b>>>15|0)].b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];if(33554432>c)return a.gb().b[31&(b>>>20|0)].b[31&(b>>>15|0)].b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];if(1073741824>c)return a.Rc().b[31&(b>>>25|0)].b[31&(b>>>20|0)].b[31&(b>>>15|0)].b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];throw(new Bb).a();}\nfunction Cb(a,b,c){if(!(32>c))if(1024>c)a.La(a.L().b[31&(b>>>5|0)]);else if(32768>c)a.xa(a.X().b[31&(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else if(1048576>c)a.ab(a.ta().b[31&(b>>>15|0)]),a.xa(a.X().b[31&(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else if(33554432>c)a.Ib(a.gb().b[31&(b>>>20|0)]),a.ab(a.ta().b[31&(b>>>15|0)]),a.xa(a.X().b[31&(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else if(1073741824>c)a.Qc(a.Rc().b[31&(b>>>25|0)]),a.Ib(a.gb().b[31&(b>>>20|0)]),a.ab(a.ta().b[31&(b>>>15|0)]),a.xa(a.X().b[31&\n(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else throw(new Bb).a();}function Db(a,b){var c=a.b[b];a.b[b]=null;return I(c)}\nfunction Eb(a,b,c){a.Ef(c);c=-1+c|0;switch(c){case -1:break;case 0:a.La(b.mb());break;case 1:a.xa(b.L());a.La(b.mb());break;case 2:a.ab(b.X());a.xa(b.L());a.La(b.mb());break;case 3:a.Ib(b.ta());a.ab(b.X());a.xa(b.L());a.La(b.mb());break;case 4:a.Qc(b.gb());a.Ib(b.ta());a.ab(b.X());a.xa(b.L());a.La(b.mb());break;case 5:a.tg(b.Rc());a.Qc(b.gb());a.Ib(b.ta());a.ab(b.X());a.xa(b.L());a.La(b.mb());break;default:throw(new J).j(c);}}function Fb(a){return null===a?Gb():a}\nfunction Hb(a){return a===Gb()?null:a}function Ib(){}Ib.prototype=new A;Ib.prototype.constructor=Ib;Ib.prototype.a=function(){return this};function Jb(a,b){Kb||(Kb=(new Lb).a());var c=Kb.Io;Mb();return(new Nb).ge(Ob(function(e,f,g){return function(){var h=Pb().Xn;Qb();var k=new Rb;k.la=f;k.Po=g;k=k.Po.Jo(k.la);Sb(h,null===k?\"null\":k);Sb(h,\"\\n\")}}(a,b,c)))}\nfunction Tb(a,b){b.w();b.w();var c=b.cb();b=function(){return function(h){if(null!==h)return(new Ub).af((new K).Q(h.bk(),h.dk()));throw(new J).j(h);}}(a);var e=L().G;if(e===L().G)if(c===M())b=M();else{e=c.w();var f=e=Vb(new N,b(e),M());for(c=c.cb();c!==M();){var g=c.w();g=Vb(new N,b(g),M());f=f.uc=g;c=c.cb()}b=e}else{for(e=Wb(c,e);!c.m();)f=c.w(),e.Ta(b(f)),c=c.cb();b=e.Ca()}c=Xb();e=Yb();mb||(mb=(new Zb).a());b=lb(b,c,e);b=$b(b);a=ac(b,F(function(){return function(h){Qb();var k=new bc;k.Hl=h.ac;\nh=k.na();k=Qb().dj;return cc(dc(h,k),0)}}(a)));a:{for(;a.r();){b=a.u();c=ec(b.ac.Za);for(e=!0;e&&c.r();)e=c.u(),Qb(),f=fc(e),g=L().G,f=O(f,g),f=gc(f),g=Qb().dj,cc(dc(f,g),1)?(Qb(),e=hc(e),f=L().G,e=O(e,f),e=gc(e),f=Qb().dj,e=cc(dc(e,f),1)):e=!1;if(e){a=(new Q).j(b);break a}}a=R()}if(a.m())a=R();else{a=a.Nb().ac;b=ic();b=jc(b);b=Wb(a,b);for(a=ec(a.Za);a.r();)c=a.u(),b.Ta(c.E|0);a=(new Q).j(b.Ca().lb())}return kc(a)}\nfunction lc(a){r(D(oa),[0]);Mb();a=(new Nb).ge(Ob(function(){return function(){return ib.readFileSync(\"/dev/stdin\",\"utf8\")}}(a)));var b=mc();return nc().Oh(a,b)}function oc(a,b){var c=pc();return(new qc).ge(Ob(function(e,f){return function(){return f}}(a,c))).lf().Xe(b)}Ib.prototype.$classData=z({Yo:0},!1,\"atcoder.ABC142F$\",{Yo:1,c:1});var rc=void 0;function sc(){rc||(rc=(new Ib).a());return rc}function tc(){}tc.prototype=new A;tc.prototype.constructor=tc;tc.prototype.a=function(){return this};\nfunction uc(a,b,c){if(M().t(b))return Qb(),c=M(),vc(),(new wc).j(c);if(b instanceof N)return a=b.uc,b=c.Xe(b.th),b instanceof wc?(b=b.E,c=uc(xc(),a,c),c instanceof wc?(new wc).j(Vb(new N,b,c.E)):c):b;throw(new J).j(b);}\nfunction yc(){var a=xc();return(new zc).j(function(){return function(b){if(\"\"===b){Qb();var c=Ac();vc();return(new wc).j(c)}Qb();c=(new Bc).h(\"Cannot convert '\");b=(new Bc).h(b);var e=Cc().Nh;c=Dc(c,b,e);c=(new Bc).h(c);b=(new Bc).h(\"' to HNil\");e=Cc().Nh;c=(new Ec).h(Dc(c,b,e));vc();return(new Fc).j(c)}}(a))}function Gc(a,b){return(new Hc).j(function(c,e){return function(f){xc();f=Ic(Fa(),f,\"\\n\");for(var g=-1+f.b.length|0,h=M();0<=g;)h=Vb(new N,f.b[g],h),g=-1+g|0;return uc(0,h,e)}}(a,b))}\nfunction Jc(a,b,c){return(new Kc).j(function(e,f){return function(g){g=f.Xe(g);return g instanceof wc?(new wc).j(Lc(g.E)):g}}(a,c,b))}\nfunction Mc(a,b,c){return(new Nc).j(function(e,f,g){return function(h){for(var k=(new Bc).h(h),m=k.ob.length|0,p=0;;){if(p>24;vc();(new wc).j(void 0);this.ma=(2|this.ma)<<24>>24;(new od).j(void 0);this.ma=(4|this.ma)<<24>>24;this.ma=(8|this.ma)<<24>>24;return this};ld.prototype.$classData=z({Xp:0},!1,\"cats.effect.internals.Callback$\",{Xp:1,c:1});var md=void 0;function pd(){md||(md=(new ld).a());return md}function qd(){}\nqd.prototype=new A;qd.prototype.constructor=qd;qd.prototype.a=function(){return this};function rd(a,b){if(!b.r())return sd();Mb();return(new td).ge(Ob(function(c,e){return function(){return ud((new vd).bl(e))}}(a,b)))}qd.prototype.$classData=z({Zp:0},!1,\"cats.effect.internals.CancelUtils$\",{Zp:1,c:1});var wd=void 0;function xd(){}xd.prototype=new A;xd.prototype.constructor=xd;function yd(){}yd.prototype=xd.prototype;function zd(){this.Qo=null;this.ma=!1}zd.prototype=new A;\nzd.prototype.constructor=zd;zd.prototype.a=function(){Ad=this;this.Qo=(new Cd).a();this.ma=!0;return this};zd.prototype.$classData=z({bq:0},!1,\"cats.effect.internals.IOConnection$\",{bq:1,c:1});var Ad=void 0;function Dd(){Ad||(Ad=(new zd).a());return Ad}function Ed(){}Ed.prototype=new A;Ed.prototype.constructor=Ed;Ed.prototype.a=function(){return this};Ed.prototype.$classData=z({fq:0},!1,\"cats.effect.internals.IOPlatform$\",{fq:1,c:1});var Fd=void 0;function Gd(){this.Pn=0;this.ma=!1}Gd.prototype=new A;\nGd.prototype.constructor=Gd;function Hd(a,b){if(null!==a)return a;if(null===b)return null;for(;;)return a=Id(b),null===a?null:a}Gd.prototype.a=function(){this.Pn=512;this.ma=!0;return this};function Jd(a,b){if(a instanceof Kd)return a;if(null===b)return null;for(;;){a=Id(b);if(null===a)return null;if(a instanceof Kd)return a}}function Ld(a,b,c,e){return null!==c||null!==e&&!e.m()?Md(new Nd,Od(function(f,g,h,k){return function(m,p){Pd(Qd(),g,m,p,null,h,k)}}(a,b,c,e))):b}\nfunction Rd(a){try{return Sd(a)}catch(c){a=Yc(S(),c);if(null!==a){var b=Td(Ud(),a);if(!b.m())return a=b.Nb(),Vd(a);throw T(S(),a);}throw c;}}\nfunction Pd(a,b,c,e,f,g,h){var k=b;b=g;var m=!1,p=null;for(g=0;;){var q=k;if(q instanceof Wd)k=q.Xb,q=q.Jb,null!==b&&(null===h&&(h=(new Xd).a()),Yd(h,b)),b=q;else if(q instanceof Zd)p=q.yf,m=!0;else if(q instanceof Nb){q=q.Ed;try{p=Sd(q),m=!0,k=null}catch(ea){if(k=Yc(S(),ea),null!==k){q=Td(Ud(),k);if(q.m())throw T(S(),k);k=q.Nb();k=Vd(k)}else throw ea;}}else if(q instanceof td)a:try{k=Sd(q.Ed)}catch(ea){k=Yc(S(),ea);if(null!==k){q=Td(Ud(),k);if(!q.m()){k=q.Nb();k=Vd(k);break a}throw T(S(),k);}throw ea;\n}else if(q instanceof $d){k=q.Gf;b=Jd(b,h);if(null===b){e.l((vc(),(new Fc).j(k)));break}try{var t=b.ml(k)}catch(ea){if(t=Yc(S(),ea),null!==t){b=Td(Ud(),t);if(b.m())throw T(S(),t);t=b.Nb();t=Vd(t)}else throw ea;}b=null;k=t}else if(q instanceof ae)k=q,q=k.Xb,null!==b&&(null===h&&(h=(new Xd).a()),Yd(h,b)),b=k,k=q;else{if(q instanceof Nd){a=q;null===c&&(Dd(),c=(new be).a());null===f&&(f=(new ce).Yk(c,e));e=f;c=b;e.pg=!0;e.Ek=c;e.Fk=h;e.Ml=a.Dh;de(a.vh,e.xe,e);break}if(q instanceof ee){var u=q.Xb;k=q.qi;\nvar v=q.Hg;q=null!==c?c:(Dd(),(new be).a());c=k.l(q);k=u;if(c!==q&&(null!==f&&(f.xe=c),null!==v)){k=new Wd;var B=new fe;B.ll=q;B.Hg=v;k=ge(k,u,B)}}else throw(new J).j(q);}if(m){b=Hd(b,h);if(null===b){vc();e.l((new wc).j(p));break}try{var P=b.l(p)}catch(ea){if(P=Yc(S(),ea),null!==P){b=Td(Ud(),P);if(b.m())throw T(S(),P);P=b.Nb();P=Vd(P)}else throw ea;}m=!1;b=p=null;k=P}g=1+g|0;if(g===a.Pn){if(c.el())break;g=0}}}\nfunction he(a,b){b=(new ie).j(b);var c=(new ie).j(null),e=(new ie).j(null),f=!1,g=null;for(g=null;;){var h=b.o;if(h instanceof Wd){var k=h;h=k.Xb;k=k.Jb;null!==c.o&&(null===e.o&&(e.o=(new Xd).a()),Yd(e.o,c.o));c.o=k;b.o=h}else if(h instanceof Zd)g=h.yf,f=!0;else if(h instanceof Nb){h=h.Ed;try{g=Sd(h),f=!0,b.o=null}catch(q){if(h=Yc(S(),q),null!==h){k=Td(Ud(),h);if(k.m())throw T(S(),h);h=k.Nb();b.o=Vd(h)}else throw q;}}else if(h instanceof td)b.o=Rd(h.Ed);else if(h instanceof $d){h=h.Gf;k=Jd(c.o,e.o);\nif(null===k)return b.o;try{var m=k.ml(h)}catch(q){if(m=Yc(S(),q),null!==m){h=Td(Ud(),m);if(h.m())throw T(S(),m);m=h.Nb();m=Vd(m)}else throw q;}c.o=null;b.o=m}else if(h instanceof ae)k=h.Xb,null!==c.o&&(null===e.o&&(e.o=(new Xd).a()),Yd(e.o,c.o)),c.o=h,b.o=k;else return h instanceof Nd?Ld(a,b.o,c.o,e.o):Md(new Nd,Od(function(q,t,u,v){return function(B,P){Pd(Qd(),t.o,B,P,null,u.o,v.o)}}(a,b,c,e)));if(f){f=Hd(c.o,e.o);if(null===f)return null!==b.o?b.o:(new Zd).j(g);try{var p=f.l(g)}catch(q){if(p=Yc(S(),\nq),null!==p){g=Td(Ud(),p);if(g.m())throw T(S(),p);p=g.Nb();p=Vd(p)}else throw q;}b.o=p;f=!1;g=null;c.o=null}}}Gd.prototype.$classData=z({hq:0},!1,\"cats.effect.internals.IORunLoop$\",{hq:1,c:1});var je=void 0;function Qd(){je||(je=(new Gd).a());return je}function ke(){this.Nn=null;this.q=!1}ke.prototype=new A;ke.prototype.constructor=ke;ke.prototype.a=function(){return this};function nd(){le||(le=(new ke).a());var a=le;a.q||a.q||(a.Nn=me(),a.q=!0);return a.Nn}\nke.prototype.$classData=z({kq:0},!1,\"cats.effect.internals.Logger$\",{kq:1,c:1});var le=void 0;function ne(){this.qg=this.Eh=null;this.Zj=!1;this.ma=0}ne.prototype=new A;ne.prototype.constructor=ne;function oe(a,b){a:for(;;){try{b.Lj()}catch(g){if(b=Yc(S(),g),null!==b){var c=a,e=Id(c.qg);if(null!==e){var f=c.qg;c.qg=(new Xd).a();c.Eh.oh(pe(c,e,f))}Ud();if(b&&b.$classData&&b.$classData.qa.rl)throw T(S(),b);a.Eh.ol(b)}else throw g;}b=Id(a.qg);if(null!==b)continue a;break}}\nne.prototype.al=function(a){this.Eh=a;this.qg=(new Xd).a();this.ma=(1|this.ma)<<24>>24;this.Zj=!1;this.ma=(2|this.ma)<<24>>24;return this};ne.prototype.oh=function(a){if(this.Zj)Yd(this.qg,a);else{this.Zj=!0;try{oe(this,a)}finally{this.Zj=!1}}};ne.prototype.$classData=z({lq:0},!1,\"cats.effect.internals.Trampoline\",{lq:1,c:1});function qe(){this.ln=null;this.ma=!1}qe.prototype=new A;qe.prototype.constructor=qe;qe.prototype.a=function(){re=this;this.ln=(new se).al((new te).a());this.ma=!0;return this};\nfunction ue(){re||(re=(new qe).a());var a=re;if(!a.ma)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/js/src/main/scala/cats/effect/internals/TrampolineEC.scala: 47\");return a.ln}qe.prototype.$classData=z({oq:0},!1,\"cats.effect.internals.TrampolineEC$\",{oq:1,c:1});var re=void 0;function we(){}we.prototype=new A;we.prototype.constructor=we;function xe(){}xe.prototype=we.prototype;function ye(){}ye.prototype=new A;ye.prototype.constructor=ye;function ze(){}\nze.prototype=ye.prototype;function Ae(){this.Bm=null}Ae.prototype=new A;Ae.prototype.constructor=Ae;Ae.prototype.a=function(){Be=this;this.Bm=(new Ce).a();(new De).a();(new Ee).a();(new Ee).a();Fe||(Fe=(new Ge).a());He||(He=(new Ie).a());Je||(Je=(new Ke).a());Le||(Le=(new Ne).a());Oe||(Oe=(new Pe).a());Qe||(Qe=(new Re).a());Se||(Se=(new Te).a());Ue||(Ue=(new Ve).a());return this};Ae.prototype.$classData=z({ts:0},!1,\"cats.package$\",{ts:1,c:1});var Be=void 0;\nfunction We(){Be||(Be=(new Ae).a());return Be}function Xe(){}Xe.prototype=new A;Xe.prototype.constructor=Xe;Xe.prototype.a=function(){return this};Xe.prototype.$classData=z({ws:0},!1,\"cats.syntax.EitherOps$\",{ws:1,c:1});var Ye=void 0;function Ze(){this.gn=this.Mn=null}Ze.prototype=new A;Ze.prototype.constructor=Ze;function dc(a,b){var c=new Ze;c.Mn=a;c.gn=b;return c}function cc(a,b){We();return a.gn.Bc(a.Mn,b)}Ze.prototype.$classData=z({xs:0},!1,\"cats.syntax.EqOps\",{xs:1,c:1});\nfunction $e(){this.Kj=this.Jj=null}$e.prototype=new A;$e.prototype.constructor=$e;function af(a){return ka(D(bf),[a.Jj,a.Kj])}function cf(a,b,c){a.Jj=b;a.Kj=c;return a}$e.prototype.$classData=z({Ds:0},!1,\"java.math.BigInteger$QuotAndRem\",{Ds:1,c:1});function df(){}df.prototype=new A;df.prototype.constructor=df;df.prototype.a=function(){return this};function ef(a,b,c,e){for(var f=a=0;f>>31|0;f=1+f|0}0!==a&&(b.b[e]=a)}\nfunction ff(a,b,c){a=c>>5;c&=31;var e=(b.ga+a|0)+(0===c?0:1)|0,f=r(D(E),[e]);gf(0,f,b.H,a,c);b=hf(b.N,e,f);jf(b);return b}function kf(a,b,c){a=c>>5;var e=31&c;if(a>=b.ga)return 0>b.N?lf().Si:lf().be;c=b.ga-a|0;var f=r(D(E),[1+c|0]);mf(0,f,c,b.H,a,e);if(0>b.N){for(var g=0;gb.N&&of(b)===(-1+b.ga|0)&&(c=-1+c|0);return a=a-da(c)|0}function mf(a,b,c,e,f,g){for(a=0;a>>g|0|e.b[1+(a+f|0)|0]<>>g|0}}\nfunction gf(a,b,c,e,f){if(0===f)Ka(c,0,b,e,b.b.length-e|0);else{a=32-f|0;b.b[-1+b.b.length|0]=0;for(var g=-1+b.b.length|0;g>e;){var h=g;b.b[h]=b.b[h]|c.b[-1+(g-e|0)|0]>>>a|0;b.b[-1+g|0]=c.b[-1+(g-e|0)|0]<c?\"0E+\":\"0E\")+(-2147483648===c?\"2147483648\":\"\"+(-c|0))}else{a=0>b.i;var e=\"\";var f=18;if(a){var g=b.f;b=b.i;b=(new x).g(-g|0,0!==g?~b:-b|0)}g=b.f;for(var h=b.i;;){b=g;var k=h;h=y();g=uf(h,g,k,10,0);h=h.M;f=-1+f|0;k=h;var m=g,p=m>>>16|0;m=n(10,65535&m);p=n(10,p);p=m+(p<<16)|0;n(10,k);e=\"\"+\n(b-p|0)+e;b=h;if(0===g&&0===b)break}b=-1+((18-f|0)-c|0)|0;if(0>>0)).toString(10),0>a?\"-\"+b:b;b=\"\";var f=r(D(E),[c]);Ka(e,0,f,0,c);do{var g=0;for(e=-1+c|0;0<=e;){var h=g;g=f.b[e];var k=wf(y(),g,h,1E9,0);f.b[e]=k;h=k>>31;var m=65535&k;k=k>>>16|0;var p=n(51712,m);m=n(15258,m);var q=n(51712,k);p=p+((m+q|0)<<16)|0;n(1E9,h);n(15258,k);g=g-p|0;e=-1+e|0}e=\"\"+g;for(b=\"000000000\".substring(e.length|0)+e+b;0!==c&&0===f.b[-1+c|0];)c=-1+c|0}while(0!==c);f=0;for(c=b.length|0;;)if(fa?\"-\"+b:b}rf.prototype.$classData=z({Fs:0},!1,\"java.math.Conversion$\",{Fs:1,c:1});var sf=void 0;function xf(){sf||(sf=(new rf).a());return sf}function yf(){}yf.prototype=new A;yf.prototype.constructor=yf;yf.prototype.a=function(){return this};\nfunction zf(a,b,c,e,f,g,h){a=r(D(E),[1+f|0]);var k=r(D(E),[1+h|0]),m=da(g.b[-1+h|0]);0!==m?(gf(qf(),k,g,0,m),gf(qf(),a,e,0,m)):(Ka(e,0,a,0,f),Ka(g,0,k,0,h));e=k.b[-1+h|0];for(c=-1+c|0;0<=c;){if(a.b[f]===e)g=-1;else{var p=a.b[f],q=a.b[-1+f|0];g=y();var t=wf(g,q,p,e,0);p=g.M;g=t;var u=65535&t;t=t>>>16|0;var v=65535&e,B=e>>>16|0,P=n(u,v);v=n(t,v);u=n(u,B);u=P+((v+u|0)<<16)|0;n(p,e);n(t,B);q=q-u|0;if(0!==g)a:for(g=1+g|0;;){t=g=-1+g|0;B=k.b[-2+h|0];p=65535&t;t=t>>>16|0;P=65535&B;B=B>>>16|0;u=n(p,P);P=\nn(t,P);v=n(p,B);p=u+((P+v|0)<<16)|0;u=(u>>>16|0)+v|0;u=(n(t,B)+(u>>>16|0)|0)+(((65535&u)+P|0)>>>16|0)|0;B=q;t=a.b[-2+f|0];P=q+e|0;if(0===((-2147483648^P)<(-2147483648^q)?1:0)&&(q=P,u^=-2147483648,B^=-2147483648,u===B?(-2147483648^p)>(-2147483648^t):u>B))continue a;break}}if(q=0!==g){Af();q=a;p=f-h|0;B=k;t=h;u=g;var ea=0;var Ta;for(P=Ta=0;P>>16|0;var Vf=65535&u,ab=u>>>16|0,Wf=n(qa,Vf);Vf=n(va,Vf);var tl=n(qa,ab);qa=Wf+((Vf+tl|0)<<16)|0;Wf=(Wf>>>16|0)+tl|\n0;ab=(n(va,ab)+(Wf>>>16|0)|0)+(((65535&Wf)+Vf|0)>>>16|0)|0;va=qa+ea|0;ea=(-2147483648^va)<(-2147483648^qa)?1+ab|0:ab;ab=q.b[p+v|0];va=ab-va|0;ab=(-2147483648^va)>(-2147483648^ab)?-1:0;qa=Ta;Ta=qa>>31;qa=va+qa|0;Ta=(-2147483648^qa)<(-2147483648^va)?1+(ab+Ta|0)|0:ab+Ta|0;q.b[p+v|0]=qa;P=1+P|0}u=q.b[p+t|0];B=u-ea|0;u=(-2147483648^B)>(-2147483648^u)?-1:0;v=Ta;P=v>>31;v=B+v|0;q.b[p+t|0]=v;q=0!==((-2147483648^v)<(-2147483648^B)?1+(u+P|0)|0:u+P|0)}if(q)for(g=-1+g|0,q=P=u=0;q>>16|0,p=65535&f,q=f>>>16|0,t=n(k,p);p=n(m,p);k=n(k,q);t=t+((p+k|0)<<16)|0;n(h,f);n(m,q);a=a-t|0;b.b[e]=g;e=-1+e|0}return a}\nyf.prototype.$classData=z({Gs:0},!1,\"java.math.Division$\",{Gs:1,c:1});var Df=void 0;function Af(){Df||(Df=(new yf).a());return Df}function Ef(){}Ef.prototype=new A;Ef.prototype.constructor=Ef;Ef.prototype.a=function(){return this};\nfunction Ff(a,b,c,e){for(var f=r(D(E),[b]),g=0,h=0;g(-2147483648^k)?-1:0;var p=h;h=p>>31;p=m+p|0;m=(-2147483648^p)<(-2147483648^m)?1+(k+h|0)|0:k+h|0;f.b[g]=p;h=m;g=1+g|0}for(;g>31,m=c+m|0,c=(-2147483648^m)<(-2147483648^c)?1+e|0:e,f.b[g]=m,h=c,g=1+g|0;return f}function Gf(a,b,c,e){for(a=-1+e|0;0<=a&&b.b[a]===c.b[a];)a=-1+a|0;return 0>a?0:(-2147483648^b.b[a])<(-2147483648^c.b[a])?-1:1}\nfunction Hf(a,b,c,e){var f=r(D(E),[1+b|0]),g=1,h=a.b[0],k=h+c.b[0]|0;f.b[0]=k;h=(-2147483648^k)<(-2147483648^h)?1:0;if(b>=e){for(;ga?(a=b=c-b|0,c=(-2147483648^b)>(-2147483648^c)?-1:0):(a=c=b-c|0,c=(-2147483648^c)>(-2147483648^b)?-1:0);return Kf(e,(new x).g(a,c))}if(a===e)e=f>=g?Hf(b.H,f,c.H,g):Hf(c.H,g,b.H,f);else{var h=f!==g?f>g?1:-1:Gf(0,b.H,c.H,f);if(0===h)return lf().be;1===h?e=Ff(b.H,f,\nc.H,g):(c=Ff(c.H,g,b.H,f),a=e,e=c)}a=hf(a|0,e.b.length,e);jf(a);return a}\nfunction Lf(a,b,c){var e=b.N;a=c.N;var f=b.ga,g=c.ga;if(0===a)return b;if(0===e)return Mf(c);if(2===(f+g|0))return b=b.H.b[0],f=0,c=c.H.b[0],g=0,0>e&&(e=b,b=-e|0,f=0!==e?~f:-f|0),0>a&&(a=c,e=g,c=-a|0,g=0!==a?~e:-e|0),a=lf(),e=b,b=f,f=g,c=e-c|0,Kf(a,(new x).g(c,(-2147483648^c)>(-2147483648^e)?-1+(b-f|0)|0:b-f|0));var h=f!==g?f>g?1:-1:Gf(Nf(),b.H,c.H,f);if(e===a&&0===h)return lf().be;-1===h?(c=e===a?Ff(c.H,g,b.H,f):Hf(c.H,g,b.H,f),a=-a|0):e===a?(c=Ff(b.H,f,c.H,g),a=e):(c=Hf(b.H,f,c.H,g),a=e);a=hf(a|\n0,c.b.length,c);jf(a);return a}Ef.prototype.$classData=z({Hs:0},!1,\"java.math.Elementary$\",{Hs:1,c:1});var Of=void 0;function Nf(){Of||(Of=(new Ef).a());return Of}function Pf(){this.Vf=0;this.Ig=null}Pf.prototype=new A;Pf.prototype.constructor=Pf;Pf.prototype.t=function(a){return a instanceof Pf?this.Vf===a.Vf?this.Ig===a.Ig:!1:!1};Pf.prototype.n=function(){return\"precision\\x3d\"+this.Vf+\" roundingMode\\x3d\"+this.Ig};Pf.prototype.z=function(){return this.Vf<<3|this.Ig.Tl};\nPf.prototype.$classData=z({Is:0},!1,\"java.math.MathContext\",{Is:1,c:1});function Qf(){this.$l=null}Qf.prototype=new A;Qf.prototype.constructor=Qf;Qf.prototype.a=function(){Rf=this;Sf();var a=Tf().Ji,b=new Pf;b.Vf=34;b.Ig=a;this.$l=b;Sf();Tf();Sf();Tf();Sf();Tf();return this};Qf.prototype.$classData=z({Js:0},!1,\"java.math.MathContext$\",{Js:1,c:1});var Rf=void 0;function Sf(){Rf||(Rf=(new Qf).a());return Rf}function Uf(){this.of=this.pf=null}Uf.prototype=new A;Uf.prototype.constructor=Uf;\nUf.prototype.a=function(){Xf=this;Yf(10,10);Yf(14,5);this.pf=r(D(bf),[32]);this.of=r(D(bf),[32]);var a;var b=1;for(var c=a=0;32>c;){var e=c;if(18>=e){Bf().of.b[e]=Kf(lf(),(new x).g(b,a));var f=Bf().pf,g=lf(),h=b,k=a;f.b[e]=Kf(g,(new x).g(0===(32&e)?h<>>1|0)>>>(31-e|0)|0|k<>>16|0;e=n(5,65535&e);f=n(5,b);b=e+(f<<16)|0;e=(e>>>16|0)+f|0;a=n(5,a)+(e>>>16|0)|0}else Bf().of.b[e]=Zf(Bf().of.b[-1+e|0],Bf().of.b[1]),Bf().pf.b[e]=Zf(Bf().pf.b[-1+e|0],lf().lg);c=1+c|0}return this};\nfunction $f(a,b,c){for(var e,f=0;f>>16|0;var u=65535&p;p=p>>>16|0;var v=n(t,u);u=n(m,u);var B=n(t,p);t=v+((u+B|0)<<16)|0;v=(v>>>16|0)+B|0;m=(n(m,p)+(v>>>16|0)|0)+(((65535&v)+u|0)>>>16|0)|0;q=t+q|0;m=(-2147483648^q)<(-2147483648^t)?1+m|0:m;e=q+e|0;q=(-2147483648^e)<(-2147483648^q)?1+m|0:m;c.b[g+k|0]=e;e=q;h=1+h|0}c.b[g+b|0]=e;f=1+f|0}ef(qf(),c,c,b<<1);for(g=f=e=0;f>>16|0,t=65535&q,q=q>>>16|0,p=n(m,t),t=n(e,t),v=n(m,q),m=p+((t+v|0)<<16)|0,p=(p>>>16|0)+v|0,e=(n(e,q)+(p>>>16|0)|0)+(((65535&p)+t|0)>>>16|0)|0,k=m+k|0,e=(-2147483648^k)<(-2147483648^m)?1+e|0:e,h=k+h|0,k=(-2147483648^h)<(-2147483648^k)?1+e|0:e,c.b[g]=h,g=1+g|0,h=k+c.b[g]|0,k=(-2147483648^h)<(-2147483648^k)?1:0,c.b[g]=h,e=k,f=1+f|0,g=1+g|0;return c}function Yf(a,b){var c=[];if(0b.ga)var e=c;else e=b,b=c;var f=e,g=b;if(63>g.ga){e=f.ga;b=g.ga;c=e+b|0;a=f.N!==g.N?-1:1;if(2===c){e=f.H.b[0];b=g.H.b[0];c=65535&e;e=e>>>16|0;g=65535&b;b=b>>>16|0;f=n(c,g);g=n(e,g);var h=n(c,b);c=f+((g+h|0)<<16)|0;f=(f>>>16|0)+h|0;e=(n(e,b)+(f>>>16|0)|0)+(((65535&f)+g|0)>>>16|0)|0;a=0===e?(new Jf).g(a,c):hf(a,2,ka(D(E),[c,e]))}else{f=f.H;g=g.H;h=r(D(E),[c]);if(0!==e&&0!==b)if(1===e)h.b[b]=bg(0,h,g,b,f.b[0]);else if(1===b)h.b[e]=bg(0,h,f,e,g.b[0]);else if(f===g&&e===b)$f(f,\ne,h);else for(var k=0;k>>16|0,Ta=65535&v;v=v>>>16|0;var va=n(P,Ta);Ta=n(ea,Ta);var qa=n(P,v);P=va+((Ta+qa|0)<<16)|0;va=(va>>>16|0)+qa|0;ea=(n(ea,v)+(va>>>16|0)|0)+(((65535&va)+Ta|0)>>>16|0)|0;B=P+B|0;ea=(-2147483648^B)<(-2147483648^P)?1+ea|0:ea;p=B+p|0;B=(-2147483648^p)<(-2147483648^B)?1+ea|0:ea;h.b[m+u|0]=p;p=B;t=1+t|0}h.b[m+b|0]=p;k=1+k|0}a=hf(a,c,h);jf(a)}return a}e=(-2&f.ga)<<4;c=cg(f,e);h=cg(g,\ne);b=dg(c,e);k=Lf(Nf(),f,b);b=dg(h,e);g=Lf(Nf(),g,b);f=ag(a,c,h);b=ag(a,k,g);a=ag(a,Lf(Nf(),c,k),Lf(Nf(),g,h));c=f;a=If(Nf(),a,c);a=If(Nf(),a,b);a=dg(a,e);e=f=dg(f,e<<1);a=If(Nf(),e,a);return If(Nf(),a,b)}\nfunction bg(a,b,c,e,f){var g;for(a=g=0;a>>16|0;var p=65535&f,q=f>>>16|0,t=n(m,p);p=n(k,p);var u=n(m,q);m=t+((p+u|0)<<16)|0;t=(t>>>16|0)+u|0;k=(n(k,q)+(t>>>16|0)|0)+(((65535&t)+p|0)>>>16|0)|0;g=m+g|0;k=(-2147483648^g)<(-2147483648^m)?1+k|0:k;b.b[h]=g;g=k;a=1+a|0}return g}\nfunction eg(a,b){var c=a.pf.b.length,e=c>>31,f=b.i;if(f===e?(-2147483648^b.f)<(-2147483648^c):f=(-2147483648^b.f):0>c)return fg(lf().lg,b.f);c=b.i;if(0===c?-1>=(-2147483648^b.f):0>c)return dg(fg(a.of.b[1],b.f),b.f);var g=fg(a.of.b[1],2147483647);c=g;f=b.i;var h=-2147483647+b.f|0;e=h;h=1>(-2147483648^h)?f:-1+f|0;for(f=gg(y(),b.f,b.i,2147483647,0);;){var k=e,m=h;if(0===m?-1<(-2147483648^k):0(-2147483648^e)?h:-1+h|0;\nelse break}c=Zf(c,fg(a.of.b[1],f));c=dg(c,2147483647);a=b.i;e=b=-2147483647+b.f|0;for(h=1>(-2147483648^b)?a:-1+a|0;;)if(b=e,a=h,0===a?-1<(-2147483648^b):0(-2147483648^a)?b:-1+b|0,e=a,h=b;else break;return dg(c,f)}Uf.prototype.$classData=z({Ks:0},!1,\"java.math.Multiplication$\",{Ks:1,c:1});var Xf=void 0;function Bf(){Xf||(Xf=(new Uf).a());return Xf}function hg(){this.Sn=this.Rn=this.kl=0}hg.prototype=new A;hg.prototype.constructor=hg;\nhg.prototype.a=function(){ig=this;this.kl=64;this.Rn=this.kl>>2;this.Sn=this.kl;jg(Cc(),this.Rn=b&&!0);a=b+32|0;return og(b,32,48>>1|0,g=b.b[f];if(ce.$a(g,a.b[-1+(b+f|0)|0])){for(var h=b,k=-1+(b+f|0)|0;1<(k-h|0);){var m=(h+k|0)>>>1|0;0>e.$a(g,a.b[m])?k=m:h=m}h=h+(0>e.$a(g,a.b[h])?0:1)|0;for(k=b+f|0;k>h;)a.b[k]=a.b[-1+k|0],k=-1+k|0;a.b[h]=g}f=1+f|0}}}function Fg(a,b,c){var e=new Gg;e.Vh=c;c=b.b.length;16=f||g.mi(b.b[m],b.b[p]))?(c.b[a]=b.b[m],m=1+m|0):(c.b[a]=b.b[p],p=1+p|0),a=1+a|0;Ka(c,e,b,e,h)}else Eg(b,e,f,g)}Cg.prototype.$classData=z({av:0},!1,\"java.util.Arrays$\",{av:1,c:1});var Ig=void 0;function Jg(){Ig||(Ig=(new Cg).a());return Ig}function Kg(){this.Cn=null}Kg.prototype=new A;Kg.prototype.constructor=Kg;\nKg.prototype.a=function(){Lg=this;this.Cn=new l.RegExp(\"(?:(\\\\d+)\\\\$)?([-#+ 0,\\\\(\\x3c]*)(\\\\d+)?(?:\\\\.(\\\\d+))?[%A-Za-z]\",\"g\");return this};Kg.prototype.$classData=z({fv:0},!1,\"java.util.Formatter$\",{fv:1,c:1});var Lg=void 0;function Mg(){}Mg.prototype=new A;Mg.prototype.constructor=Mg;function Ng(){}Ng.prototype=Mg.prototype;function Og(){}Og.prototype=new A;Og.prototype.constructor=Og;function Pg(){}Pg.prototype=Og.prototype;function Qg(){}Qg.prototype=new A;Qg.prototype.constructor=Qg;\nQg.prototype.a=function(){return this};Qg.prototype.$classData=z({Rv:0},!1,\"scala.Predef$any2stringadd$\",{Rv:1,c:1});var Sg=void 0;function Tg(){}Tg.prototype=new A;Tg.prototype.constructor=Tg;Tg.prototype.a=function(){return this};function me(){Ug||(Ug=(new Tg).a());return F(function(){return function(a){Vg(a)}}(Ug))}Tg.prototype.$classData=z({Yv:0},!1,\"scala.concurrent.ExecutionContext$\",{Yv:1,c:1});var Ug=void 0;function Wg(){}Wg.prototype=new A;Wg.prototype.constructor=Wg;Wg.prototype.a=function(){return this};\nWg.prototype.$classData=z({lw:0},!1,\"scala.math.Ordered$\",{lw:1,c:1});var Xg=void 0;function Yg(){this.jk=this.bm=this.Xl=this.Wl=null;this.q=0}Yg.prototype=new A;Yg.prototype.constructor=Yg;\nYg.prototype.a=function(){Zg=this;(new $g).a();ah();bh();ch();dh();this.bm=eh();L();M();fh||(fh=(new gh).a());hh||(hh=(new ih).a());jh||(jh=(new kh).a());lh();mh||(mh=(new nh).a());oh();ph||(ph=(new qh).a());rh();sh||(sh=(new th).a());uh||(uh=(new vh).a());wh||(wh=(new xh).a());yh||(yh=(new zh).a());Xg||(Xg=(new Wg).a());Ah||(Ah=(new Bh).a());Ch||(Ch=(new Dh).a());this.jk=Ch;Eh||(Eh=(new Fh).a());Gh||(Gh=(new Hh).a());return this};Yg.prototype.$classData=z({qw:0},!1,\"scala.package$\",{qw:1,c:1});\nvar Zg=void 0;function vc(){Zg||(Zg=(new Yg).a());return Zg}function Ih(){}Ih.prototype=new A;Ih.prototype.constructor=Ih;Ih.prototype.a=function(){Jh=this;Kh||(Kh=(new Lh).a());Mh||(Mh=(new Nh).a());Oh||(Oh=(new Ph).a());Qh||(Qh=(new Rh).a());Sh||(Sh=(new Th).a());Uh||(Uh=(new Vh).a());Wh||(Wh=(new Xh).a());Yh||(Yh=(new Zh).a());$h||($h=(new ai).a());bi||(bi=(new ci).a());di();ei||(ei=(new fi).a());gi||(gi=(new hi).a());ii||(ii=(new ji).a());return this};\nIh.prototype.$classData=z({sw:0},!1,\"scala.reflect.ClassManifestFactory$\",{sw:1,c:1});var Jh=void 0;function ki(){}ki.prototype=new A;ki.prototype.constructor=ki;ki.prototype.a=function(){return this};ki.prototype.$classData=z({uw:0},!1,\"scala.reflect.ManifestFactory$\",{uw:1,c:1});var li=void 0;function mi(){}mi.prototype=new A;mi.prototype.constructor=mi;mi.prototype.a=function(){ni=this;Jh||(Jh=(new Ih).a());li||(li=(new ki).a());return this};\nmi.prototype.$classData=z({Kw:0},!1,\"scala.reflect.package$\",{Kw:1,c:1});var ni=void 0;function oi(){}oi.prototype=new A;oi.prototype.constructor=oi;oi.prototype.a=function(){(new pi).a();return this};oi.prototype.$classData=z({Tw:0},!1,\"scala.util.control.Breaks\",{Tw:1,c:1});function qi(){}qi.prototype=new A;qi.prototype.constructor=qi;qi.prototype.a=function(){return this};function Td(a,b){return b&&b.$classData&&b.$classData.qa.rl?R():(new Q).j(b)}\nqi.prototype.$classData=z({Ww:0},!1,\"scala.util.control.NonFatal$\",{Ww:1,c:1});var ri=void 0;function Ud(){ri||(ri=(new qi).a());return ri}function si(){}si.prototype=new A;si.prototype.constructor=si;function ti(){}ti.prototype=si.prototype;si.prototype.pi=function(a,b){b=n(-862048943,b);b=n(461845907,b<<15|b>>>17|0);return a^b};si.prototype.Fc=function(a,b){a=this.pi(a,b);return-430675100+n(5,a<<13|a>>>19|0)|0};\nfunction ui(a){var b=vi(),c=a.za();if(0===c)return a=a.Ba(),Ea(Fa(),a);for(var e=-889275714,f=0;f>>16|0));a=n(-1028477387,a^(a>>>13|0));return a^(a>>>16|0)};function Ai(a,b,c){var e=(new zi).ua(0);c=(new zi).ua(c);b.K(F(function(f,g,h){return function(k){g.o=f.Fc(g.o,wi(xi(),k));h.o=1+h.o|0}}(a,c,e)));return a.We(c.o,e.o)}function Bi(){}Bi.prototype=new A;Bi.prototype.constructor=Bi;Bi.prototype.a=function(){return this};Bi.prototype.$classData=z({Yw:0},!1,\"scala.util.hashing.package$\",{Yw:1,c:1});var Ci=void 0;function kh(){}\nkh.prototype=new A;kh.prototype.constructor=kh;kh.prototype.a=function(){return this};kh.prototype.$classData=z({Zw:0},!1,\"scala.collection.$colon$plus$\",{Zw:1,c:1});var jh=void 0;function ih(){}ih.prototype=new A;ih.prototype.constructor=ih;ih.prototype.a=function(){return this};ih.prototype.$classData=z({$w:0},!1,\"scala.collection.$plus$colon$\",{$w:1,c:1});var hh=void 0;function Di(){this.nb=null}Di.prototype=new A;Di.prototype.constructor=Di;\nDi.prototype.a=function(){Ei=this;this.nb=(new Fi).a();return this};Di.prototype.$classData=z({hx:0},!1,\"scala.collection.Iterator$\",{hx:1,c:1});var Ei=void 0;function eh(){Ei||(Ei=(new Di).a());return Ei}function Gi(){this.xb=this.Uc=null}Gi.prototype=new A;Gi.prototype.constructor=Gi;Gi.prototype.$classData=z({mx:0},!1,\"scala.collection.Iterator$ConcatIteratorCell\",{mx:1,c:1});function Hi(a,b,c){a.tb(b,c,Ii(Ji(),b)-c|0)}function Ki(a,b){b=b.ng();b.Gb(a.pa());return b.Ca()}\nfunction U(a,b,c,e){return a.Hb((new Li).a(),b,c,e).vc.ub}function Mi(a){var b=(new zi).ua(0);a.K(F(function(c,e){return function(){e.o=1+e.o|0}}(a,b)));return b.o}function Ni(a,b,c,e,f){var g=(new Oi).$e(!0);Pi(b,c);a.K(F(function(h,k,m,p){return function(q){if(k.o)Qi(m,q),k.o=!1;else return Pi(m,p),Qi(m,q)}}(a,g,b,e)));Pi(b,f);return b}function Ri(a,b){return a.fc()?(b=b.$c(a.x()),a.Yb(b,0),b):a.ib().Kb(b)}function Si(){}Si.prototype=new A;Si.prototype.constructor=Si;Si.prototype.a=function(){return this};\nSi.prototype.Gj=function(a){return 1<<(-da(-1+a|0)|0)};Si.prototype.$classData=z({wx:0},!1,\"scala.collection.Util$\",{wx:1,c:1});var Ti=void 0;function Ui(){}Ui.prototype=new A;Ui.prototype.constructor=Ui;function Vi(){}Vi.prototype=Ui.prototype;function Wi(){}Wi.prototype=new A;Wi.prototype.constructor=Wi;function Xi(){}Xi.prototype=Wi.prototype;Wi.prototype.Jd=function(){return this.fa().Ca()};function Yi(a,b){a:for(;;){if(!b.m()){a.kc(b.w());b=b.Aa();continue a}break}}\nfunction Zi(a,b){b&&b.$classData&&b.$classData.qa.Jg?Yi(a,b):b.K(F(function(c){return function(e){return c.kc(e)}}(a)));return a}function $i(){}$i.prototype=new A;$i.prototype.constructor=$i;function aj(){}aj.prototype=$i.prototype;function nh(){}nh.prototype=new A;nh.prototype.constructor=nh;nh.prototype.a=function(){return this};nh.prototype.$classData=z({Ey:0},!1,\"scala.collection.immutable.Stream$$hash$colon$colon$\",{Ey:1,c:1});var mh=void 0;\nfunction bj(){this.Gl=this.To=null;this.q=!1;this.k=null}bj.prototype=new A;bj.prototype.constructor=bj;function cj(a,b,c){a.Gl=c;if(null===b)throw T(S(),null);a.k=b;return a}function dj(a){a.q||(a.q||(a.To=Sd(a.Gl),a.q=!0),a.Gl=null);return a.To}bj.prototype.$classData=z({Ky:0},!1,\"scala.collection.immutable.StreamIterator$LazyCell\",{Ky:1,c:1});function ej(){}ej.prototype=new A;ej.prototype.constructor=ej;ej.prototype.a=function(){return this};\nfunction fj(a,b,c,e){a=0>c?0:c;return e<=a||a>=(b.length|0)?\"\":b.substring(a,e>(b.length|0)?b.length|0:e)}ej.prototype.$classData=z({My:0},!1,\"scala.collection.immutable.StringOps$\",{My:1,c:1});var gj=void 0;function hj(){gj||(gj=(new ej).a());return gj}function ij(){}ij.prototype=new A;ij.prototype.constructor=ij;ij.prototype.a=function(){return this};ij.prototype.fa=function(){var a=(new Li).a();return jj(new kj,a,F(function(){return function(b){return(new lj).h(b)}}(this)))};\nij.prototype.$classData=z({Uy:0},!1,\"scala.collection.immutable.WrappedString$\",{Uy:1,c:1});var mj=void 0;function nj(a){return oj(Xc(),-1+a.Ya.b.length|0)}function pj(a,b){b=Fb(b);return qj(a,b)}\nfunction qj(a,b){var c=Da(b);c=rj(a,c);for(var e=a.Ya.b[c];null!==e;){if(G(H(),e,b))return!1;c=(1+c|0)%a.Ya.b.length|0;e=a.Ya.b[c]}a.Ya.b[c]=b;a.He=1+a.He|0;null!==a.Qg&&(b=c>>5,c=a.Qg,c.b[b]=1+c.b[b]|0);if(a.He>=a.Kl){b=a.Ya;a.Ya=r(D(C),[a.Ya.b.length<<1]);a.He=0;if(null!==a.Qg)if(c=1+(a.Ya.b.length>>5)|0,a.Qg.b.length!==c)a.Qg=r(D(E),[c]);else{Jg();c=a.Qg;e=c.b.length;for(var f=0;f!==e;)c.b[f]=0,f=1+f|0}a.Dl=nj(a);a.Kl=sj(tj(),a.gk,a.Ya.b.length);for(c=0;c>>8|0)|b>>>24|0);a=-1+a.Ya.b.length|0;return((b>>>c|0|b<<(-c|0))>>>(32-oj(Xc(),a)|0)|0)&a}function uj(a,b){b=Fb(b);var c=Da(b);c=rj(a,c);for(var e=a.Ya.b[c];null!==e&&!G(H(),e,b);)c=(1+c|0)%a.Ya.b.length|0,e=a.Ya.b[c];return e}function vj(){}vj.prototype=new A;vj.prototype.constructor=vj;vj.prototype.a=function(){return this};\nfunction sj(a,b,c){if(!(500>b))throw(new wj).j(\"assertion failed: loadFactor too large; must be \\x3c 0.5\");a=c>>31;var e=b>>31,f=65535&c,g=c>>>16|0,h=65535&b,k=b>>>16|0,m=n(f,h);h=n(g,h);var p=n(f,k);f=m+((h+p|0)<<16)|0;m=(m>>>16|0)+p|0;b=(((n(c,e)+n(a,b)|0)+n(g,k)|0)+(m>>>16|0)|0)+(((65535&m)+h|0)>>>16|0)|0;return uf(y(),f,b,1E3,0)}vj.prototype.$classData=z({Zy:0},!1,\"scala.collection.mutable.FlatHashTable$\",{Zy:1,c:1});var xj=void 0;function tj(){xj||(xj=(new vj).a());return xj}function yj(){}\nyj.prototype=new A;yj.prototype.constructor=yj;yj.prototype.a=function(){return this};yj.prototype.n=function(){return\"NullSentinel\"};yj.prototype.z=function(){return 0};yj.prototype.$classData=z({bz:0},!1,\"scala.collection.mutable.FlatHashTable$NullSentinel$\",{bz:1,c:1});var zj=void 0;function Gb(){zj||(zj=(new yj).a());return zj}function Aj(){}Aj.prototype=new A;Aj.prototype.constructor=Aj;Aj.prototype.a=function(){return this};Aj.prototype.Gj=function(a){return 1<<(-da(-1+a|0)|0)};\nAj.prototype.$classData=z({dz:0},!1,\"scala.collection.mutable.HashTable$\",{dz:1,c:1});var Bj=void 0;function Cj(){Bj||(Bj=(new Aj).a());return Bj}function Dj(){this.Sj=null}Dj.prototype=new A;Dj.prototype.constructor=Dj;Dj.prototype.a=function(){Ej=this;this.Sj=l.Object.prototype.hasOwnProperty;return this};Dj.prototype.$classData=z({tz:0},!1,\"scala.scalajs.js.WrappedDictionary$Cache$\",{tz:1,c:1});var Ej=void 0;function Fj(){Ej||(Ej=(new Dj).a());return Ej}\nfunction Gj(){this.$f=!1;this.Sk=this.uh=this.Qh=null;this.Dk=!1;this.hl=this.Vk=0}Gj.prototype=new A;Gj.prototype.constructor=Gj;\nGj.prototype.a=function(){Hj=this;this.Qh=(this.$f=!!(l.ArrayBuffer&&l.Int32Array&&l.Float32Array&&l.Float64Array))?new l.ArrayBuffer(8):null;this.uh=this.$f?new l.Int32Array(this.Qh,0,2):null;this.$f&&new l.Float32Array(this.Qh,0,2);this.Sk=this.$f?new l.Float64Array(this.Qh,0,1):null;if(this.$f)this.uh[0]=16909060,a=1===((new l.Int8Array(this.Qh,0,8))[0]|0);else var a=!0;this.Vk=(this.Dk=a)?0:1;this.hl=this.Dk?1:0;return this};\nfunction Ga(a,b){var c=b|0;if(c===b&&-Infinity!==1/b)return c;if(a.$f)a.Sk[0]=b,a=(new x).g(a.uh[a.hl]|0,a.uh[a.Vk]|0);else{if(b!==b)a=!1,b=2047,c=+l.Math.pow(2,51);else if(Infinity===b||-Infinity===b)a=0>b,b=2047,c=0;else if(0===b)a=-Infinity===1/b,c=b=0;else{var e=(a=0>b)?-b:b;if(e>=+l.Math.pow(2,-1022)){b=+l.Math.pow(2,52);c=+l.Math.log(e)/.6931471805599453;c=+l.Math.floor(c)|0;c=1023>c?c:1023;var f=+l.Math.pow(2,c);f>e&&(c=-1+c|0,f/=2);f=e/f*b;e=+l.Math.floor(f);f-=e;e=.5>f?e:.5e?c:.5b,e=2047&b>>20;a=4294967296*(1048575&b)+ +(a.f>>>0);return 2047===e?0!==a?NaN:c?-Infinity:Infinity:0f&&Oj(c);)0!==Pj(c)&&(g=Qj(c).index|0,e=b.substring(e,g),a.push(null===e?null:e),f=1+f|0),e=Pj(c);b=b.substring(e);a.push(null===b?null:b);b=ka(D(oa),a);for(c=b.b.length;0!==c&&\"\"===b.b[-1+c|0];)c=-1+c|0;c!==b.b.length&&(a=r(D(oa),[c]),Ka(b,0,a,0,c),b=a)}return b}function Rj(a,b){a=b.length|0;for(var c=r(D(Ua),[a]),e=0;ec||ab.b.length)throw(new Tj).a();for(e=\"\";c!==a;)e=\"\"+e+l.String.fromCharCode(b.b[c]),c=1+c|0;return e}function Ea(a,b){a=0;for(var c=1,e=-1+(b.length|0)|0;0<=e;)a=a+n(65535&(b.charCodeAt(e)|0),c)|0,c=n(31,c),e=-1+e|0;return a}\nfunction Uj(a,b){var c=(new Vj).a();if(c.ji)throw(new Wj).a();for(var e=0,f=0,g=a.length|0,h=0;h!==g;){var k=a.indexOf(\"%\",h)|0;if(0>k){Xj(c,a.substring(h));break}Xj(c,a.substring(h,k));h=1+k|0;Lg||(Lg=(new Kg).a());var m=Lg.Cn;m.lastIndex=h;k=m.exec(a);if(null===k||(k.index|0)!==h)throw c=h===g?\"%\":a.substring(h,1+h|0),(new Yj).h(c);h=m.lastIndex|0;m=65535&(a.charCodeAt(-1+h|0)|0);for(var p,q=k[2],t=90>=m?256:0,u=q.length|0,v=0;v!==u;){p=65535&(q.charCodeAt(v)|0);switch(p){case 45:var B=1;break;\ncase 35:B=2;break;case 43:B=4;break;case 32:B=8;break;case 48:B=16;break;case 44:B=32;break;case 40:B=64;break;case 60:B=128;break;default:throw(new J).j(Zj(p));}if(0!==(t&B))throw(new ak).h(l.String.fromCharCode(p));t|=B;v=1+v|0}p=t;u=ck(k[3],-1);t=ck(k[4],-1);if(37===m||110===m)k=null;else{if(0!==(1&p)&&0>u)throw(new dk).h(\"%\"+k[0]);0!==(128&p)?q=f:(q=ck(k[1],0),q=0===q?e=1+e|0:0>q?f:q);if(0>=q||q>b.b.length){c=l.String.fromCharCode(m);if(0>(\"bBhHsHcCdoxXeEgGfn%\".indexOf(c)|0))throw(new Yj).h(c);\nthrow(new ek).h(\"%\"+k[0]);}f=q;k=b.b[-1+q|0]}q=c;v=k;B=m;k=p;m=u;u=t;switch(B){case 98:case 66:0!==(126&k)&&fk(k,126,B);gk(q,k,m,u,!1===v||null===v?\"false\":\"true\");break;case 104:case 72:0!==(126&k)&&fk(k,126,B);t=null===v?\"null\":(+(Da(v)>>>0)).toString(16);gk(q,k,m,u,t);break;case 115:case 83:v&&v.$classData&&v.$classData.qa.zH?(0!==(124&k)&&fk(k,124,B),v.wH(q,(0!==(1&k)?1:0)|(0!==(2&k)?4:0)|(0!==(256&k)?2:0),m,u)):(0!==(126&k)&&fk(k,126,B),gk(q,k,m,u,\"\"+v));break;case 99:case 67:0!==(126&k)&&fk(k,\n126,B);if(0<=u)throw(new hk).ua(u);if(v instanceof wb)gk(q,k,m,-1,l.String.fromCharCode(null===v?0:v.s));else if(La(v)){t=v|0;if(!(0<=t&&1114111>=t))throw(new ik).ua(t);t=65536>t?l.String.fromCharCode(t):l.String.fromCharCode(-64+(t>>10)|55296,56320|1023&t);gk(q,k,m,-1,t)}else jk(q,v,k,m,u,B);break;case 100:0!==(2&k)&&fk(k,2,B);17!==(17&k)&&12!==(12&k)||kk(k);if(0<=u)throw(new hk).ua(u);La(v)?lk(q,k,m,\"\"+(v|0)):v instanceof x?(u=Ma(v),t=u.f,u=u.i,lk(q,k,m,mk(y(),t,u))):jk(q,v,k,m,u,B);break;case 111:0!==\n(108&k)&&fk(k,108,B);17===(17&k)&&kk(k);if(0<=u)throw(new hk).ua(u);t=0!==(2&k)?\"0\":\"\";La(v)?(u=(+((v|0)>>>0)).toString(8),nk(q,k,m,t,u)):v instanceof x?(u=Ma(v),v=u.f,p=u.i,ok(),u=1073741823&v,B=1073741823&((v>>>30|0)+(p<<2)|0),v=p>>>28|0,0!==v?(v=(+(v>>>0)).toString(8),p=(+(B>>>0)).toString(8),B=\"0000000000\".substring(p.length|0),u=(+(u>>>0)).toString(8),u=v+(\"\"+B+p)+(\"\"+\"0000000000\".substring(u.length|0)+u)):0!==B?(v=(+(B>>>0)).toString(8),u=(+(u>>>0)).toString(8),u=v+(\"\"+\"0000000000\".substring(u.length|\n0)+u)):u=(+(u>>>0)).toString(8),nk(q,k,m,t,u)):jk(q,v,k,m,u,B);break;case 120:case 88:0!==(108&k)&&fk(k,108,B);17===(17&k)&&kk(k);if(0<=u)throw(new hk).ua(u);t=0===(2&k)?\"\":0!==(256&k)?\"0X\":\"0x\";La(v)?(u=(+((v|0)>>>0)).toString(16),nk(q,k,m,t,pk(k,u))):v instanceof x?(u=Ma(v),v=u.f,p=u.i,ok(),u=k,0!==p?(p=(+(p>>>0)).toString(16),v=(+(v>>>0)).toString(16),v=p+(\"\"+\"00000000\".substring(v.length|0)+v)):v=(+(v>>>0)).toString(16),nk(q,u,m,t,pk(k,v))):jk(q,v,k,m,u,B);break;case 101:case 69:0!==(32&k)&&fk(k,\n32,B);17!==(17&k)&&12!==(12&k)||kk(k);\"number\"===typeof v?(t=+v,t!==t||Infinity===t||-Infinity===t?qk(q,k,m,t):lk(q,k,m,rk(t,0<=u?u:6,0!==(2&k)))):jk(q,v,k,m,u,B);break;case 103:case 71:0!==(2&k)&&fk(k,2,B);17!==(17&k)&&12!==(12&k)||kk(k);\"number\"===typeof v?(v=+v,v!==v||Infinity===v||-Infinity===v?qk(q,k,m,v):(t=k,p=0<=u?u:6,k=0!==(2&k),u=+l.Math.abs(v),p=0===p?1:p,1E-4<=u&&u<+l.Math.pow(10,p)?(B=void 0!==l.Math.log10?+l.Math.log10(u):+l.Math.log(u)/2.302585092994046,B=Ja(+l.Math.ceil(B)),u=+l.Math.pow(10,\nB)<=u?1+B|0:B,u=p-u|0,k=sk(v,0m)throw(new dk).h(\"%-%\");vk(q,k,m,\"%\");break;case 110:if(0!==(255&k))throw(new tk).h(uk(k));if(0<=u)throw(new hk).ua(u);if(0<=m)throw(new wk).ua(m);\nXj(q,\"\\n\");break;default:throw(new Yj).h(l.String.fromCharCode(B));}}a=c.n();c.ej();return a}Ij.prototype.$classData=z({Az:0},!1,\"scala.scalajs.runtime.RuntimeString$\",{Az:1,c:1});var xk=void 0;function Fa(){xk||(xk=(new Ij).a());return xk}function yk(){this.An=!1;this.Jm=this.Mm=this.Lm=null;this.q=0}yk.prototype=new A;yk.prototype.constructor=yk;yk.prototype.a=function(){return this};\nfunction zk(a){return(a.stack+\"\\n\").replace(Ak(\"^[\\\\s\\\\S]+?\\\\s+at\\\\s+\"),\" at \").replace(Bk(\"^\\\\s+(at eval )?at\\\\s+\",\"gm\"),\"\").replace(Bk(\"^([^\\\\(]+?)([\\\\n])\",\"gm\"),\"{anonymous}() ($1)$2\").replace(Bk(\"^Object.\\x3canonymous\\x3e\\\\s*\\\\(([^\\\\)]+)\\\\)\",\"gm\"),\"{anonymous}() ($1)\").replace(Bk(\"^([^\\\\(]+|\\\\{anonymous\\\\}\\\\(\\\\)) \\\\((.+)\\\\)$\",\"gm\"),\"$1@$2\").split(\"\\n\").slice(0,-1)}function Ck(a){0===(8&a.q)<<24>>24&&0===(8&a.q)<<24>>24&&(a.Jm=l.Object.keys(Dk(a)),a.q=(8|a.q)<<24>>24);return a.Jm}\nfunction Ek(a){if(0===(2&a.q)<<24>>24&&0===(2&a.q)<<24>>24){for(var b={O:\"java_lang_Object\",T:\"java_lang_String\",V:\"scala_Unit\",Z:\"scala_Boolean\",C:\"scala_Char\",B:\"scala_Byte\",S:\"scala_Short\",I:\"scala_Int\",J:\"scala_Long\",F:\"scala_Float\",D:\"scala_Double\"},c=0;22>=c;)2<=c&&(b[\"T\"+c]=\"scala_Tuple\"+c),b[\"F\"+c]=\"scala_Function\"+c,c=1+c|0;a.Lm=b;a.q=(2|a.q)<<24>>24}return a.Lm}\nfunction Fk(a,b){var c=Ak(\"^(?:Object\\\\.|\\\\[object Object\\\\]\\\\.)?(?:ScalaJS\\\\.c\\\\.|\\\\$c_)([^\\\\.]+)(?:\\\\.prototype)?\\\\.([^\\\\.]+)$\"),e=Ak(\"^(?:Object\\\\.|\\\\[object Object\\\\]\\\\.)?(?:ScalaJS\\\\.(?:s|f)\\\\.|\\\\$(?:s|f)_)((?:_[^_]|[^_])+)__([^\\\\.]+)$\"),f=Ak(\"^(?:Object\\\\.|\\\\[object Object\\\\]\\\\.)?(?:ScalaJS\\\\.m\\\\.|\\\\$m_)([^\\\\.]+)$\"),g=!1;c=c.exec(b);null===c&&(c=e.exec(b),null===c&&(c=f.exec(b),g=!0));if(null!==c){b=c[1];if(void 0===b)throw(new V).h(\"undefined.get\");b=36===(65535&(b.charCodeAt(0)|0))?b.substring(1):\nb;e=Ek(a);if(Fj().Sj.call(e,b)){a=Ek(a);if(!Fj().Sj.call(a,b))throw(new V).h(\"key not found: \"+b);a=a[b]}else a:for(f=0;;)if(f<(Ck(a).length|0)){e=Ck(a)[f];if(0<=(b.length|0)&&b.substring(0,e.length|0)===e){a=Dk(a);if(!Fj().Sj.call(a,e))throw(new V).h(\"key not found: \"+e);a=\"\"+a[e]+b.substring(e.length|0);break a}f=1+f|0}else{a=0<=(b.length|0)&&\"L\"===b.substring(0,1)?b.substring(1):b;break a}a=a.split(\"_\").join(\".\").split(\"$und\").join(\"_\");if(g)g=\"\\x3cclinit\\x3e\";else{g=c[2];if(void 0===g)throw(new V).h(\"undefined.get\");\n0<=(g.length|0)&&\"init___\"===g.substring(0,7)?g=\"\\x3cinit\\x3e\":(c=g.indexOf(\"__\")|0,g=0>c?g:g.substring(0,c))}return(new K).Q(a,g)}return(new K).Q(\"\\x3cjscode\\x3e\",b)}function Gk(a){var b=Bk(\"Line (\\\\d+).*script (?:in )?(\\\\S+)\",\"i\");a=a.message.split(\"\\n\");for(var c=[],e=2,f=a.length|0;e>24&&0===(4&a.q)<<24>>24&&(a.Mm={sjsr_:\"scala_scalajs_runtime_\",sjs_:\"scala_scalajs_\",sci_:\"scala_collection_immutable_\",scm_:\"scala_collection_mutable_\",scg_:\"scala_collection_generic_\",sc_:\"scala_collection_\",sr_:\"scala_runtime_\",s_:\"scala_\",jl_:\"java_lang_\",ju_:\"java_util_\"},a.q=(4|a.q)<<24>>24);return a.Mm}yk.prototype.$classData=z({Bz:0},!1,\"scala.scalajs.runtime.StackTrace$\",{Bz:1,c:1});var Hk=void 0;function Ik(){}Ik.prototype=new A;Ik.prototype.constructor=Ik;\nIk.prototype.a=function(){return this};function Bk(a,b){Jk||(Jk=(new Ik).a());return new l.RegExp(a,b)}function Ak(a){Jk||(Jk=(new Ik).a());return new l.RegExp(a)}Ik.prototype.$classData=z({Cz:0},!1,\"scala.scalajs.runtime.StackTrace$StringRE$\",{Cz:1,c:1});var Jk=void 0;function Kk(){}Kk.prototype=new A;Kk.prototype.constructor=Kk;Kk.prototype.a=function(){return this};function T(a,b){return b instanceof Lk?b.If:b}function Yc(a,b){return b instanceof W?b:(new Lk).j(b)}\nKk.prototype.$classData=z({Dz:0},!1,\"scala.scalajs.runtime.package$\",{Dz:1,c:1});var Mk=void 0;function S(){Mk||(Mk=(new Kk).a());return Mk}function Nk(){}Nk.prototype=new A;Nk.prototype.constructor=Nk;Nk.prototype.a=function(){return this};function Ok(a,b){if(b instanceof wb)return a.s===b.s;if(Pk(b)){if(\"number\"===typeof b)return+b===a.s;if(b instanceof x){b=Ma(b);var c=b.i;a=a.s;return b.f===a&&c===a>>31}return null===b?null===a:Ca(b,a)}return null===a&&null===b}\nfunction G(a,b,c){if(b===c)c=!0;else if(Pk(b))a:if(Pk(c))c=Qk(0,b,c);else{if(c instanceof wb){if(\"number\"===typeof b){c=+b===c.s;break a}if(b instanceof x){a=Ma(b);b=a.i;c=c.s;c=a.f===c&&b===c>>31;break a}}c=null===b?null===c:Ca(b,c)}else c=b instanceof wb?Ok(b,c):null===b?null===c:Ca(b,c);return c}\nfunction Qk(a,b,c){if(\"number\"===typeof b)return a=+b,\"number\"===typeof c?a===+c:c instanceof x?(b=Ma(c),c=b.f,b=b.i,a===Rk(y(),c,b)):c instanceof Sk?c.t(a):!1;if(b instanceof x){b=Ma(b);a=b.f;b=b.i;if(c instanceof x){c=Ma(c);var e=c.i;return a===c.f&&b===e}return\"number\"===typeof c?(c=+c,Rk(y(),a,b)===c):c instanceof Sk?c.t((new x).g(a,b)):!1}return null===b?null===c:Ca(b,c)}Nk.prototype.$classData=z({Fz:0},!1,\"scala.runtime.BoxesRunTime$\",{Fz:1,c:1});var Tk=void 0;\nfunction H(){Tk||(Tk=(new Nk).a());return Tk}var Uk=z({Jz:0},!1,\"scala.runtime.Null$\",{Jz:1,c:1});function Vk(){}Vk.prototype=new A;Vk.prototype.constructor=Vk;Vk.prototype.a=function(){return this};Vk.prototype.$classData=z({Oz:0},!1,\"scala.runtime.RichDouble$\",{Oz:1,c:1});var Wk=void 0;function Xk(){Wk||(Wk=(new Vk).a())}function Yk(){}Yk.prototype=new A;Yk.prototype.constructor=Yk;Yk.prototype.a=function(){return this};function Zk(a,b){return Rk(y(),b.f,b.i)}\nYk.prototype.$classData=z({Qz:0},!1,\"scala.runtime.RichLong$\",{Qz:1,c:1});var $k=void 0;function al(){$k||($k=(new Yk).a());return $k}function bl(){}bl.prototype=new A;bl.prototype.constructor=bl;bl.prototype.a=function(){return this};function Ii(a,b){if(ub(b,1)||eb(b,1)||hb(b,1)||fb(b,1)||gb(b,1)||bb(b,1)||cb(b,1)||db(b,1)||$a(b,1)||cl(b))return b.b.length;if(null===b)throw(new Oc).a();throw(new J).j(b);}\nfunction dl(a,b,c,e){if(ub(b,1))b.b[c]=e;else if(eb(b,1))b.b[c]=e|0;else if(hb(b,1))b.b[c]=+e;else if(fb(b,1))b.b[c]=Ma(e);else if(gb(b,1))b.b[c]=+e;else if(bb(b,1))b.b[c]=null===e?0:e.s;else if(cb(b,1))b.b[c]=e|0;else if(db(b,1))b.b[c]=e|0;else if($a(b,1))b.b[c]=!!e;else if(cl(b))b.b[c]=void 0;else{if(null===b)throw(new Oc).a();throw(new J).j(b);}}function el(a){Ji();var b=(new fl).af(a);return U(b,a.Ba()+\"(\",\",\",\")\")}\nfunction gl(a,b,c){if(ub(b,1)||eb(b,1)||hb(b,1)||fb(b,1)||gb(b,1))return b.b[c];if(bb(b,1))return Zj(b.b[c]);if(cb(b,1)||db(b,1)||$a(b,1)||cl(b))return b.b[c];if(null===b)throw(new Oc).a();throw(new J).j(b);}bl.prototype.$classData=z({Sz:0},!1,\"scala.runtime.ScalaRunTime$\",{Sz:1,c:1});var hl=void 0;function Ji(){hl||(hl=(new bl).a());return hl}function il(){}il.prototype=new A;il.prototype.constructor=il;d=il.prototype;d.a=function(){return this};\nd.pi=function(a,b){b=n(-862048943,b);b=n(461845907,b<<15|b>>>17|0);return a^b};function jl(a,b){a=Ja(b);if(a===b)return a;var c=y();a=kl(c,b);c=c.M;return Rk(y(),a,c)===b?a^c:Ga(Ha(),b)}function wi(a,b){return null===b?0:\"number\"===typeof b?jl(0,+b):b instanceof x?(a=Ma(b),ll(0,(new x).g(a.f,a.i))):Da(b)}d.Fc=function(a,b){a=this.pi(a,b);return-430675100+n(5,a<<13|a>>>19|0)|0};function ll(a,b){a=b.f;b=b.i;return b===a>>31?a:a^b}\nd.We=function(a,b){a^=b;a=n(-2048144789,a^(a>>>16|0));a=n(-1028477387,a^(a>>>13|0));return a^(a>>>16|0)};d.$classData=z({Uz:0},!1,\"scala.runtime.Statics$\",{Uz:1,c:1});var ml=void 0;function xi(){ml||(ml=(new il).a());return ml}function Tc(){this.Cc=null}Tc.prototype=new A;Tc.prototype.constructor=Tc;Tc.prototype.j=function(a){this.Cc=a;return this};Tc.prototype.Xe=function(a){return(0,this.Cc)(a)};Tc.prototype.$classData=z({ep:0},!1,\"atcoder.StdInConverter$$$Lambda$1\",{ep:1,c:1,Mi:1});\nfunction Hc(){this.Cc=null}Hc.prototype=new A;Hc.prototype.constructor=Hc;Hc.prototype.j=function(a){this.Cc=a;return this};Hc.prototype.Xe=function(a){return(0,this.Cc)(a)};Hc.prototype.$classData=z({fp:0},!1,\"atcoder.StdInConverter$$$Lambda$2\",{fp:1,c:1,Mi:1});function zc(){this.Cc=null}zc.prototype=new A;zc.prototype.constructor=zc;zc.prototype.j=function(a){this.Cc=a;return this};zc.prototype.Xe=function(a){return(0,this.Cc)(a)};\nzc.prototype.$classData=z({gp:0},!1,\"atcoder.StdInConverter$$$Lambda$3\",{gp:1,c:1,Mi:1});function Nc(){this.Cc=null}Nc.prototype=new A;Nc.prototype.constructor=Nc;Nc.prototype.j=function(a){this.Cc=a;return this};Nc.prototype.Xe=function(a){return(0,this.Cc)(a)};Nc.prototype.$classData=z({hp:0},!1,\"atcoder.StdInConverter$$$Lambda$4\",{hp:1,c:1,Mi:1});function Kc(){this.Cc=null}Kc.prototype=new A;Kc.prototype.constructor=Kc;Kc.prototype.j=function(a){this.Cc=a;return this};\nKc.prototype.Xe=function(a){return(0,this.Cc)(a)};Kc.prototype.$classData=z({ip:0},!1,\"atcoder.StdInConverter$$$Lambda$5\",{ip:1,c:1,Mi:1});function bd(){}bd.prototype=new A;bd.prototype.constructor=bd;bd.prototype.a=function(){return this};bd.prototype.$classData=z({up:0},!1,\"cats.NotNull$$anon$1\",{up:1,c:1,lA:1});function Rb(){this.Po=this.la=null}Rb.prototype=new A;Rb.prototype.constructor=Rb;Rb.prototype.$classData=z({Bp:0},!1,\"cats.Show$ToShowOps$$anon$1\",{Bp:1,c:1,rA:1});function nl(){}\nnl.prototype=new kd;nl.prototype.constructor=nl;function ol(){}ol.prototype=nl.prototype;function pl(){}pl.prototype=new A;pl.prototype.constructor=pl;function ql(){}ql.prototype=pl.prototype;\nfunction rl(a){sl();a=he(Qd(),a);if(a instanceof Zd)a=(new Q).j(a.yf);else{if(a instanceof $d)throw a=a.Gf,T(S(),a);if(a instanceof Nd){Fd||(Fd=(new Ed).a());var b=(new ul).a();Dd();var c=(new be).a();Pd(Qd(),a,c,b,null,null,null);if(0===(2&c.ue)<<24>>24)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/internals/IOConnection.scala: 109\");a=c.Am;c=b.s;if(c instanceof wc)a=(new Q).j(c.E);else{if(c instanceof Fc)throw a=c.E,T(S(),\na);if(null===c){b.wj=!1;b.ma=!0;b=pd();if(0===(1&b.ma)<<24>>24)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/internals/Callback.scala: 37\");b=b.lo;c=Qd();var e=Dd();if(!e.ma)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/internals/IOConnection.scala: 94\");Pd(c,a,e.Qo,b,null,null,null);throw(new Pc).h(\"cannot synchronously await result on JavaScript; use runAsync or unsafeRunAsync\");\n}throw(new J).j(c);}}else throw(new wj).j(\"unreachable\");}a.Nb()}pl.prototype.n=function(){return this instanceof Zd?\"IO(\"+this.yf+\")\":this instanceof $d?\"IO(throw \"+this.Gf+\")\":\"IO$\"+Ia(this)};function vl(a,b){if(a instanceof ae){var c=a.Xb,e=a.Jb,f=a.wd;return 31!==f?wl(new ae,c,e.Rb(b),1+f|0):wl(new ae,a,b,0)}return wl(new ae,a,b,0)}function be(){this.Am=this.Ai=null;this.ue=0}be.prototype=new yd;be.prototype.constructor=be;\nbe.prototype.a=function(){this.Ai=(new xl).j((L(),M()));this.ue=(1|this.ue)<<24>>24;Mb();this.Am=(new td).ge(Ob(function(a){return function(){var b=a.Ai,c=b.s;b.s=null;null===c||M().t(c)?b=sd():(wd||(wd=(new qd).a()),b=rd(wd,yl(c)));return b}}(this)));this.ue=(2|this.ue)<<24>>24;return this};be.prototype.el=function(){return null===this.Ai.s};\nbe.prototype.fo=function(){for(;;){var a=this.Ai.s;if(null===a||M().t(a)){sd();break}if(a instanceof N){var b=this.Ai;a===b.s?(b.s=a.uc,a=!0):a=!1;if(a)break}else throw(new J).j(a);}};be.prototype.$classData=z({cq:0},!1,\"cats.effect.internals.IOConnection$Impl\",{cq:1,aq:1,c:1});function Cd(){}Cd.prototype=new yd;Cd.prototype.constructor=Cd;Cd.prototype.a=function(){return this};Cd.prototype.el=function(){return!1};Cd.prototype.fo=function(){sd()};\nCd.prototype.$classData=z({dq:0},!1,\"cats.effect.internals.IOConnection$Uncancelable\",{dq:1,aq:1,c:1});function Kd(){}Kd.prototype=new A;Kd.prototype.constructor=Kd;function zl(){}zl.prototype=Kd.prototype;Kd.prototype.n=function(){return\"\\x3cfunction1\\x3e\"};Kd.prototype.Rb=function(a){return jb(this,a)};function ul(){this.wj=!1;this.s=null;this.ma=!1}ul.prototype=new A;ul.prototype.constructor=ul;d=ul.prototype;d.a=function(){this.ma=this.wj=!0;return this};d.l=function(a){this.gh(a)};d.n=function(){return\"\\x3cfunction1\\x3e\"};\nd.gh=function(a){if(!this.ma)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/js/src/main/scala/cats/effect/internals/IOPlatform.scala: 66\");this.wj?(this.wj=!1,this.ma=!0,this.s=a):a instanceof Fc&&(a=a.E,nd().l(a))};d.Rb=function(a){return jb(this,a)};d.$classData=z({gq:0},!1,\"cats.effect.internals.IOPlatform$ResyncCallback\",{gq:1,c:1,P:1});function Al(){this.k=this.mo=this.Uc=null}Al.prototype=new A;Al.prototype.constructor=Al;\nAl.prototype.Lj=function(){var a=this.k.qg,b=this.mo,c=new Bl;if(null===b)throw T(S(),null);c.k=b;c.Ph=b.ce;c.ma=(1|c.ma)<<24>>24;c.Wc=b.hd;for(c.ma=(2|c.ma)<<24>>24;c.r();)Yd(a,c.u());oe(this.k,this.Uc)};function pe(a,b,c){var e=new Al;e.Uc=b;e.mo=c;if(null===a)throw T(S(),null);e.k=a;return e}Al.prototype.$classData=z({mq:0},!1,\"cats.effect.internals.Trampoline$ResumeRun$1\",{mq:1,c:1,Jn:1});function se(){this.Oo=this.Eh=null;this.ma=!1}se.prototype=new A;se.prototype.constructor=se;\nse.prototype.ol=function(a){this.Eh.ol(a)};se.prototype.al=function(a){this.Eh=a;this.Oo=(new ne).al(a);this.ma=!0;return this};se.prototype.oh=function(a){this.Oo.oh(a)};se.prototype.$classData=z({nq:0},!1,\"cats.effect.internals.TrampolineEC\",{nq:1,c:1,Xv:1});function te(){}te.prototype=new A;te.prototype.constructor=te;te.prototype.a=function(){return this};te.prototype.ol=function(a){nd().l(a)};te.prototype.oh=function(a){a.Lj()};\nte.prototype.$classData=z({pq:0},!1,\"cats.effect.internals.TrampolineEC$$anon$1\",{pq:1,c:1,Xv:1});function Cl(){}Cl.prototype=new xe;Cl.prototype.constructor=Cl;function Dl(){}Dl.prototype=Cl.prototype;function El(){}El.prototype=new ze;El.prototype.constructor=El;function Fl(){}Fl.prototype=El.prototype;function Gl(){}Gl.prototype=new xe;Gl.prototype.constructor=Gl;function Hl(){}Hl.prototype=Gl.prototype;\nfunction Il(a){var b=Jl(a);return Kl(new Ll,b,Od(function(c){return function(e,f){return Ml(c).$a(e.E,f.E)}}(a)))}function Nl(a){var b=Ol(a);return Pl(new Ql,b,Od(function(c){return function(e,f){var g=e.ra,h=f.ra,k=bh().G;g=Rl(g,h,k).Mb(F(function(){return function(m){return!G(H(),m.Ga(),m.Qa())}}(c)));g.m()?g=R():(g=g.Nb(),g=(new Q).j(Ml(c).$a(g.Ga().E,g.Qa().E)));g.m()?(Sl(c),e=Tl(e.ra),Sl(c),f=Tl(f.ra),f=e===f?0:e>24&&0===(1&b.q)<<24>>24){a:try{l.Packages.org.mozilla.javascript.JavaScriptException;var e=!0}catch(u){e=Yc(S(),u);if(null!==e){if(e instanceof Lk){e=!1;break a}throw T(S(),e);}throw u;}b.An=e;b.q=(1|b.q)<<24>>24}if(b.An)e=c.stack,e=(void 0===e?\"\":e).replace(Bk(\"^\\\\s+at\\\\s+\",\"gm\"),\"\").replace(Bk(\"^(.+?)(?: \\\\((.+)\\\\))?$\",\"gm\"),\"$2@$1\").replace(Bk(\"\\\\r\\\\n?\",\"gm\"),\"\\n\").split(\"\\n\");else if(c.arguments&&\nc.stack)e=zk(c);else if(c.stack&&c.sourceURL)e=c.stack.replace(Bk(\"\\\\[native code\\\\]\\\\n\",\"m\"),\"\").replace(Bk(\"^(?\\x3d\\\\w+Error\\\\:).*$\\\\n\",\"m\"),\"\").replace(Bk(\"^@\",\"gm\"),\"{anonymous}()@\").split(\"\\n\");else if(c.stack&&c.number)e=c.stack.replace(Bk(\"^\\\\s*at\\\\s+(.*)$\",\"gm\"),\"$1\").replace(Bk(\"^Anonymous function\\\\s+\",\"gm\"),\"{anonymous}() \").replace(Bk(\"^([^\\\\(]+|\\\\{anonymous\\\\}\\\\(\\\\))\\\\s+\\\\((.+)\\\\)$\",\"gm\"),\"$1@$2\").split(\"\\n\").slice(1);else if(c.stack&&c.fileName)e=c.stack.replace(Bk(\"(?:\\\\n@:0)?\\\\s+$\",\n\"m\"),\"\").replace(Bk(\"^(?:\\\\((\\\\S*)\\\\))?@\",\"gm\"),\"{anonymous}($1)@\").split(\"\\n\");else if(c.message&&c[\"opera#sourceloc\"])if(c.stacktrace)if(-1c.stacktrace.split(\"\\n\").length)e=Gk(c);else{e=Bk(\"Line (\\\\d+).*script (?:in )?(\\\\S+)(?:: In function (\\\\S+))?$\",\"i\");c=c.stacktrace.split(\"\\n\");var f=[];for(var g=0,h=c.length|0;gc.stacktrace.indexOf(\"called from line\")){e=Ak(\"^(.*)@(.+):(\\\\d+)$\");c=c.stacktrace.split(\"\\n\");f=[];g=0;for(h=c.length|0;g>24&&(a.dl=Mc(xc(),(new qc).ge(Ob(function(b){return function(){return bn(b)}}(a))),(new qc).ge(Ob(function(b){return function(){0===(2&b.q)<<24>>24&&0===(2&b.q)<<24>>24&&(b.vn=yc(),b.q=(2|b.q)<<24>>24);return b.vn}}(a)))),a.q=(4|a.q)<<24>>24);return a.dl}function bn(a){0===(1&a.q)<<24>>24&&0===(1&a.q)<<24>>24&&(a.un=Sc(),a.q=(1|a.q)<<24>>24);return a.un}function pc(){var a=(new $m).a();return 0===(8&a.q)<<24>>24?cn(a):a.cl}\nfunction cn(a){if(0===(8&a.q)<<24>>24){var b=xc(),c=xc(),e=new dn,f=xc();a.cl=Gc(b,Jc(c,e,Mc(f,(new qc).ge(Ob(function(g){return function(){return bn(g)}}(a))),(new qc).ge(Ob(function(g){return function(){return 0===(4&g.q)<<24>>24?an(g):g.dl}}(a))))));a.q=(8|a.q)<<24>>24}return a.cl}$m.prototype.$classData=z({bp:0},!1,\"atcoder.ABC142F$anon$lazy$macro$9$1\",{bp:1,c:1,e:1,d:1});function en(){}en.prototype=new A;en.prototype.constructor=en;en.prototype.a=function(){fn=this;(new gn).a();return this};\nen.prototype.$classData=z({xp:0},!1,\"cats.Show$\",{xp:1,c:1,e:1,d:1});var fn=void 0;function hn(){fn||(fn=(new en).a())}function jn(){}jn.prototype=new ol;jn.prototype.constructor=jn;function kn(){}kn.prototype=jn.prototype;function ln(){this.ma=!1}ln.prototype=new A;ln.prototype.constructor=ln;function mn(){}mn.prototype=ln.prototype;function Xd(){this.cj=this.Dm=0;this.ce=null;this.ma=this.hd=0}Xd.prototype=new A;Xd.prototype.constructor=Xd;d=Xd.prototype;\nd.a=function(){Xd.prototype.ua.call(this,8);return this};d.m=function(){return 0===this.hd&&null===this.ce.b[0]};d.qu=function(a,b){this.Dm=b;this.cj=-1+b|0;this.ma=(1|this.ma)<<24>>24;this.ce=a;this.ma=(2|this.ma)<<24>>24;this.hd=0;this.ma=(4|this.ma)<<24>>24};function Id(a){if(0===a.hd)if(null!==a.ce.b[0])a.ce=a.ce.b[0],a.hd=a.cj;else return null;var b=a.ce.b[a.hd];a.ce.b[a.hd]=null;a.hd=-1+a.hd|0;return b}d.ua=function(a){Xd.prototype.qu.call(this,r(D(C),[a]),a);return this};\nfunction Yd(a,b){if(a.hd===a.cj){var c=r(D(C),[a.Dm]);c.b[0]=a.ce;a.ce=c;a.hd=1}else a.hd=1+a.hd|0;a.ce.b[a.hd]=b}d.$classData=z({Vp:0},!1,\"cats.effect.internals.ArrayStack\",{Vp:1,c:1,e:1,d:1});function nn(){this.s=this.pg=this.jh=this.xe=null;this.ma=!1}nn.prototype=new A;nn.prototype.constructor=nn;d=nn.prototype;d.l=function(a){this.gh(a)};d.Yk=function(a,b){this.xe=a;this.jh=b;this.pg=(new on).$e(!0);this.ma=!0;return this};d.Lj=function(){this.jh.l(this.s)};d.n=function(){return\"\\x3cfunction1\\x3e\"};\nd.gh=function(a){var b=this.pg,c=b.s;b.s=!1;if(c)null!==this.xe&&this.xe.fo(),this.s=a,ue().oh(this);else if(!(a instanceof wc))if(a instanceof Fc)a=a.E,nd().l(a);else throw(new J).j(a);};d.Rb=function(a){return jb(this,a)};d.$classData=z({Yp:0},!1,\"cats.effect.internals.Callback$AsyncIdempotentCallback\",{Yp:1,c:1,P:1,Jn:1});function vd(){this.Pk=this.Se=null;this.ue=!1}vd.prototype=new zl;vd.prototype.constructor=vd;vd.prototype.l=function(){return ud(this)};\nfunction ud(a){if(a.Se.r()){var b=a.Se.u();return ge(new Wd,b,a)}b=a.Pk.Sa();if(M().t(b))return sd();if(b instanceof N){a=b.th;for(b=b.uc;!b.m();){var c=b.w();nd().l(c);b=b.cb()}Mb();return Vd(a)}throw(new J).j(b);}vd.prototype.ml=function(a){pn(this.Pk,a);return ud(this)};vd.prototype.bl=function(a){this.Se=a;qn();this.Pk=(new rn).Bg((new sn).a()).Lb;this.ue=!0;return this};vd.prototype.$classData=z({$p:0},!1,\"cats.effect.internals.CancelUtils$CancelAllFrame\",{$p:1,eq:1,c:1,P:1});\nfunction ce(){this.xe=this.jh=null;this.Ml=this.pg=!1;this.s=this.Fk=this.Ek=null;this.ma=0}ce.prototype=new A;ce.prototype.constructor=ce;d=ce.prototype;d.l=function(a){this.gh(a)};d.Yk=function(a,b){this.jh=b;this.xe=a;this.ma=(1|this.ma)<<24>>24;this.pg=!1;this.ma=(2|this.ma)<<24>>24;this.Ml=!1;this.ma=(4|this.ma)<<24>>24;return this};\nfunction tn(a,b){var c=a.Ek,e=a.Fk;a.Ek=null;a.Fk=null;if(!a.xe.el())if(b instanceof wc)b=b.E,Pd(Qd(),(new Zd).j(b),a.xe,a.jh,a,c,e);else if(b instanceof Fc)b=b.E,Pd(Qd(),Vd(b),a.xe,a.jh,a,c,e);else throw(new J).j(b);}d.Lj=function(){var a=this.s;this.s=null;tn(this,a)};d.n=function(){return\"\\x3cfunction1\\x3e\"};d.gh=function(a){this.pg&&(this.pg=!1,this.Ml?(this.s=a,ue().oh(this)):tn(this,a))};d.Rb=function(a){return jb(this,a)};\nd.$classData=z({iq:0},!1,\"cats.effect.internals.IORunLoop$RestartCallback\",{iq:1,c:1,P:1,Jn:1});function fe(){this.Hg=this.ll=null}fe.prototype=new zl;fe.prototype.constructor=fe;fe.prototype.l=function(a){return this.Ck(a)};fe.prototype.ml=function(a){return un(new ee,Vd(a),F(function(b,c){return function(e){return og(0,c|0,b.ll|0,e|0)}}(this,a)))};fe.prototype.Ck=function(a){return un(new ee,(new Zd).j(a),F(function(b,c){return function(e){return og(c|0,0,b.ll|0,e|0)}}(this,a)))};\nfe.prototype.$classData=z({jq:0},!1,\"cats.effect.internals.IORunLoop$RestoreContext\",{jq:1,eq:1,c:1,P:1});function Ne(){}Ne.prototype=new A;Ne.prototype.constructor=Ne;Ne.prototype.a=function(){Le=this;(new Q).j(vn());(new Q).j(wn());(new Q).j(xn());(new yn).a();return this};Ne.prototype.$classData=z({lr:0},!1,\"cats.kernel.Comparison$\",{lr:1,c:1,e:1,d:1});var Le=void 0;function zn(){}zn.prototype=new Fl;zn.prototype.constructor=zn;function An(){}An.prototype=zn.prototype;function Bn(){}\nBn.prototype=new Hl;Bn.prototype.constructor=Bn;function Cn(){}Cn.prototype=Bn.prototype;function Dn(){this.Bn=this.Bk=this.Yl=this.Mh=this.fl=this.lg=this.xf=this.be=null}Dn.prototype=new A;Dn.prototype.constructor=Dn;function En(a,b,c){return 0===c?Fn(a,b):0===b.f&&0===b.i&&0<=c&&cb;)c=b,c=(new Gn).g(c,0),a.push(c),b=1+b|0;this.Yl=ka(D(Kn),a);a=[];for(b=0;11>b;)c=b,c=(new Gn).g(0,c),a.push(c),b=1+b|0;this.Bk=ka(D(Kn),a);\nthis.Bn=\"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";return this};function Ln(a,b,c,e){a=0>c?-c|0:c;var f=0===c?0:0>c?-1:1;if(Tf().Ak===e)return f;if(Tf().ik===e)return 0;if(Tf().hk===e)return 0f?f:0;if(Tf().mk===e)return 5<=a?f:0;if(Tf().lk===e)return 5(-2147483648^b.f):-1>a)?a=!0:(a=b.i,a=0===a?-1<(-2147483648^b.f):0(-2147483648^b.f):0>c}else c=!1;return c?a.Yl.b[b.f]:(new Gn).Xk(b,0)}function Jn(a,b){b=0>b.i?(new x).g(~b.f,~b.i):b;a=b.f;b=b.i;return 64-(0!==b?da(b):32+da(a)|0)|0}\nfunction In(a,b){var c=[];if(0>31,k=65535&e,m=e>>>16|0,p=65535&b,q=b>>>16|0,t=n(k,p);p=n(m,p);var u=n(k,q);k=t+((p+u|0)<<16)|0;t=(t>>>16|0)+u|0;e=(((n(e,h)+n(g,b)|0)+n(m,q)|0)+(t>>>16|0)|0)+(((65535&t)+p|0)>>>16|0)|0;e=(new x).g(k,e);f=1+f|0;g=e;c.push(null===g?null:g)}}return ka(D(Xa),c)}Dn.prototype.$classData=z({As:0},!1,\"java.math.BigDecimal$\",{As:1,c:1,e:1,d:1});var Hn=void 0;\nfunction Y(){Hn||(Hn=(new Dn).a());return Hn}function On(){this.yk=this.sm=this.Si=this.be=this.lg=this.xf=null}On.prototype=new A;On.prototype.constructor=On;\nOn.prototype.a=function(){Pn=this;this.xf=(new Jf).g(1,1);this.lg=(new Jf).g(1,10);this.be=(new Jf).g(0,0);this.Si=(new Jf).g(-1,1);this.sm=ka(D(bf),[this.be,this.xf,(new Jf).g(1,2),(new Jf).g(1,3),(new Jf).g(1,4),(new Jf).g(1,5),(new Jf).g(1,6),(new Jf).g(1,7),(new Jf).g(1,8),(new Jf).g(1,9),this.lg]);var a=[];for(var b=0;32>b;){var c=b;c=Kf(lf(),(new x).g(0===(32&c)?1<b.i)return-1!==b.f||-1!==b.i?(a=b.f,b=b.i,Qn(new Jf,-1,(new x).g(-a|0,0!==a?~b:-b|0))):a.Si;var c=b.i;return(0===c?-2147483638>=(-2147483648^b.f):0>c)?a.sm.b[b.f]:Qn(new Jf,1,b)}On.prototype.$classData=z({Cs:0},!1,\"java.math.BigInteger$\",{Cs:1,c:1,e:1,d:1});var Pn=void 0;function lf(){Pn||(Pn=(new On).a());return Pn}function Rn(){this.zk=this.Ji=this.lk=this.mk=this.kk=this.hk=this.ik=this.Ak=null}Rn.prototype=new A;Rn.prototype.constructor=Rn;\nRn.prototype.a=function(){Sn=this;this.Ak=(new Tn).ec(\"UP\",0);this.ik=(new Tn).ec(\"DOWN\",1);this.hk=(new Tn).ec(\"CEILING\",2);this.kk=(new Tn).ec(\"FLOOR\",3);this.mk=(new Tn).ec(\"HALF_UP\",4);this.lk=(new Tn).ec(\"HALF_DOWN\",5);this.Ji=(new Tn).ec(\"HALF_EVEN\",6);this.zk=(new Tn).ec(\"UNNECESSARY\",7);ka(D(Un),[this.Ak,this.ik,this.hk,this.kk,this.mk,this.lk,this.Ji,this.zk]);return this};Rn.prototype.$classData=z({Ms:0},!1,\"java.math.RoundingMode$\",{Ms:1,c:1,e:1,d:1});var Sn=void 0;\nfunction Tf(){Sn||(Sn=(new Rn).a());return Sn}function Vn(){this.gj=null}Vn.prototype=new A;Vn.prototype.constructor=Vn;Vn.prototype.a=function(){this.gj=\", \";return this};Vn.prototype.$classData=z({Ps:0},!1,\"scalax.collection.GraphBase$\",{Ps:1,c:1,e:1,d:1});var Wn=void 0;function Xn(){Wn||(Wn=(new Vn).a());return Wn}function Yn(){this.k=this.mj=null}Yn.prototype=new A;Yn.prototype.constructor=Yn;Yn.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};\nfunction Zn(a,b){var c=$n(a.k.ac,b);return null===c?a.mj.sh(b,Ob(function(e,f){return function(){var g=e.k,h=g.rg.Pe;g=ao(new bo,g,f,h);e.mj=e.mj.Ke((new K).Q(f,g));return g}}(a,b))):c}\nfunction co(a,b){a.mj=eo();switch(Tl(b)){case 2:a=(new K).Q(Zn(a,b.Xa.U(0)),Zn(a,fo(b)));break;case 3:a=(new go).uj(Zn(a,b.Xa.U(0)),Zn(a,fo(b)),Zn(a,ho(b,2)));break;case 4:a=(new io).Nf(Zn(a,b.Xa.U(0)),Zn(a,fo(b)),Zn(a,ho(b,2)),Zn(a,ho(b,3)));break;case 5:var c=new jo,e=Zn(a,b.Xa.U(0)),f=Zn(a,fo(b)),g=Zn(a,ho(b,2)),h=Zn(a,ho(b,3));a=Zn(a,ho(b,4));c.lc=e;c.nc=f;c.pc=g;c.Fd=h;c.ah=a;a=c;break;default:c=bh().G;c=Wb(b,c);for(b=ko(b);b.r();)e=b.u(),c.Ta(Zn(a,e));a=c.Ca().Sa()}return(new Ub).af(a)}\nYn.prototype.$classData=z({Rs:0},!1,\"scalax.collection.GraphBase$Edge$\",{Rs:1,c:1,e:1,d:1});function lo(){this.k=null}lo.prototype=new A;lo.prototype.constructor=lo;lo.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};lo.prototype.$classData=z({Ss:0},!1,\"scalax.collection.GraphBase$EdgeOrdering$\",{Ss:1,c:1,e:1,d:1});function mo(){this.k=null}mo.prototype=new A;mo.prototype.constructor=mo;function no(a,b){a=a.k;var c=a.rg.Pe;return ao(new bo,a,b,c)}\nmo.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};mo.prototype.$classData=z({Ws:0},!1,\"scalax.collection.GraphBase$Node$\",{Ws:1,c:1,e:1,d:1});function oo(){this.k=null}oo.prototype=new A;oo.prototype.constructor=oo;oo.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};oo.prototype.$classData=z({Xs:0},!1,\"scalax.collection.GraphBase$NodeOrdering$\",{Xs:1,c:1,e:1,d:1});function po(){this.Tn=null}po.prototype=new A;po.prototype.constructor=po;\npo.prototype.a=function(){this.Tn=\"~\\x3e\";return this};po.prototype.$classData=z({$s:0},!1,\"scalax.collection.GraphEdge$DiEdgeLike$\",{$s:1,c:1,e:1,d:1});var qo=void 0;function ro(a){return!!(a&&a.$classData&&a.$classData.qa.mm)}function so(a){return!!(a&&a.$classData&&a.$classData.qa.jt)}function to(a){return!!(a&&a.$classData&&a.$classData.qa.nm)}function uo(){}uo.prototype=new A;uo.prototype.constructor=uo;uo.prototype.$classData=z({lt:0},!1,\"scalax.collection.State$$anon$1\",{lt:1,c:1,e:1,d:1});\nfunction vo(){y()}vo.prototype=new A;vo.prototype.constructor=vo;function wo(){var a=new vo;ig||(ig=(new hg).a());(new xo).ua(yo().mn);return a}vo.prototype.$classData=z({mt:0},!1,\"scalax.collection.State$FlagStore\",{mt:1,c:1,e:1,d:1});function zo(a){if(a.r())return a.Wn(R()),a.Ih;throw(new V).a();}function Ao(){this.k=this.ek=this.Fi=null}Ao.prototype=new A;Ao.prototype.constructor=Ao;\nfunction Bo(a){if(null===a.k.Ve)return(new Co).ua(32);if(null===a.ek){var b=(new Co).ua(a.k.Ve.x());a.Fi=R();var c=a.k.Ve,e=function(k,m){return function(p){Sl(k.k.k);var q=p.ra,t=k.k,u=k.k;if(q=q.Xa.U(0)===t&&fo(q)===u)null===k.Fi&&Bo(k),q=k.Fi.m();q&&(k.Fi=(new Q).j((new K).Q(k.k,p)));q=k.k;Sl(q.k);Sl(q.k);t=fo(p.ra);t!==q&&Do(m,t,p)}}(a,b);if(null===c.pb){c=c.vd;for(var f=0,g=c.Ya.b.length;fb)a=48<=b&&57>=b?-48+b|0:65<=b&&90>=b?-55+b|0:97<=b&&122>=b?-87+b|0:-1;else if(65313<=b&&65338>=b)a=-65303+b|0;else if(65345<=b&&65370>=b)a=-65335+b|0;else{var e=Dg(Jg(),Ko(a),b);e=0>e?-2-e|0:e;0>e?a=-1:(a=b-Ko(a).b[e]|0,a=9>24&&0===(16&a.q)<<24>>24&&(a.Un=ka(D(E),[1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43600,44016,65296,66720,69734,69872,69942,70096,71360,120782,120792,120802,120812,120822]),a.q=(16|a.q)<<24>>24);return a.Un}Io.prototype.$classData=z({Fu:0},!1,\"java.lang.Character$\",{Fu:1,c:1,e:1,d:1});var Lo=void 0;function Mo(){Lo||(Lo=(new Io).a());return Lo}\nfunction No(){this.$m=this.an=null;this.q=0}No.prototype=new A;No.prototype.constructor=No;No.prototype.a=function(){return this};No.prototype.ph=function(a){throw(new Oo).h('For input string: \"'+a+'\"');};function Po(a,b,c){return b!==b?c!==c?0:1:c!==c?-1:b===c?0===b?(a=1/b,a===1/c?0:0>a?-1:1):0:b>24&&0===(1&a.q)<<24>>24&&(a.an=new l.RegExp(\"^[\\\\x00-\\\\x20]*([+-]?(?:NaN|Infinity|(?:\\\\d+\\\\.?\\\\d*|\\\\.\\\\d+)(?:[eE][+-]?\\\\d+)?)[fFdD]?)[\\\\x00-\\\\x20]*$\"),a.q=(1|a.q)<<24>>24);var c=a.an.exec(b);if(null!==c)return c=c[1],+l.parseFloat(void 0===c?void 0:c);0===(2&a.q)<<24>>24&&0===(2&a.q)<<24>>24&&(a.$m=new l.RegExp(\"^[\\\\x00-\\\\x20]*([+-]?)0[xX]([0-9A-Fa-f]*)\\\\.?([0-9A-Fa-f]*)[pP]([+-]?\\\\d+)[fFdD]?[\\\\x00-\\\\x20]*$\"),a.q=(2|a.q)<<24>>24);var e=a.$m.exec(b);if(null!==e){c=\ne[1];var f=e[2],g=e[3];e=e[4];\"\"===f&&\"\"===g&&a.ph(b);b=\"\"+f+g;a=-((g.length|0)<<2)|0;for(g=0;;)if(g!==(b.length|0)&&48===(65535&(b.charCodeAt(g)|0)))g=1+g|0;else break;g=b.substring(g);\"\"===g?c=\"-\"===c?-0:0:(b=(f=15<(g.length|0))?g.substring(0,15):g,g=a+(f?(-15+(g.length|0)|0)<<2:0)|0,a=+l.parseInt(b,16),e=+l.parseInt(e,10),b=Ja(e)+g|0,g=b/3|0,e=+l.Math.pow(2,g),b=+l.Math.pow(2,b-(g<<1)|0),e=a*e*e*b,c=\"-\"===c?-e:e)}else c=a.ph(b);return c}\nNo.prototype.$classData=z({Iu:0},!1,\"java.lang.Double$\",{Iu:1,c:1,e:1,d:1});var Ro=void 0;function So(){Ro||(Ro=(new No).a());return Ro}function To(){this.Rl=null;this.Tl=0}To.prototype=new A;To.prototype.constructor=To;function Uo(){}Uo.prototype=To.prototype;To.prototype.t=function(a){return this===a};To.prototype.n=function(){return this.Rl};To.prototype.ec=function(a,b){this.Rl=a;this.Tl=b;return this};To.prototype.z=function(){return Ia(this)};function Vo(){W.call(this)}Vo.prototype=new Zl;\nVo.prototype.constructor=Vo;function Wo(){}Wo.prototype=Vo.prototype;function Xo(){W.call(this)}Xo.prototype=new Zl;Xo.prototype.constructor=Xo;function Yo(){}Yo.prototype=Xo.prototype;function Zo(){}Zo.prototype=new A;Zo.prototype.constructor=Zo;Zo.prototype.a=function(){return this};Zo.prototype.ph=function(a){throw(new Oo).h('For input string: \"'+a+'\"');};\nfunction Wc(a,b,c){var e=null===b?0:b.length|0;(0===e||2>c||36=(b.length|0)&&a.ph(b);for(var k=0;f!==e;){var m=Jo(Mo(),65535&(b.charCodeAt(f)|0),c);k=k*c+m;(-1===m||k>h)&&a.ph(b);f=1+f|0}return g?-k|0:k|0}function oj(a,b){a=b-(1431655765&b>>1)|0;a=(858993459&a)+(858993459&a>>2)|0;return n(16843009,252645135&(a+(a>>4)|0))>>24}Zo.prototype.$classData=z({Lu:0},!1,\"java.lang.Integer$\",{Lu:1,c:1,e:1,d:1});\nvar $o=void 0;function Xc(){$o||($o=(new Zo).a());return $o}function ap(){this.tm=null;this.q=!1}ap.prototype=new A;ap.prototype.constructor=ap;ap.prototype.a=function(){return this};function bp(a){throw(new Oo).h('For input string: \"'+a+'\"');}function cp(a,b,c){for(var e=0;a!==b;){var f=Jo(Mo(),65535&(c.charCodeAt(a)|0),10);-1===f&&bp(c);e=n(e,10)+f|0;a=1+a|0}return e}ap.prototype.$classData=z({Pu:0},!1,\"java.lang.Long$\",{Pu:1,c:1,e:1,d:1});var dp=void 0;\nfunction ok(){dp||(dp=(new ap).a());return dp}function ep(){this.bh=this.Ki=this.Ti=this.Zi=this.Ri=this.Qi=this.Ui=null}ep.prototype=new A;ep.prototype.constructor=ep;ep.prototype.a=function(){fp=this;this.Ui=(new gp).a();this.Qi=(new hp).a();this.Ri=(new ip).a();this.Zi=(new jp).a();this.Ti=(new kp).a();this.Ki=(new lp).a();this.bh=(new mp).a();ka(D(np),[this.Ui,this.Qi,this.Ri,this.Zi,this.Ti,this.Ki,this.bh]);return this};\nfunction op(a,b,c,e){a=b.i;var f=e.i;if(a===f?(-2147483648^b.f)>(-2147483648^e.f):a>f)return(new x).g(-1,2147483647);a=e.f;e=e.i;e=0!==a?~e:-e|0;f=b.i;if(f===e?(-2147483648^b.f)<(-2147483648^(-a|0)):f>>16|0;var h=65535&a,k=a>>>16|0,m=n(g,h);h=n(f,h);var p=n(g,k);g=m+((h+p|0)<<16)|0;m=(m>>>16|0)+p|0;b=(((n(e,c.i)+n(b.i,a)|0)+n(f,k)|0)+(m>>>16|0)|0)+(((65535&m)+h|0)>>>16|0)|0;return(new x).g(g,b)}\nep.prototype.$classData=z({qv:0},!1,\"java.util.concurrent.TimeUnit$\",{qv:1,c:1,e:1,d:1});var fp=void 0;function Z(){fp||(fp=(new ep).a());return fp}function on(){this.s=!1}on.prototype=new A;on.prototype.constructor=on;on.prototype.n=function(){return\"\"+this.s};on.prototype.$e=function(a){this.s=a;return this};on.prototype.$classData=z({yv:0},!1,\"java.util.concurrent.atomic.AtomicBoolean\",{yv:1,c:1,e:1,d:1});function xl(){this.s=null}xl.prototype=new A;xl.prototype.constructor=xl;\nxl.prototype.n=function(){return\"\"+this.s};xl.prototype.j=function(a){this.s=a;return this};xl.prototype.$classData=z({zv:0},!1,\"java.util.concurrent.atomic.AtomicReference\",{zv:1,c:1,e:1,d:1});function Mj(){this.Ul=this.Dg=null}Mj.prototype=new A;Mj.prototype.constructor=Mj;Mj.prototype.n=function(){return this.Ul};Mj.prototype.$classData=z({Bv:0},!1,\"java.util.regex.Pattern\",{Bv:1,c:1,e:1,d:1});function pp(){this.Dn=this.En=null}pp.prototype=new A;pp.prototype.constructor=pp;\npp.prototype.a=function(){qp=this;this.En=new l.RegExp(\"^\\\\\\\\Q(.|\\\\n|\\\\r)\\\\\\\\E$\");this.Dn=new l.RegExp(\"^\\\\(\\\\?([idmsuxU]*)(?:-([idmsuxU]*))?\\\\)\");return this};function Kj(a){for(var b=\"\",c=0;c<(a.length|0);){var e=65535&(a.charCodeAt(c)|0);switch(e){case 92:case 46:case 40:case 41:case 91:case 93:case 123:case 125:case 124:case 63:case 42:case 43:case 94:case 36:e=\"\\\\\"+Zj(e);break;default:e=Zj(e)}b=\"\"+b+e;c=1+c|0}return b}\nfunction Lj(a,b){switch(b){case 105:return 2;case 100:return 1;case 109:return 8;case 115:return 32;case 117:return 64;case 120:return 4;case 85:return 256;default:throw(new Bb).h(\"bad in-pattern flag\");}}pp.prototype.$classData=z({Cv:0},!1,\"java.util.regex.Pattern$\",{Cv:1,c:1,e:1,d:1});var qp=void 0;function Jj(){qp||(qp=(new pp).a());return qp}function rp(){}rp.prototype=new A;rp.prototype.constructor=rp;rp.prototype.a=function(){return this};function sp(a,b){return null===b?R():(new Q).j(b)}\nrp.prototype.$classData=z({Lv:0},!1,\"scala.Option$\",{Lv:1,c:1,e:1,d:1});var tp=void 0;function up(){tp||(tp=(new rp).a());return tp}function vp(){this.Fl=this.Nh=null}vp.prototype=new Pg;vp.prototype.constructor=vp;vp.prototype.a=function(){Cp=this;vc();L();Dp||(Dp=(new Ep).a());Fp();ni||(ni=(new mi).a());ni||(ni=(new mi).a());Gp||(Gp=(new Hp).a());this.Nh=(new em).a();this.Fl=(new Ip).a();(new Jp).a();return this};function jg(a,b){if(!b)throw(new Bb).h(\"requirement failed\");}\nvp.prototype.$classData=z({Nv:0},!1,\"scala.Predef$\",{Nv:1,DH:1,c:1,BH:1});var Cp=void 0;function Cc(){Cp||(Cp=(new vp).a());return Cp}function Kp(){this.vm=this.mg=this.Mo=this.Ll=null}Kp.prototype=new A;Kp.prototype.constructor=Kp;\nKp.prototype.a=function(){Lp=this;L();var a=Z().bh;a=(new K).Q(a,\"d day\");var b=Z().Ki;b=(new K).Q(b,\"h hour\");var c=Z().Ti;c=(new K).Q(c,\"min minute\");var e=Z().Zi;e=(new K).Q(e,\"s sec second\");var f=Z().Ri;f=(new K).Q(f,\"ms milli millisecond\");var g=Z().Qi;g=(new K).Q(g,\"\\u00b5s micro microsecond\");var h=Z().Ui;a=[a,b,c,e,f,g,(new K).Q(h,\"ns nano nanosecond\")];b=-1+(a.length|0)|0;for(c=M();0<=b;)c=Vb(new N,a[b],c),b=-1+b|0;b=this.Ll=c;for(a=Mp(new Np,eo());!b.m();)c=b.w(),Op(a,c),b=b.cb();this.Mo=\nPp(new Qp,a.Lb,F(function(){return function(k){k=Rp(sl(),k);return Sp(k)}}(this)));b=this.Ll;a=function(k){return function(m){if(null!==m){var p=m.Ga();m=m.Qa();m=Tp(sl(),m);p=function(v,B){return function(P){return(new K).Q(P,B)}}(k,p);var q=L().G;if(q===L().G){if(m===M())return M();q=m.w();var t=q=Vb(new N,p(q),M());for(m=m.cb();m!==M();){var u=m.w();u=Vb(new N,p(u),M());t=t.uc=u;m=m.cb()}return q}for(q=Wb(m,q);!m.m();)t=m.w(),q.Ta(p(t)),m=m.cb();return q.Ca()}throw(new J).j(m);}}(this);if(L().G===\nL().G)if(b===M())a=M();else{c=b;e=(new Oi).$e(!1);f=(new ie).j(null);for(g=(new ie).j(null);c!==M();)h=c.w(),a(h).pa().K(F(function(k,m,p,q){return function(t){m.o?(t=Vb(new N,t,M()),q.o.uc=t,q.o=t):(p.o=Vb(new N,t,M()),q.o=p.o,m.o=!0)}}(b,e,f,g))),c=c.cb();a=e.o?f.o:M()}else{L();for(c=(new sn).a();!b.m();)e=b.w(),e=a(e).pa(),Up(c,e),b=b.cb();a=c.Sa()}a.Qb(Cc().Fl);this.mg=Vp();this.vm=(new Wp).a();(new Xp).a();(new Yp).a();return this};\nfunction Rp(a,b){a=b.trim();a=Ic(Fa(),a,\"\\\\s+\");b=-1+a.b.length|0;for(var c=M();0<=b;)c=Vb(new N,a.b[b],c),b=-1+b|0;return c}\nfunction Tp(a,b){var c=Rp(0,b);if(!(c instanceof N))throw(new J).j(c);b=c.th;c=c.uc;a=function(){return function(m){L();m=[m,m+\"s\"];for(var p=-1+(m.length|0)|0,q=M();0<=p;)q=Vb(new N,m[p],q),p=-1+p|0;return q}}(a);if(L().G===L().G)if(c===M())a=M();else{for(var e=c,f=(new Oi).$e(!1),g=(new ie).j(null),h=(new ie).j(null);e!==M();){var k=e.w();a(k).pa().K(F(function(m,p,q,t){return function(u){p.o?(u=Vb(new N,u,M()),t.o.uc=u,t.o=u):(q.o=Vb(new N,u,M()),t.o=q.o,p.o=!0)}}(c,f,g,h)));e=e.cb()}a=f.o?g.o:\nM()}else{L();for(e=(new sn).a();!c.m();)f=c.w(),f=a(f).pa(),Up(e,f),c=c.cb();a=e.Sa()}return Vb(new N,b,a)}Kp.prototype.$classData=z({Zv:0},!1,\"scala.concurrent.duration.Duration$\",{Zv:1,c:1,e:1,d:1});var Lp=void 0;function sl(){Lp||(Lp=(new Kp).a());return Lp}function Zp(){this.Cf=null;this.Sf=this.Fe=0;this.mh=null;this.q=!1}Zp.prototype=new A;Zp.prototype.constructor=Zp;Zp.prototype.a=function(){$p=this;this.Fe=-512;this.Sf=512;this.mh=Sf().$l;return this};\nfunction aq(a){a.q||(a.Cf=r(D(bq),[1+(a.Sf-a.Fe|0)|0]),a.q=!0);return a.Cf}function cq(a,b){var c=new dq,e=new Gn;a=\"\"+a;Gn.prototype.pu.call(e,Rj(Fa(),a),a.length|0);eq(e,b);return fq(c,e,b)}Zp.prototype.$classData=z({ew:0},!1,\"scala.math.BigDecimal$\",{ew:1,c:1,e:1,d:1});var $p=void 0;function gq(){$p||($p=(new Zp).a());return $p}function hq(){this.Sf=this.Fe=0;this.ro=this.Cf=null}hq.prototype=new A;hq.prototype.constructor=hq;\nhq.prototype.a=function(){iq=this;this.Fe=-1024;this.Sf=1024;this.Cf=r(D(jq),[1+(this.Sf-this.Fe|0)|0]);this.ro=Kf(lf(),(new x).g(-1,-1));return this};function kq(a,b){if(a.Fe<=b&&b<=a.Sf){var c=b-a.Fe|0,e=a.Cf.b[c];null===e&&(e=lf(),e=(new lq).Ag(Kf(e,(new x).g(b,b>>31))),a.Cf.b[c]=e);return e}a=lf();return(new lq).Ag(Kf(a,(new x).g(b,b>>31)))}\nfunction mq(a,b){var c=a.Fe,e=c>>31,f=b.i;(e===f?(-2147483648^c)<=(-2147483648^b.f):e>31,f=b.i,c=f===e?(-2147483648^b.f)<=(-2147483648^c):f>>0)):Gq(a,b,c,1E9,0,2)}function uf(a,b,c,e,f){if(0===(e|f))throw(new Mn).h(\"/ by zero\");if(c===b>>31){if(f===e>>31){if(-2147483648===b&&-1===e)return a.M=0,-2147483648;var g=b/e|0;a.M=g>>31;return g}return-2147483648===b&&-2147483648===e&&0===f?a.M=-1:a.M=0}if(g=0>c){var h=-b|0;c=0!==b?~c:-c|0}else h=b;if(b=0>f){var k=-e|0;e=0!==e?~f:-f|0}else k=e,e=f;h=Hq(a,h,c,k,e);if(g===b)return h;g=a.M;a.M=0!==h?~g:-g|0;return-h|0}\nfunction Rk(a,b,c){return 0>c?-(4294967296*+((0!==b?~c:-c|0)>>>0)+ +((-b|0)>>>0)):4294967296*c+ +(b>>>0)}function kl(a,b){if(-9223372036854775808>b)return a.M=-2147483648,0;if(0x7fffffffffffffff<=b)return a.M=2147483647,-1;var c=b|0,e=b/4294967296|0;a.M=0>b&&0!==c?-1+e|0:e;return c}\nfunction Hq(a,b,c,e,f){return 0===(-2097152&c)?0===(-2097152&f)?(c=(4294967296*c+ +(b>>>0))/(4294967296*f+ +(e>>>0)),a.M=c/4294967296|0,c|0):a.M=0:0===f&&0===(e&(-1+e|0))?(e=31-da(e)|0,a.M=c>>>e|0,b>>>e|0|c<<1<<(31-e|0)):0===e&&0===(f&(-1+f|0))?(b=31-da(f)|0,a.M=0,c>>>b|0):Gq(a,b,c,e,f,0)|0}function wf(a,b,c,e,f){if(0===(e|f))throw(new Mn).h(\"/ by zero\");return 0===c?0===f?(a.M=0,+(b>>>0)/+(e>>>0)|0):a.M=0:Hq(a,b,c,e,f)}\nfunction mk(a,b,c){return c===b>>31?\"\"+b:0>c?\"-\"+Fq(a,-b|0,0!==b?~c:-c|0):Fq(a,b,c)}function Iq(a,b,c,e,f){return c===f?b===e?0:(-2147483648^b)<(-2147483648^e)?-1:1:c>>1|0)>>>(31-k|0)|0|f<=(-2147483648^v):(-2147483648^u)>=(-2147483648^B))t=q,u=p,q=k-m|0,t=(-2147483648^q)>(-2147483648^k)?-1+(t-u|0)|0:t-u|0,k=q,q=t,32>h?c|=1<>>1|0;m=m>>>1|0|p<<31;p=t}h=q;if(h===f?(-2147483648^k)>=(-2147483648^e):(-2147483648^h)>=(-2147483648^\nf))h=4294967296*q+ +(k>>>0),e=4294967296*f+ +(e>>>0),1!==g&&(p=h/e,f=p/4294967296|0,m=c,c=p=m+(p|0)|0,b=(-2147483648^p)<(-2147483648^m)?1+(b+f|0)|0:b+f|0),0!==g&&(e=h%e,k=e|0,q=e/4294967296|0);if(0===g)return a.M=b,c;if(1===g)return a.M=q,k;a=\"\"+k;return\"\"+(4294967296*b+ +(c>>>0))+\"000000000\".substring(a.length|0)+a}\nfunction gg(a,b,c,e,f){if(0===(e|f))throw(new Mn).h(\"/ by zero\");if(c===b>>31){if(f===e>>31){if(-1!==e){var g=b%e|0;a.M=g>>31;return g}return a.M=0}if(-2147483648===b&&-2147483648===e&&0===f)return a.M=0;a.M=c;return b}if(g=0>c){var h=-b|0;c=0!==b?~c:-c|0}else h=b;0>f?(b=-e|0,e=0!==e?~f:-f|0):(b=e,e=f);f=c;0===(-2097152&f)?0===(-2097152&e)?(h=(4294967296*f+ +(h>>>0))%(4294967296*e+ +(b>>>0)),a.M=h/4294967296|0,h|=0):a.M=f:0===e&&0===(b&(-1+b|0))?(a.M=0,h&=-1+b|0):0===b&&0===(e&(-1+e|0))?a.M=f&(-1+\ne|0):h=Gq(a,h,f,b,e,1)|0;return g?(g=a.M,a.M=0!==h?~g:-g|0,-h|0):h}Dq.prototype.$classData=z({zz:0},!1,\"scala.scalajs.runtime.RuntimeLong$\",{zz:1,c:1,e:1,d:1});var Eq=void 0;function y(){Eq||(Eq=(new Dq).a());return Eq}var Jq=z({Iz:0},!1,\"scala.runtime.Nothing$\",{Iz:1,hb:1,c:1,d:1});function dn(){}dn.prototype=new A;dn.prototype.constructor=dn;function Lc(a){if(null!==a){var b=a.Uc|0,c=a.xb;if(null!==c){var e=c.Uc|0;c=c.xb;if(Ac()===c)return(new Kq).g(b,e)}}throw(new J).j(a);}\ndn.prototype.$classData=z({cp:0},!1,\"atcoder.ABC142F$anon$lazy$macro$9$1$anon$macro$5$1\",{cp:1,c:1,tH:1,e:1,d:1});function Ee(){}Ee.prototype=new A;Ee.prototype.constructor=Ee;Ee.prototype.a=function(){return this};Ee.prototype.$classData=z({Dp:0},!1,\"cats.arrow.FunctionK$$anon$4\",{Dp:1,c:1,HA:1,e:1,d:1});function Lq(){}Lq.prototype=new kn;Lq.prototype.constructor=Lq;function Mq(){}Mq.prototype=Lq.prototype;z({Tp:0},!1,\"cats.effect.IOInstances$$anon$7\",{Tp:1,c:1,wf:1,e:1,d:1});\nfunction Nq(){this.ma=!1;this.wn=null;this.ue=!1}Nq.prototype=new mn;Nq.prototype.constructor=Nq;function Oq(){}Oq.prototype=Nq.prototype;Nq.prototype.a=function(){var a=new Pq;if(null===this)throw T(S(),null);a.k=this;this.wn=a;this.ue=!0;return this};function mc(){var a=Mb();if(!a.ue)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/IO.scala: 765\");return a.wn}function Bl(){this.Ph=null;this.ma=this.Wc=0;this.k=null}\nBl.prototype=new A;Bl.prototype.constructor=Bl;d=Bl.prototype;d.pa=function(){return this};d.u=function(){0===this.Wc&&(this.Ph=this.Ph.b[0],this.Wc=this.k.cj);var a=this.Ph.b[this.Wc];this.Wc=-1+this.Wc|0;return a};d.Yb=function(a,b){Hi(this,a,b)};d.ic=function(){return this};d.m=function(){return!this.r()};d.Sa=function(){var a=L().G;return Ki(this,a)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};\nd.x=function(){return Mi(this)};d.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){return 0=this.R||this.R>Wq(this)?wg():Xq(this).Yc()};d.a=function(){this.gg=null;this.Ob=this.xc=0;this.zb=wg();this.nf=this.R=0;return this};\nfunction Yq(a,b){var c=a.R,e=c>>31,f=-c|0;c=0!==c?~e:-e|0;var g=Wq(a);e=g>>31;g=f+g|0;f=(-2147483648^g)<(-2147483648^f)?1+(c+e|0)|0:c+e|0;if(0===f?-2147483629<(-2147483648^g):0this.Ob){a=a.zb;var b=a.i,c=this.zb;return a.f===c.f&&b===c.i}return Qk(H(),this.mf,a.mf)}return!1};\nfunction $q(a){if(0===a.Ob){a=a.zb;var b=a.i;return!(-1===a.f&&-1===b)}return!1}\nfunction ar(a){if($q(a))return a;var b=-1+Bf().pf.b.length|0,c=1,e=br(a),f=a=a.R;a>>=31;a:for(;;){if(cr(e,0))c=f,b=e,c=(new x).g(c,a);else{var g=dr(e,Bf().pf.b[c]);if(0===g.Kj.N){e=g.Jj;var h=c;g=h>>31;var k=a;a=f-h|0;f=(-2147483648^a)>(-2147483648^f)?-1+(k-g|0)|0:k-g|0;c=c=e))if(64>a.Ob){c=Y().Mh.b[e];var f=c.f,g=c.i,h=a.R,k=h>>31,m=e>>31;c=h-e|0;h=(-2147483648^c)>(-2147483648^h)?-1+(k-m|0)|0:k-m|0;e=a.zb;m=e.f;var p=e.i;k=y();e=uf(k,m,p,f,g);k=k.M;var q=y();m=gg(q,m,p,f,g);p=q.M;if(0!==m||0!==p){Y();if(0>p){q=-m|0;var t=0!==m?~p:-p|0}else q=m,t=p;q=(new x).g(q<<1,q>>>31|0|t<<1);f=(new x).g(f,g);g=q.i;t=f.i;(g===t?(-2147483648^q.f)>(-2147483648^f.f):g>t)?f=1:(g=q.i,t=f.i,f=(g===t?(-2147483648^q.f)<(-2147483648^\nf.f):gp?-1:0===p&&0===m?0:1,5+f|0);f=Ln(Y(),1&e,f,b.Ig);g=f>>31;f=e+f|0;e=(-2147483648^f)<(-2147483648^e)?1+(k+g|0)|0:k+g|0;0>e?(k=-f|0,g=0!==f?~e:-e|0):(k=f,g=e);k=Rk(y(),k,g);(void 0!==l.Math.log10?+l.Math.log10(k):+l.Math.log(k)/2.302585092994046)>=b.Vf?(c=-1+c|0,h=-1!==c?h:-1+h|0,k=y(),e=uf(k,f,e,10,0),k=k.M,c=(new x).g(c,h),e=(new x).g(e,k)):(c=(new x).g(c,h),e=(new x).g(f,e))}else c=(new x).g(c,h),e=(new x).g(e,k);h=c;c=h.f;h=h.i;k=e;e=k.f;k=k.i;a.R=Nn(Y(),(new x).g(c,h));a.nf=\nb.Vf;a.zb=(new x).g(e,k);a.Ob=Jn(Y(),(new x).g(e,k));a.mf=null}else f=eg(Bf(),(new x).g(e,e>>31)),h=br(a),h=af(dr(h,f)),k=a.R,g=k>>31,m=e>>31,e=k-e|0,k=(-2147483648^e)>(-2147483648^k)?-1+(g-m|0)|0:g-m|0,0!==h.b[1].N?(g=fr(gr(hr(h.b[1])),f),f=cr(h.b[0],0)?1:0,g=n(h.b[1].N,5+g|0),b=Ln(Y(),f,g,b.Ig),0!==b&&(b=Kf(lf(),(new x).g(b,b>>31)),f=h.b[0],h.b[0]=If(Nf(),f,b)),er((new Gn).Ag(h.b[0]))>c?(h.b[0]=ir(h.b[0],lf().lg),b=e=-1+e|0,e=-1!==e?k:-1+k|0):(b=e,e=k)):(b=e,e=k),a.R=Nn(Y(),(new x).g(b,e)),a.nf=\nc,jr(a,h.b[0])}d.Zk=function(a,b){Gn.prototype.a.call(this);if(null===a)throw(new Oc).h(\"unscaledVal \\x3d\\x3d null\");this.R=b;jr(this,a);return this};\nd.n=function(){if(null!==this.gg)return this.gg;if(32>this.Ob)return this.gg=tf(xf(),this.zb,this.R);var a=br(this);a=vf(xf(),a);if(0===this.R)return a;var b=0>br(this).N?2:1,c=a.length|0,e=this.R,f=e>>31,g=-e|0;f=0!==e?~f:-f|0;var h=c>>31;e=g+c|0;f=(-2147483648^e)<(-2147483648^g)?1+(f+h|0)|0:f+h|0;h=b>>31;g=e-b|0;e=(-2147483648^g)>(-2147483648^e)?-1+(f-h|0)|0:f-h|0;0a.Ob){if(0>a.zb.i)return-1;var b=a.zb;a=b.f;b=b.i;return(0===b?0!==a:0>31);this.R=b;Y();this.Ob=32-da(0>a?~a:a)|0;return this};\nfunction Xq(a){if(0===a.R||$q(a))return br(a);if(0>a.R){var b=br(a),c=Bf();a=a.R;var e=a>>31;return Zf(b,eg(c,(new x).g(-a|0,0!==a?~e:-e|0)))}b=br(a);c=Bf();a=a.R;return ir(b,eg(c,(new x).g(a,a>>31)))}\nfunction lr(a,b){var c=a.R,e=c>>31,f=b>>31;b=c-b|0;c=(-2147483648^b)>(-2147483648^c)?-1+(e-f|0)|0:e-f|0;return 64>a.Ob?(e=a.zb,f=e.i,0===e.f&&0===f?(a=Y(),b=(new x).g(b,c),c=b.f,a=b.f===c&&b.i===c>>31?En(a,wg(),b.f):0<=b.i?(new Gn).g(0,2147483647):(new Gn).g(0,-2147483648)):a=En(Y(),a.zb,Nn(Y(),(new x).g(b,c))),a):(new Gn).Zk(br(a),Nn(Y(),(new x).g(b,c)))}\nfunction er(a){if(0===a.nf){if(0===a.Ob)var b=1;else if(64>a.Ob){var c=a.zb;if(0===c.f&&-2147483648===c.i)b=19;else{Jg();b=Y().Mh;if(0>c.i){var e=c.f;c=c.i;e=(new x).g(-e|0,0!==e?~c:-c|0)}else e=c;b:{c=0;var f=b.b.length;for(;;){if(c===f){b=-1-c|0;break b}var g=(c+f|0)>>>1|0,h=b.b[g],k=Ma(h),m=k.f;k=k.i;var p=e.i;if(p===k?(-2147483648^e.f)<(-2147483648^m):pb?-1-b|0:1+b|0}}else b=1+Ja(.3010299956639812*(-1+a.Ob|0))|0,e=br(a),c=Bf(),b=0!==ir(e,eg(c,\n(new x).g(b,b>>31))).N?1+b|0:b;a.nf=b}return a.nf}function Zq(a){if(0===a.R||$q(a))return br(a);if(0>a.R){var b=br(a),c=Bf();a=a.R;var e=a>>31;return Zf(b,eg(c,(new x).g(-a|0,0!==a?~e:-e|0)))}if(a.R>Wq(a)||a.R>mr(br(a)))throw(new Mn).h(\"Rounding necessary\");b=br(a);c=Bf();a=a.R;a=eg(c,(new x).g(a,a>>31));a=af(dr(b,a));if(0!==a.b[1].N)throw(new Mn).h(\"Rounding necessary\");return a.b[0]}function jr(a,b){a.mf=b;a.Ob=nf(qf(),b);64>a.Ob&&(a.zb=b.Yc())}\nfunction Wq(a){return 0>31,e=y(),f=kl(e,this.R/.3010299956639812);e=e.M;f=b-f|0;b=(-2147483648^f)>(-2147483648^b)?-1+(c-e|0)|0:c-e|0;if((-1===b?2147482574>(-2147483648^f):-1>b)||0===a)return 0*a;if(0===b?-2147482623<(-2147483648^f):0=this.R)f=Bf(),e=-this.R|0,e=Zf(c,eg(f,(new x).g(e,e>>31)));else{e=Bf();var g=this.R;e=eg(e,(new x).g(g,g>>31));f=100-f|0;0>31));e=If(Nf(),f,c)}f=mr(e);c=-54+nf(qf(),e)|0;if(0(-2147483648^m)?1+h|0:h}}else e=e.Yc(),g=e.f,k=e.i,h=-c|0,e=0===(32&h)?g<>>1|0)>>>(31-h|0)|0|k<(-2147483648^m)?1+h|0:h);0===(4194304&h)?(e=e>>>1|0|h<<31,h>>=1,b=b+c|0):(e=e>>>2|0|h<<30,h>>=2,b=b+(1+c|0)|0);if(2046<\nb)return Infinity*a;if(-53>b)return 0*a;if(0>=b){e=g>>>1|0|k<<31;h=k>>1;k=63+b|0;g=e&(0===(32&k)?-1>>>k|0|-2<<(31-k|0):-1>>>k|0);k=h&(0===(32&k)?-1>>>k|0:0);b=-b|0;e=0===(32&b)?e>>>b|0|h<<1<<(31-b|0):h>>b;h=0===(32&b)?h>>b:h>>31;if(3===(3&e)||(1!==(1&e)||0===g&&0===k?0:f>>1|0|f<<31;h=f>>1}f=e;b=-2147483648&a>>31|b<<20|1048575&h;a=Ha();b=(new x).g(f,b);a.$f?(a.uh[a.Vk]=b.i,a.uh[a.hl]=b.f,a=+a.Sk[0]):a=a.Dv(b);return a};\nd.Xk=function(a,b){Gn.prototype.a.call(this);this.zb=a;this.R=b;this.Ob=Jn(Y(),a);return this};d.z=function(){if(0===this.xc)if(64>this.Ob){this.xc=this.zb.f;var a=this.zb.i;this.xc=n(33,this.xc)+a|0;this.xc=n(17,this.xc)+this.R|0}else this.xc=n(17,this.mf.z())+this.R|0;return this.xc};d.Xc=function(){return-32>=this.R||this.R>Wq(this)?0:Xq(this).Xc()};d.Ag=function(a){Gn.prototype.Zk.call(this,a,0);return this};\nd.Kf=function(){var a=this.Ob,b=a>>31,c=y(),e=kl(c,this.R/.3010299956639812);c=c.M;e=a-e|0;a=(-2147483648^e)>(-2147483648^a)?-1+(b-c|0)|0:b-c|0;b=ca(kr(this));return(-1===a?2147483499>(-2147483648^e):-1>a)||0===b?ca(0*b):(0===a?-2147483519<(-2147483648^e):0=a.b.length||0>=b||0>c)throw(new Oo).h(\"Bad offset/length: offset\\x3d0 len\\x3d\"+b+\" in.length\\x3d\"+a.b.length);var e=0;if(0<=c&&43===a.b[0]){e=1+e|0;if(e>31,fy=Wc(Xc(),BB,10),gy=fy>>31,Zs=Ys-fy|0,hy=this.R=Zs;if(Zs!==hy||((-2147483648^Zs)>(-2147483648^Ys)?-1+(ey-gy|0)|0:ey-gy|0)!==hy>>31)throw(new Oo).h(\"Scale out of range\");}if(19>xB){var um=ok();\"\"===tb&&bp(tb);var $s=0,iy=\n!1;switch(65535&(tb.charCodeAt(0)|0)){case 43:$s=1;break;case 45:$s=1,iy=!0}var jy=$s,Rg=tb.length|0;if(jy>=Rg){bp(tb);var vm=void 0}else{if(!um.q&&!um.q){for(var at=[],Bd=0;2>Bd;)at.push(null),Bd=1+Bd|0;for(;36>=Bd;){for(var CB=2147483647/Bd|0,wp=Bd,bt=1;wp<=CB;)wp=n(wp,Bd),bt=1+bt|0;var ct=wp,ky=ct>>31,ly=y(),DB=wf(ly,-1,-1,ct,ky),EB=ly.M,xp=new vg,FB=(new x).g(ct,ky),GB=(new x).g(DB,EB);xp.Cm=bt;xp.ho=FB;xp.Zn=GB;at.push(xp);Bd=1+Bd|0}um.tm=at;um.q=!0}for(var dt=um.tm[10],et=dt.Cm,Me=jy;;){var ft;\nif(ft=Megt?48===gt:0<=Dg(Jg(),Ko(HB),gt)}if(ft)Me=1+Me|0;else break}(Rg-Me|0)>n(3,et)&&bp(tb);var yp=Me+(1+((-1+(Rg-Me|0)|0)%et|0)|0)|0,zp=cp(Me,yp,tb);if(yp===Rg)vm=(new x).g(zp,0);else{var my=dt.ho,wm=my.f,ny=my.i,ht=yp+et|0,oy=65535&zp,py=zp>>>16|0,qy=65535&wm,ry=wm>>>16|0,sy=n(oy,qy),ty=n(py,qy),uy=n(oy,ry),vy=sy+((ty+uy|0)<<16)|0,wy=(sy>>>16|0)+uy|0,xy=((n(zp,ny)+n(py,ry)|0)+(wy>>>16|0)|0)+(((65535&wy)+ty|0)>>>16|0)|0,IB=cp(yp,ht,tb),bk=\nvy+IB|0,Ap=(-2147483648^bk)<(-2147483648^vy)?1+xy|0:xy;if(ht===Rg)vm=(new x).g(bk,Ap);else{var yy=dt.Zn,JB=yy.f,zy=yy.i,Ay=cp(ht,Rg,tb);(Ap===zy?(-2147483648^bk)>(-2147483648^JB):Ap>zy)&&bp(tb);var By=65535&bk,Cy=bk>>>16|0,Dy=65535&wm,Ey=wm>>>16|0,Fy=n(By,Dy),Gy=n(Cy,Dy),Hy=n(By,Ey),Iy=Fy+((Gy+Hy|0)<<16)|0,Jy=(Fy>>>16|0)+Hy|0,Ky=(((n(bk,ny)+n(Ap,wm)|0)+n(Cy,Ey)|0)+(Jy>>>16|0)|0)+(((65535&Jy)+Gy|0)>>>16|0)|0,it=Iy+Ay|0,Ly=(-2147483648^it)<(-2147483648^Iy)?1+Ky|0:Ky;-2147483648===(-2147483648^Ly)&&\n(-2147483648^it)<(-2147483648^Ay)&&bp(tb);vm=(new x).g(it,Ly)}}}var jt=vm.f,Bp=vm.i;if(iy){var My=-jt|0,kt=0!==jt?~Bp:-Bp|0;(0===kt?0!==My:0Bp&&bp(tb),Ny=(new x).g(jt,Bp);this.zb=Ny;this.Ob=Jn(Y(),this.zb)}else jr(this,(new Jf).h(tb))};function br(a){null===a.mf&&(a.mf=Kf(lf(),a.zb));return a.mf}\nfunction nr(a,b){var c=kr(a),e=kr(b);if(c===e){if(a.R===b.R&&64>a.Ob&&64>b.Ob){c=a.zb;e=c.f;c=c.i;var f=b.zb,g=f.i;if(c===g?(-2147483648^e)<(-2147483648^f.f):c(-2147483648^b.f):e>c)?1:0}f=a.R;g=f>>31;e=b.R;var h=e>>31;e=f-e|0;f=(-2147483648^e)>(-2147483648^f)?-1+(g-h|0)|0:g-h|0;g=Wq(a)-Wq(b)|0;h=g>>31;var k=1+e|0,m=0===k?1+f|0:f;if(h===m?(-2147483648^g)>(-2147483648^k):h>m)return c;h=g>>31;k=-1+e|0;m=-1!==k?f:-1+f|0;if(h===m?\n(-2147483648^g)<(-2147483648^k):hf)c=Bf(),a=Zf(a,eg(c,(new x).g(-e|0,0!==e?~f:-f|0)));else if(0===f?0!==e:0b)throw(new Mn).h(\"Negative exponent\");if(0===b)return lf().xf;if(1===b||a.t(lf().xf)||a.t(lf().be))return a;if(cr(a,0)){a:{Bf();var c=lf().xf,e=a;for(;;)if(1>=1,c=a;else{a=Zf(c,e);break a}}return a}for(c=1;!cr(a,c);)c=1+c|0;e=lf();var f=n(c,b);if(f>5;f&=31;var g=r(D(E),[1+e|0]);g.b[e]=1<>31,f=65535&c,g=c>>>16|0,h=65535&a,k=a>>>16|0,m=n(f,h);h=n(g,h);var p=n(f,k);f=m+((h+p|0)<<16)|0;m=(m>>>16|0)+p|0;b=(((n(c,b)+n(e,a)|0)+n(g,k)|0)+(m>>>16|0)|0)+(((65535&m)+h|0)>>>16|0)|0;return(new x).g(f,b)};d.a=function(){this.Bj=-2;this.xc=0;return this};\nfunction ir(a,b){if(0===b.N)throw(new Mn).h(\"BigInteger divide by zero\");var c=b.N;if(1===b.ga&&1===b.H.b[0])return 0g?1:-1:Gf(Nf(),a.H,b.H,f);if(0===h)return e===c?lf().xf:lf().Si;if(-1===h)return lf().be;h=1+(f-g|0)|0;var k=r(D(E),[h]);c=e===c?1:-1;1===g?Cf(Af(),k,a.H,f,b.H.b[0]):zf(Af(),k,h,a.H,f,b.H,g);c=hf(c,\nh,k);jf(c);return c}d.t=function(a){if(a instanceof Jf){var b;if(b=this.N===a.N&&this.ga===a.ga)a:{for(b=0;b!==this.ga;){if(this.H.b[b]!==a.H.b[b]){b=!1;break a}b=1+b|0}b=!0}a=b}else a=!1;return a};d.n=function(){return vf(xf(),this)};d.g=function(a,b){Jf.prototype.a.call(this);this.N=a;this.ga=1;this.H=ka(D(E),[b]);return this};function of(a){if(-2===a.Bj){if(0===a.N)var b=-1;else for(b=0;0===a.H.b[b];)b=1+b|0;a.Bj=b}return a.Bj}function hr(a){return 0>a.N?hf(1,a.ga,a.H):a}\nfunction dr(a,b){var c=b.N;if(0===c)throw(new Mn).h(\"BigInteger divide by zero\");var e=b.ga;b=b.H;if(1===e){Af();b=b.b[0];var f=a.H,g=a.ga;e=a.N;1===g?(f=f.b[0],a=+(f>>>0)/+(b>>>0)|0,g=0,b=+(f>>>0)%+(b>>>0)|0,f=0,e!==c&&(c=a,a=-c|0,g=0!==c?~g:-g|0),0>e&&(c=b,e=f,b=-c|0,f=0!==c?~e:-e|0),c=cf(new $e,Kf(lf(),(new x).g(a,g)),Kf(lf(),(new x).g(b,f)))):(c=e===c?1:-1,a=r(D(E),[g]),b=Cf(0,a,f,g,b),b=ka(D(E),[b]),c=hf(c,g,a),e=hf(e,1,b),jf(c),jf(e),c=cf(new $e,c,e));return c}g=a.H;f=a.ga;if(0>(f!==e?f>e?1:\n-1:Gf(Nf(),g,b,f)))return cf(new $e,lf().be,a);a=a.N;var h=1+(f-e|0)|0;c=a===c?1:-1;var k=r(D(E),[h]);b=zf(Af(),k,h,g,f,b,e);c=hf(c,h,k);e=hf(a,e,b);jf(c);jf(e);return cf(new $e,c,e)}function jf(a){a:for(;;){if(0>5;if(0===b)return 0!==(1&a.H.b[0]);if(0>b)throw(new Mn).h(\"Negative bit address\");if(c>=a.ga)return 0>a.N;if(0>a.N&&ca.N&&(e=of(a)===c?-e|0:~e);return 0!==(e&1<<(31&b))}function mr(a){if(0===a.N)return-1;var b=of(a);a=a.H.b[b];return(b<<5)+(0===a?32:31-da(a&(-a|0))|0)|0}function Mf(a){return 0===a.N?a:hf(-a.N|0,a.ga,a.H)}function hf(a,b,c){var e=new Jf;Jf.prototype.a.call(e);e.N=a;e.ga=b;e.H=c;return e}\nfunction gr(a){if(0!==a.N){qf();var b=a.ga,c=1+b|0,e=r(D(E),[c]);ef(0,e,a.H,b);a=hf(a.N,c,e);jf(a)}return a}\nd.ec=function(a,b){Jf.prototype.a.call(this);lf();if(null===a)throw(new Oc).a();if(2>b||36b.N?1:a.Nb.ga?a.N:a.gaa)throw(new Gr).a();return this};d.na=function(){return this.ub.length|0};d.$classData=z({Wu:0},!1,\"java.lang.StringBuilder\",{Wu:1,c:1,Gn:1,zu:1,d:1});function Vj(){this.eg=this.Te=null;this.ji=!1}Vj.prototype=new A;Vj.prototype.constructor=Vj;d=Vj.prototype;\nd.a=function(){Vj.prototype.uu.call(this);return this};function Hr(a,b,c){null===a.Te?a.eg=\"\"+a.eg+b+c:Ir(a,[b,c])}function fk(a,b,c){a=uk(a&b);b=new Jr;b.Jf=a;b.Bf=c;W.prototype.Ua.call(b,null,null);if(null===a)throw(new Oc).a();throw b;}\nfunction rk(a,b,c){b=a.toExponential(b);a=0===a&&0>1/a?\"-\"+b:b;b=a.length|0;a=101!==(65535&(a.charCodeAt(-3+b|0)|0))?a:a.substring(0,-1+b|0)+\"0\"+a.substring(-1+b|0);if(!c||0<=(a.indexOf(\".\")|0))return a;c=a.indexOf(\"e\")|0;return a.substring(0,c)+\".\"+a.substring(c)}function Kr(a,b){for(var c=\"\",e=0;e!==b;)c=\"\"+c+a,e=1+e|0;return c}function vk(a,b,c,e){var f=e.length|0;f>=c?Xj(a,e):0!==(1&b)?Hr(a,e,Kr(\" \",c-f|0)):Hr(a,Kr(\" \",c-f|0),e)}function pk(a,b){return 0!==(256&a)?b.toUpperCase():b}\nd.n=function(){if(this.ji)throw(new Wj).a();return null===this.Te?this.eg:this.Te.n()};function uk(a){return(0!==(1&a)?\"-\":\"\")+(0!==(2&a)?\"#\":\"\")+(0!==(4&a)?\"+\":\"\")+(0!==(8&a)?\" \":\"\")+(0!==(16&a)?\"0\":\"\")+(0!==(32&a)?\",\":\"\")+(0!==(64&a)?\"(\":\"\")+(0!==(128&a)?\"\\x3c\":\"\")}d.uu=function(){this.Te=null;this.eg=\"\";this.ji=!1};function ck(a,b){if(void 0===a)return b;a=+l.parseInt(a,10);return 2147483647>=a?Ja(a):-1}function Lr(a,b,c,e){null===a.Te?a.eg=a.eg+(\"\"+b+c)+e:Ir(a,[b,c,e])}\nfunction nk(a,b,c,e,f){var g=(e.length|0)+(f.length|0)|0;g>=c?Hr(a,e,f):0!==(16&b)?Lr(a,e,Kr(\"0\",c-g|0),f):0!==(1&b)?Lr(a,e,f,Kr(\" \",c-g|0)):Lr(a,Kr(\" \",c-g|0),e,f)}function qk(a,b,c,e){vk(a,b,c,pk(b,e!==e?\"NaN\":01/a?\"-\"+b:b;return c&&0>(a.indexOf(\".\")|0)?a+\".\":a}function gk(a,b,c,e,f){e=0>e?f:f.substring(0,e);vk(a,b,c,pk(b,e))}function kk(a){throw(new tk).h(uk(a));}function Xj(a,b){null===a.Te?a.eg=\"\"+a.eg+b:Ir(a,[b])}\nfunction lk(a,b,c,e){if((e.length|0)>=c&&0===(108&b))Xj(a,pk(b,e));else if(0===(124&b))gk(a,b,c,-1,e);else{if(45!==(65535&(e.charCodeAt(0)|0)))var f=0!==(4&b)?\"+\":0!==(8&b)?\" \":\"\";else 0!==(64&b)?(e=e.substring(1)+\")\",f=\"(\"):(e=e.substring(1),f=\"-\");if(0!==(32&b)){for(var g=e.length|0,h=0;;){if(h!==g){var k=65535&(e.charCodeAt(h)|0);k=48<=k&&57>=k}else k=!1;if(k)h=1+h|0;else break}h=-3+h|0;if(!(0>=h)){for(g=e.substring(h);3>24};\nd.t=function(a){return a instanceof x?this.f===a.f&&this.i===a.i:!1};d.Mf=function(a,b,c){x.prototype.g.call(this,a|b<<22,b>>10|c<<12);return this};d.n=function(){return mk(y(),this.f,this.i)};d.g=function(a,b){this.f=a;this.i=b;return this};d.ua=function(a){x.prototype.g.call(this,a,a>>31);return this};d.zi=function(){return this.f<<16>>16};d.ee=function(){return Rk(y(),this.f,this.i)};d.z=function(){return this.f^this.i};d.Xc=function(){return this.f};d.Kf=function(){return ca(Rk(y(),this.f,this.i))};\nd.$classData=z({yz:0},!1,\"scala.scalajs.runtime.RuntimeLong\",{yz:1,Be:1,c:1,d:1,bb:1});function bs(){this.s=null}bs.prototype=new A;bs.prototype.constructor=bs;d=bs.prototype;d.Ba=function(){return\"Answer\"};d.za=function(){return 1};d.t=function(a){if(this===a)return!0;if(a instanceof bs){var b=this.s;a=a.s;return null===b?null===a:b.t(a)}return!1};d.U=function(a){switch(a){case 0:return this.s;default:throw(new X).h(\"\"+a);}};d.n=function(){return el(this)};d.oa=function(a){return a instanceof bs};\nd.z=function(){return ui(this)};function kc(a){var b=new bs;b.s=a;return b}d.$classData=z({Zo:0},!1,\"atcoder.ABC142F$Answer\",{Zo:1,c:1,Ia:1,p:1,e:1,d:1});function Zm(){this.Cc=null}Zm.prototype=new A;Zm.prototype.constructor=Zm;Zm.prototype.Jo=function(a){return(0,this.Cc)(a)};Zm.prototype.j=function(a){this.Cc=a;return this};Zm.prototype.$classData=z({ap:0},!1,\"atcoder.ABC142F$Answer$$$Lambda$1\",{ap:1,c:1,wp:1,Ap:1,e:1,d:1});z({vp:0},!1,\"cats.Parallel$$anon$2\",{vp:1,c:1,mA:1,iA:1,e:1,d:1});\nfunction Tq(){}Tq.prototype=new A;Tq.prototype.constructor=Tq;Tq.prototype.a=function(){return this};Tq.prototype.Jo=function(a){return ma(a)};Tq.prototype.$classData=z({yp:0},!1,\"cats.Show$$anon$3\",{yp:1,c:1,wp:1,Ap:1,e:1,d:1});function gn(){}gn.prototype=new A;gn.prototype.constructor=gn;gn.prototype.a=function(){return this};gn.prototype.$classData=z({zp:0},!1,\"cats.Show$$anon$4\",{zp:1,c:1,hg:1,dc:1,e:1,d:1});function dd(){this.s=null}dd.prototype=new A;dd.prototype.constructor=dd;\nfunction cs(a,b,c){return(new dd).j(c.Rk(a.s,F(function(e,f,g){return function(h){if(h instanceof Fc)return f.xh(h);if(h instanceof wc)return g.l(h.E).s;throw(new J).j(h);}}(a,c,b))))}d=dd.prototype;d.Ba=function(){return\"EitherT\"};function ds(a,b,c,e){return(new dd).j(e.ni(a.s,F(function(f,g,h){return function(k){Ye||(Ye=(new Xe).a());if(k instanceof Fc)k=k.E,vc(),k=g.l(k),k=(new Fc).j(k);else if(k instanceof wc)k=k.E,vc(),k=h.l(k),k=(new wc).j(k);else throw(new J).j(k);return k}}(a,b,c))))}\nd.za=function(){return 1};function es(a,b){var c=mc();return ds(a,b,F(function(){return function(e){return e}}(a)),c)}d.t=function(a){return this===a?!0:a instanceof dd?G(H(),this.s,a.s):!1};d.U=function(a){switch(a){case 0:return this.s;default:throw(new X).h(\"\"+a);}};d.n=function(){return el(this)};d.j=function(a){this.s=a;return this};d.oa=function(a){return a instanceof dd};function fs(a,b,c){return ds(a,F(function(){return function(e){return e}}(a)),b,c)}d.z=function(){return ui(this)};\nfunction gs(a,b){var c=mc();return cs(a,F(function(e,f,g){return function(h){return nc().Oh(f.l(h),g)}}(a,b,c)),c)}d.$classData=z({Ep:0},!1,\"cats.data.EitherT\",{Ep:1,c:1,Ia:1,p:1,e:1,d:1});function hs(){Nq.call(this)}hs.prototype=new Oq;hs.prototype.constructor=hs;function is(){}is.prototype=hs.prototype;hs.prototype.a=function(){Nq.prototype.a.call(this);if(null===this)throw T(S(),null);return this};z({Aq:0},!1,\"cats.instances.Function1Instances$$anon$9\",{Aq:1,c:1,eh:1,wf:1,e:1,d:1});\nz({Cq:0},!1,\"cats.instances.HashInstances$$anon$1\",{Cq:1,c:1,hg:1,dc:1,e:1,d:1});z({Iq:0},!1,\"cats.instances.ListInstancesBinCompat0$$anon$3\",{Iq:1,c:1,ok:1,nk:1,e:1,d:1});z({Nq:0},!1,\"cats.instances.OptionInstancesBinCompat0$$anon$3\",{Nq:1,c:1,ok:1,nk:1,e:1,d:1});z({Zq:0},!1,\"cats.instances.StreamInstancesBinCompat0$$anon$4\",{Zq:1,c:1,ok:1,nk:1,e:1,d:1});z({ar:0},!1,\"cats.instances.Tuple2InstancesBinCompat0$$anon$2\",{ar:1,c:1,Ne:1,dc:1,e:1,d:1});\nz({er:0},!1,\"cats.instances.VectorInstancesBinCompat0$$anon$3\",{er:1,c:1,ok:1,nk:1,e:1,d:1});function js(){}js.prototype=new A;js.prototype.constructor=js;function ks(){}ks.prototype=js.prototype;function Ge(){}Ge.prototype=new xe;Ge.prototype.constructor=Ge;Ge.prototype.a=function(){return this};Ge.prototype.$classData=z({pr:0},!1,\"cats.kernel.Eq$\",{pr:1,pk:1,c:1,rr:1,e:1,d:1});var Fe=void 0;function Pe(){}Pe.prototype=new Dl;Pe.prototype.constructor=Pe;Pe.prototype.a=function(){return this};\nPe.prototype.$classData=z({tr:0},!1,\"cats.kernel.Hash$\",{tr:1,dD:1,pk:1,c:1,e:1,d:1});var Oe=void 0;function Te(){}Te.prototype=new Fl;Te.prototype.constructor=Te;Te.prototype.a=function(){return this};Te.prototype.$classData=z({ur:0},!1,\"cats.kernel.Monoid$\",{ur:1,vr:1,fm:1,c:1,e:1,d:1});var Se=void 0;function ls(){}ls.prototype=new A;ls.prototype.constructor=ls;ls.prototype.a=function(){return this};\nls.prototype.$classData=z({ks:0},!1,\"cats.kernel.instances.StringMonoid\",{ks:1,c:1,Gd:1,Hd:1,e:1,d:1});function ms(){}ms.prototype=new Vq;ms.prototype.constructor=ms;function ns(){}ns.prototype=ms.prototype;function Zb(){}Zb.prototype=new A;Zb.prototype.constructor=Zb;Zb.prototype.a=function(){return this};Zb.prototype.Tk=function(a,b,c,e){return os(a,b,c,e)};Zb.prototype.il=function(a,b){ps||(ps=(new qs).a());return rs(ps,a,b)};\nZb.prototype.$classData=z({Os:0},!1,\"scalax.collection.Graph$\",{Os:1,c:1,pm:1,om:1,e:1,d:1});var mb=void 0;function ss(){this.Yh=0;this.Fa=null}ss.prototype=new Cr;ss.prototype.constructor=ss;ss.prototype.u=function(){this.Yh=1+this.Yh|0;switch(this.Yh){case 1:return this.Fa.Xa.U(0);case 2:return fo(this.Fa);default:return vc().bm.nb.u()}};function ko(a){var b=new ss;if(null===a)throw T(S(),null);b.Fa=a;b.Yh=0;return b}ss.prototype.r=function(){return 2>this.Yh};\nss.prototype.$classData=z({ht:0},!1,\"scalax.collection.GraphEdge$UnDiEdge$$anon$7\",{ht:1,sH:1,c:1,Bb:1,y:1,A:1});function ts(a){var b=(new rb).a();try{var c=a.Ge;if(c.m()){for(;;){var e=us(a);if(vs(e)){var f=a.Cg.r();a.Ge=(new Q).j(f);if(f){var g=a.Cg.u();a.Ih=g;a=b;var h=new ws;h.Uo=!0;xs.prototype.Q.call(h,a,null);throw h;}var k=us(a);zo(k)}else break}var m=!1}else m=c.Nb();return!!m}catch(p){if(p instanceof xs){h=p;if(h.Ln===b)return h.Uo;throw h;}throw p;}}\nfunction vs(a){var b=a.Ge;b.m()?(b=a.Cg.r(),a.Ge=(new Q).j(b),b?(b=a.Cg.u(),a.Ih=b,a.q||a.q||(a.rn=ys(a.k),a.q=!0),a=a.rn,b=us(a).Ih,zs(a,b),a.Ge=R(),a=!0):a=!1):a=b.Nb();return!!a}function As(){this.k=this.Li=this.Yi=null}As.prototype=new A;As.prototype.constructor=As;d=As.prototype;d.u=function(){var a=ys(this);return zo(a)};d.pa=function(){return this};d.Yb=function(a,b){Hi(this,a,b)};function ys(a){null===a.Li&&null===a.Li&&(a.Li=(new Bs).$k(a));return a.Li}d.ic=function(){return this};d.m=function(){return!this.r()};\nd.Sa=function(){var a=L().G;return Ki(this,a)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};d.x=function(){return Mi(this)};d.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){var a=ys(this);return ts(a)};d.Ka=function(){return rm(this)};d.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};function Cs(a){var b=new As;if(null===a)throw T(S(),null);b.k=a;return b}\nd.lb=function(){var a=Fp();a=jc(a);return Ki(this,a)};d.fc=function(){return!1};d.tb=function(a,b,c){Am(this,a,b,c)};d.Qb=function(){for(var a=Mp(new Np,eo());;){var b=ys(this);if(ts(b))b=ys(this),b=zo(b),Op(a,b);else break}};d.Kb=function(a){return Ri(this,a)};d.$classData=z({wt:0},!1,\"scalax.collection.immutable.AdjacencyListBase$$anon$1\",{wt:1,c:1,eH:1,Bb:1,y:1,A:1});function Ds(){yr.call(this)}Ds.prototype=new zr;Ds.prototype.constructor=Ds;Ds.prototype.u=function(){return Ar(this)};\nDs.prototype.ei=function(a){yr.prototype.ei.call(this,a);return this};Ds.prototype.$classData=z({Ot:0},!1,\"scalax.collection.mutable.EqHash$KeyIndexIterator\",{Ot:1,rm:1,c:1,Bb:1,y:1,A:1});function Es(){yr.call(this)}Es.prototype=new zr;Es.prototype.constructor=Es;Es.prototype.u=function(){return Fs(this)};function Fs(a){var b=Ar(a);a.k;a.k;var c=a.Ch.b[b];c=c===pb().Ee?pb().Ee:c;a.k;return(new K).Q(c,a.Ch.b[1+b|0])}Es.prototype.Dc=function(a){yr.prototype.ei.call(this,a);return this};\nEs.prototype.$classData=z({Qt:0},!1,\"scalax.collection.mutable.EqHashMap$EntryIterator\",{Qt:1,rm:1,c:1,Bb:1,y:1,A:1});function Gs(){yr.call(this)}Gs.prototype=new zr;Gs.prototype.constructor=Gs;Gs.prototype.u=function(){this.k;this.k;var a=this.Ch.b[Ar(this)];return a===pb().Ee?pb().Ee:a};Gs.prototype.Dc=function(a){yr.prototype.ei.call(this,a);return this};Gs.prototype.$classData=z({Rt:0},!1,\"scalax.collection.mutable.EqHashMap$KeyIterator\",{Rt:1,rm:1,c:1,Bb:1,y:1,A:1});\nfunction Hs(){qr.call(this);this.Km=this.cn=this.Im=null}Hs.prototype=new rr;Hs.prototype.constructor=Hs;function rs(a,b,c){var e=new Hs;e.Im=a;e.cn=b;e.Km=c;qr.prototype.wu.call(e,c);return e}Hs.prototype.Ca=function(){return this.Im.Tk(this.Xa,this.ij,this.cn,this.Km)};Hs.prototype.$classData=z({Wt:0},!1,\"scalax.collection.mutable.GraphBuilder\",{Wt:1,rH:1,c:1,tc:1,sc:1,rc:1});function Is(){this.Vc=0;this.Fa=this.go=null}Is.prototype=new Yr;Is.prototype.constructor=Is;\nIs.prototype.u=function(){this.go=gl(Ji(),this.Fa.pb,this.Vc);this.Vc=1+this.Vc|0;return this.go};Is.prototype.r=function(){return this.Vcthis.vg.x())eh().nb.u();else{var a=this.Fa,b=this.vg,c=this.he,e=new Lt;e.vg=b;e.he=c;if(null===a)throw T(S(),null);e.Fa=a;Sr();a=1+c|0;var f=[];rh();if(0!==a&&0>31,h=a-0|0;g=(-2147483648^h)>(-2147483648^a)?-1+(g-0|0)|0:g-0|0;var k=y();uf(k,h,g,1,0);k=y();gg(k,h,g,1,0)}for(h=0;hb)this.Le=!1;else if(c=b,this.Ye.b[c]=1+this.Ye.b[c]|0,c=1+b|0,e=this.he,b=-1+e|0,!(c>=e))for(;;){e=c;this.Ye.b[e]=1+this.Ye.b[-1+e|\n0]|0;if(c===b)break;c=1+c|0}return a};Lt.prototype.$classData=z({sx:0},!1,\"scala.collection.SetLike$SubsetsItr\",{sx:1,cd:1,c:1,Bb:1,y:1,A:1});function Mt(){this.G=null}Mt.prototype=new Hm;Mt.prototype.constructor=Mt;Mt.prototype.a=function(){Gm.prototype.a.call(this);Nt=this;(new oi).a();return this};Mt.prototype.fa=function(){Ot||(Ot=(new Pt).a());return(new sn).a()};Mt.prototype.$classData=z({ux:0},!1,\"scala.collection.Traversable$\",{ux:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Nt=void 0;\nfunction ah(){Nt||(Nt=(new Mt).a());return Nt}function Qt(){}Qt.prototype=new $r;Qt.prototype.constructor=Qt;function Rt(){}Rt.prototype=Qt.prototype;Qt.prototype.Jd=function(){return this.jj()};Qt.prototype.fa=function(){return Ht(new It,this.jj())};function St(){}St.prototype=new $r;St.prototype.constructor=St;function Tt(){}Tt.prototype=St.prototype;St.prototype.fa=function(){return(new rn).Bg(this.Jd())};function Ut(){this.G=null}Ut.prototype=new Hm;Ut.prototype.constructor=Ut;\nUt.prototype.a=function(){Gm.prototype.a.call(this);return this};Ut.prototype.fa=function(){return(new sn).a()};Ut.prototype.$classData=z({Zx:0},!1,\"scala.collection.immutable.Iterable$\",{Zx:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Vt=void 0;function Bt(){Vt||(Vt=(new Ut).a());return Vt}function Wt(){this.fd=null}Wt.prototype=new Yr;Wt.prototype.constructor=Wt;d=Wt.prototype;\nd.u=function(){if(!this.r())return eh().nb.u();var a=dj(this.fd),b=a.w();this.fd=cj(new bj,this,Ob(function(c,e){return function(){return e.Aa()}}(this,a)));return b};d.Sa=function(){var a=this.Ka(),b=L().G;return O(a,b)};function Xt(a){var b=new Wt;b.fd=cj(new bj,b,Ob(function(c,e){return function(){return e}}(b,a)));return b}d.r=function(){return!dj(this.fd).m()};d.Ka=function(){var a=dj(this.fd);this.fd=cj(new bj,this,Ob(function(){return function(){lh();return zm()}}(this)));return a};\nd.$classData=z({Jy:0},!1,\"scala.collection.immutable.StreamIterator\",{Jy:1,cd:1,c:1,Bb:1,y:1,A:1});function Pt(){this.G=null}Pt.prototype=new Hm;Pt.prototype.constructor=Pt;Pt.prototype.a=function(){Gm.prototype.a.call(this);return this};Pt.prototype.fa=function(){return(new sn).a()};Pt.prototype.$classData=z({Ny:0},!1,\"scala.collection.immutable.Traversable$\",{Ny:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Ot=void 0;function Yt(){this.en=null;this.Cd=0;this.zh=this.ul=this.Uj=null;this.Zf=0;this.Mg=null}\nYt.prototype=new Yr;Yt.prototype.constructor=Yt;function Zt(){}Zt.prototype=Yt.prototype;\nYt.prototype.u=function(){if(null!==this.Mg){var a=this.Mg.u();this.Mg.r()||(this.Mg=null);return a}a:{a=this.zh;var b=this.Zf;for(;;){b===(-1+a.b.length|0)?(this.Cd=-1+this.Cd|0,0<=this.Cd?(this.zh=this.Uj.b[this.Cd],this.Zf=this.ul.b[this.Cd],this.Uj.b[this.Cd]=null):(this.zh=null,this.Zf=0)):this.Zf=1+this.Zf|0;a=a.b[b];if(a instanceof $t||a instanceof au){a=this.kn(a);break a}if(a instanceof bu||a instanceof cu)0<=this.Cd&&(this.Uj.b[this.Cd]=this.zh,this.ul.b[this.Cd]=this.Zf),this.Cd=1+this.Cd|\n0,this.zh=du(a),this.Zf=0,a=du(a),b=0;else{this.Mg=a.v();a=this.u();break a}}}return a};Yt.prototype.r=function(){return null!==this.Mg||0<=this.Cd};function du(a){if(a instanceof bu)return a.Sc;if(!(a instanceof cu))throw(new J).j(a);return a.fb}Yt.prototype.nn=function(a){this.en=a;this.Cd=0;this.Uj=r(D(D(eu)),[6]);this.ul=r(D(E),[6]);this.zh=this.en;this.Zf=0;this.Mg=null};function kj(){this.hn=this.la=null}kj.prototype=new A;kj.prototype.constructor=kj;\nfunction jj(a,b,c){a.hn=c;a.la=b;return a}d=kj.prototype;d.t=function(a){return null!==a&&(a===this||a===this.la||Ca(a,this.la))};d.kc=function(a){this.la.Ta(a);return this};d.n=function(){return\"\"+this.la};d.Ca=function(){return this.hn.l(this.la.Ca())};d.ed=function(a,b){this.la.ed(a,b)};d.Ta=function(a){this.la.Ta(a);return this};d.z=function(){return this.la.z()};d.hc=function(a){this.la.hc(a)};d.Gb=function(a){this.la.Gb(a);return this};\nd.$classData=z({Xy:0},!1,\"scala.collection.mutable.Builder$$anon$1\",{Xy:1,c:1,tc:1,sc:1,rc:1,oo:1});function fu(){this.Vc=0;this.Fa=null}fu.prototype=new Yr;fu.prototype.constructor=fu;fu.prototype.u=function(){return this.r()?(this.Vc=1+this.Vc|0,Hb(this.Fa.Ya.b[-1+this.Vc|0])):eh().nb.u()};function ec(a){var b=new fu;if(null===a)throw T(S(),null);b.Fa=a;b.Vc=0;return b}fu.prototype.r=function(){for(;this.Vc=(-2147483648^b):0>c));if(!b)throw(new Bb).h(\"requirement failed: Duration is limited to +-(2^63-1)ns (ca. 292 years)\");\nreturn a}d.Sb=function(a){return this.we(a)};d.we=function(a){if(a instanceof bv){var b=this.Zg.Yd(this.De),c=b.f;b=b.i;c=Hu(new Iu,(new x).g(c,b));b=a.Zg.Yd(a.De);a=b.f;b=b.i;c=c.la;var e=Ma((new x).g(c.f,c.i));c=e.f;e=e.i;b=Ma((new x).g(a,b));a=b.f;b=b.i;return Iq(y(),c,e,a,b)}return-a.we(this)|0};function cv(a,b){var c=b.f,e=b.i;e=0!==c?~e:-e|0;var f=a.De,g=f.i;return(e===g?(-2147483648^(-c|0))<=(-2147483648^f.f):e=(65535&(a.charCodeAt(b)|0))&&48<=(65535&(a.charCodeAt(b)|0)))b=-1+b|0;else break;for(var f=b;;)if(-1!==b&&36!==(65535&(a.charCodeAt(b)|0))&&46!==(65535&(a.charCodeAt(b)|0)))b=-1+b|0;else break;var g=1+b|0;if(b===f&&e!==(a.length|0))return c;for(;;)if(-1!==b&&36===(65535&(a.charCodeAt(b)|\n0)))b=-1+b|0;else break;f=-1===b?!0:46===(65535&(a.charCodeAt(b)|0));var h;(h=f)||(h=65535&(a.charCodeAt(g)|0),h=!(90h||65>h));if(h){e=a.substring(g,e);g=c;if(null===g)throw(new Oc).a();c=\"\"===g?e:\"\"+e+Zj(46)+c;if(f)return c}}}function jv(){this.G=null}jv.prototype=new tq;jv.prototype.constructor=jv;function kv(){}kv.prototype=jv.prototype;function lv(){Yt.call(this)}lv.prototype=new Zt;lv.prototype.constructor=lv;lv.prototype.kn=function(a){return mv(a)};\nlv.prototype.$classData=z({Px:0},!1,\"scala.collection.immutable.HashMap$HashTrieMap$$anon$3\",{Px:1,Oy:1,cd:1,c:1,Bb:1,y:1,A:1});function nv(){Yt.call(this)}nv.prototype=new Zt;nv.prototype.constructor=nv;nv.prototype.kn=function(a){return a.Ec};nv.prototype.$classData=z({Wx:0},!1,\"scala.collection.immutable.HashSet$HashTrieSet$$anon$1\",{Wx:1,Oy:1,cd:1,c:1,Bb:1,y:1,A:1});function ov(){}ov.prototype=new Rt;ov.prototype.constructor=ov;ov.prototype.a=function(){return this};ov.prototype.jj=function(){return Gt()};\nov.prototype.$classData=z({wy:0},!1,\"scala.collection.immutable.Set$\",{wy:1,uo:1,Og:1,Ng:1,Cb:1,c:1,Db:1});var pv=void 0;function Fp(){pv||(pv=(new ov).a());return pv}function qv(){this.si=null}qv.prototype=new ju;qv.prototype.constructor=qv;qv.prototype.a=function(){iu.prototype.a.call(this);return this};qv.prototype.Ca=function(){return rv(this)};function rv(a){return a.si.sb.Ka().Qk(F(function(){return function(b){return b.Ka()}}(a)),(lh(),(new zq).a()))}\nqv.prototype.$classData=z({Hy:0},!1,\"scala.collection.immutable.Stream$StreamBuilder\",{Hy:1,ZH:1,c:1,yi:1,tc:1,sc:1,rc:1});function dm(){this.Zh=this.Gg=this.Rh=0;this.Ym=this.Wm=this.Um=this.Sm=this.Qm=this.ai=null}dm.prototype=new A;dm.prototype.constructor=dm;d=dm.prototype;d.ta=function(){return this.Um};d.a=function(){this.ai=r(D(C),[32]);this.Zh=1;this.Gg=this.Rh=0;return this};d.kd=function(){return this.Zh};d.kc=function(a){return sv(this,a)};d.tg=function(a){this.Ym=a};d.mb=function(){return this.ai};\nd.ab=function(a){this.Sm=a};d.gb=function(){return this.Wm};\nfunction sv(a,b){if(a.Gg>=a.ai.b.length){var c=32+a.Rh|0,e=a.Rh^c;if(1024>e)1===a.kd()&&(a.xa(r(D(C),[32])),a.L().b[0]=a.mb(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb();else if(32768>e)2===a.kd()&&(a.ab(r(D(C),[32])),a.X().b[0]=a.L(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L();else if(1048576>e)3===a.kd()&&(a.Ib(r(D(C),[32])),a.ta().b[0]=a.X(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),a.ab(r(D(C),\n[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L(),a.ta().b[31&(c>>>15|0)]=a.X();else if(33554432>e)4===a.kd()&&(a.Qc(r(D(C),[32])),a.gb().b[0]=a.ta(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),a.ab(r(D(C),[32])),a.Ib(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L(),a.ta().b[31&(c>>>15|0)]=a.X(),a.gb().b[31&(c>>>20|0)]=a.ta();else if(1073741824>e)5===a.kd()&&(a.tg(r(D(C),[32])),a.Rc().b[0]=a.gb(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),\na.ab(r(D(C),[32])),a.Ib(r(D(C),[32])),a.Qc(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L(),a.ta().b[31&(c>>>15|0)]=a.X(),a.gb().b[31&(c>>>20|0)]=a.ta(),a.Rc().b[31&(c>>>25|0)]=a.gb();else throw(new Bb).a();a.Rh=c;a.Gg=0}a.ai.b[a.Gg]=b;a.Gg=1+a.Gg|0;return a}d.Ca=function(){var a=this.Rh+this.Gg|0;if(0===a)a=oh().Vi;else{var b=(new tv).Mf(0,a,0);Eb(b,this,this.Zh);1c)this.La(this.L().b[31&(b>>>5|0)]);else if(32768>c)this.xa(this.X().b[31&(b>>>10|0)]),this.La(this.L().b[0]);else if(1048576>c)this.ab(this.ta().b[31&(b>>>15|0)]),this.xa(this.X().b[0]),this.La(this.L().b[0]);else if(33554432>c)this.Ib(this.gb().b[31&(b>>>20|0)]),this.ab(this.ta().b[0]),this.xa(this.X().b[0]),\nthis.La(this.L().b[0]);else if(1073741824>c)this.Qc(this.Rc().b[31&(b>>>25|0)]),this.Ib(this.gb().b[0]),this.ab(this.ta().b[0]),this.xa(this.X().b[0]),this.La(this.L().b[0]);else throw(new Bb).a();this.Af=b;b=this.Nk-this.Af|0;this.Ok=32>b?b:32;this.f=0}else this.Le=!1;return a};d.ta=function(){return this.Vm};d.kd=function(){return this.Jk};d.tg=function(a){this.Zm=a};d.g=function(a,b){this.Nk=b;this.Af=-32&a;this.f=31&a;a=b-this.Af|0;this.Ok=32>a?a:32;this.Le=(this.Af+this.f|0)>31;return Ju(new Gu,a,(new x).g(b,c))}if(sa(b)||La(b))return b|=0,c=b>>31,Ju(new Gu,a,(new x).g(b,c));if(b instanceof x)return c=Ma(b),b=c.f,c=c.i,Ju(new Gu,a,(new x).g(b,c));if(wa(b)||\"number\"===typeof b){c=new Eu;c.s=+b;if(null===a)throw T(S(),null);c.k=a;return c}if(b instanceof wb||void 0===b||\"boolean\"===typeof b||Dr(b)){c=new Lu;Cc();b=ma(b);b=null!==b?(new lj).h(b):null;c.s=b;if(null===a)throw T(S(),null);c.k=a;return c}if(null!==b){c=new Ku;c.s=b;if(null===\na)throw T(S(),null);c.k=a;return c}throw(new J).j(b);}Gv.prototype.mi=function(a,b){return 0>=this.$a(a,b)};Gv.prototype.$classData=z({pt:0},!1,\"scalax.collection.generic.AnyOrdering\",{pt:1,c:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1});function Bs(){this.Ge=this.Ih=this.Cg=this.Yn=null;this.q=!1;this.k=null}Bs.prototype=new A;Bs.prototype.constructor=Bs;d=Bs.prototype;d.Yb=function(a,b){Hi(this,a,b)};d.pa=function(){return this};d.u=function(){return zo(this)};\nfunction us(a){if(!a.q&&!a.q){var b=a.k;null===b.Yi&&null===b.Yi&&(b.Yi=(new Iv).$k(b));a.Yn=b.Yi;a.q=!0}return a.Yn}d.ic=function(){return this};d.$k=function(a){if(null===a)throw T(S(),null);this.k=a;this.Ge=R();return this};d.Sa=function(){var a=L().G;return Ki(this,a)};d.m=function(){return!this.r()};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};d.Wn=function(a){this.Ge=a};d.x=function(){return Mi(this)};\nd.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){return ts(this)};d.Ka=function(){return rm(this)};d.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};function zs(a,b){a.Cg=Jv(b.Ve,F(function(c,e){return function(f){f=f.ra.Xa.U(0);return null===f?null===e:Ca(f,e)}}(a,b))).v()}d.lb=function(){var a=Fp();a=jc(a);return Ki(this,a)};d.tb=function(a,b,c){Am(this,a,b,c)};d.fc=function(){return!1};d.Qb=function(){for(var a=Mp(new Np,eo());ts(this);){var b=zo(this);Op(a,b)}};\nd.Kb=function(a){return Ri(this,a)};d.$classData=z({xt:0},!1,\"scalax.collection.immutable.AdjacencyListBase$$anon$1$Inner$\",{xt:1,c:1,fH:1,ut:1,Bb:1,y:1,A:1,gH:1});function Iv(){this.Ge=this.Ih=this.Cg=this.rn=null;this.q=!1;this.k=null}Iv.prototype=new A;Iv.prototype.constructor=Iv;d=Iv.prototype;d.Yb=function(a,b){Hi(this,a,b)};d.pa=function(){return this};d.u=function(){return zo(this)};d.ic=function(){return this};\nd.$k=function(a){if(null===a)throw T(S(),null);this.k=a;this.Ge=R();this.Cg=ec(a.k.ac.Za);return this};d.Sa=function(){var a=L().G;return Ki(this,a)};d.m=function(){return!this.r()};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};d.Wn=function(a){this.Ge=a};d.x=function(){return Mi(this)};d.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){return vs(this)};d.Ka=function(){return rm(this)};\nd.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};d.lb=function(){var a=Fp();a=jc(a);return Ki(this,a)};d.tb=function(a,b,c){Am(this,a,b,c)};d.fc=function(){return!1};d.Qb=function(){for(var a=Mp(new Np,eo());vs(this);){var b=zo(this);Op(a,b)}};d.Kb=function(a){return Ri(this,a)};d.$classData=z({yt:0},!1,\"scalax.collection.immutable.AdjacencyListBase$$anon$1$Outer$\",{yt:1,c:1,hH:1,ut:1,Bb:1,y:1,A:1,iH:1});function Kv(){}Kv.prototype=new A;Kv.prototype.constructor=Kv;d=Kv.prototype;d.a=function(){return this};\nd.Ba=function(){return\"HNil\"};d.za=function(){return 0};d.U=function(a){throw(new X).h(\"\"+a);};d.n=function(){return\"HNil\"};d.oa=function(a){return a instanceof Kv};d.z=function(){return 2223273};d.$classData=z({du:0},!1,\"shapeless.HNil$\",{du:1,c:1,uH:1,cu:1,Ia:1,p:1,e:1,d:1});var Lv=void 0;function Ac(){Lv||(Lv=(new Kv).a());return Lv}function Gg(){this.Vh=null}Gg.prototype=new A;Gg.prototype.constructor=Gg;Gg.prototype.$a=function(a,b){return this.Vh.$a(a,b)};\nGg.prototype.mi=function(a,b){return 0>=this.$a(a,b)};Gg.prototype.$classData=z({bv:0},!1,\"java.util.Arrays$$anon$3\",{bv:1,c:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1});function ak(){W.call(this);this.Jf=null}ak.prototype=new Xu;ak.prototype.constructor=ak;ak.prototype.ud=function(){return\"Flags \\x3d '\"+this.Jf+\"'\"};ak.prototype.h=function(a){this.Jf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};\nak.prototype.$classData=z({cv:0},!1,\"java.util.DuplicateFormatFlagsException\",{cv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function Jr(){W.call(this);this.Jf=null;this.Bf=0}Jr.prototype=new Xu;Jr.prototype.constructor=Jr;Jr.prototype.ud=function(){return\"Conversion \\x3d \"+Zj(this.Bf)+\", Flags \\x3d \"+this.Jf};Jr.prototype.$classData=z({dv:0},!1,\"java.util.FormatFlagsConversionMismatchException\",{dv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function ik(){W.call(this);this.Bf=0}ik.prototype=new Xu;\nik.prototype.constructor=ik;ik.prototype.ud=function(){return\"Code point \\x3d 0x\"+(+(this.Bf>>>0)).toString(16)};ik.prototype.ua=function(a){this.Bf=a;W.prototype.Ua.call(this,null,null);return this};ik.prototype.$classData=z({hv:0},!1,\"java.util.IllegalFormatCodePointException\",{hv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function Mr(){W.call(this);this.Bf=0;this.zm=null}Mr.prototype=new Xu;Mr.prototype.constructor=Mr;Mr.prototype.ud=function(){return l.String.fromCharCode(this.Bf)+\" !\\x3d \"+sb(this.zm)};\nMr.prototype.$classData=z({iv:0},!1,\"java.util.IllegalFormatConversionException\",{iv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function tk(){W.call(this);this.Jf=null}tk.prototype=new Xu;tk.prototype.constructor=tk;tk.prototype.ud=function(){return\"Flags \\x3d '\"+this.Jf+\"'\"};tk.prototype.h=function(a){this.Jf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};tk.prototype.$classData=z({jv:0},!1,\"java.util.IllegalFormatFlagsException\",{jv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});\nfunction hk(){W.call(this);this.bo=0}hk.prototype=new Xu;hk.prototype.constructor=hk;hk.prototype.ud=function(){return\"\"+this.bo};hk.prototype.ua=function(a){this.bo=a;W.prototype.Ua.call(this,null,null);return this};hk.prototype.$classData=z({kv:0},!1,\"java.util.IllegalFormatPrecisionException\",{kv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function wk(){W.call(this);this.Vo=0}wk.prototype=new Xu;wk.prototype.constructor=wk;wk.prototype.ud=function(){return\"\"+this.Vo};\nwk.prototype.ua=function(a){this.Vo=a;W.prototype.Ua.call(this,null,null);return this};wk.prototype.$classData=z({lv:0},!1,\"java.util.IllegalFormatWidthException\",{lv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function ek(){W.call(this);this.Wf=null}ek.prototype=new Xu;ek.prototype.constructor=ek;ek.prototype.ud=function(){return\"Format specifier '\"+this.Wf+\"'\"};ek.prototype.h=function(a){this.Wf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};\nek.prototype.$classData=z({mv:0},!1,\"java.util.MissingFormatArgumentException\",{mv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function dk(){W.call(this);this.Wf=null}dk.prototype=new Xu;dk.prototype.constructor=dk;dk.prototype.ud=function(){return this.Wf};dk.prototype.h=function(a){this.Wf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};dk.prototype.$classData=z({nv:0},!1,\"java.util.MissingFormatWidthException\",{nv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});\nfunction Yj(){W.call(this);this.Wf=null}Yj.prototype=new Xu;Yj.prototype.constructor=Yj;Yj.prototype.ud=function(){return\"Conversion \\x3d '\"+this.Wf+\"'\"};Yj.prototype.h=function(a){this.Wf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};Yj.prototype.$classData=z({pv:0},!1,\"java.util.UnknownFormatConversionException\",{pv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function Wp(){}Wp.prototype=new av;Wp.prototype.constructor=Wp;d=Wp.prototype;d.a=function(){return this};\nd.t=function(){return!1};d.n=function(){return\"Duration.Undefined\"};d.Sb=function(a){return this.we(a)};d.we=function(a){return a===this?0:1};d.$classData=z({$v:0},!1,\"scala.concurrent.duration.Duration$$anon$1\",{$v:1,po:1,pl:1,c:1,e:1,d:1,Rd:1,bb:1});function Xp(){}Xp.prototype=new av;Xp.prototype.constructor=Xp;d=Xp.prototype;d.a=function(){return this};d.n=function(){return\"Duration.Inf\"};d.Sb=function(a){return this.we(a)};d.we=function(a){return a===sl().vm?-1:a===this?0:1};\nd.$classData=z({aw:0},!1,\"scala.concurrent.duration.Duration$$anon$2\",{aw:1,po:1,pl:1,c:1,e:1,d:1,Rd:1,bb:1});function Yp(){}Yp.prototype=new av;Yp.prototype.constructor=Yp;d=Yp.prototype;d.a=function(){return this};d.n=function(){return\"Duration.MinusInf\"};d.Sb=function(a){return this.we(a)};d.we=function(a){return a===this?0:-1};d.$classData=z({bw:0},!1,\"scala.concurrent.duration.Duration$$anon$3\",{bw:1,po:1,pl:1,c:1,e:1,d:1,Rd:1,bb:1});function Mv(){this.Mj=null}Mv.prototype=new A;\nMv.prototype.constructor=Mv;d=Mv.prototype;d.$c=function(a){var b=this.Ub();b===w(Va)?a=r(D(Va),[a]):b===w(Wa)?a=r(D(Wa),[a]):b===w(Ua)?a=r(D(Ua),[a]):b===w(E)?a=r(D(E),[a]):b===w(Xa)?a=r(D(Xa),[a]):b===w(Ya)?a=r(D(Ya),[a]):b===w(Za)?a=r(D(Za),[a]):b===w(Sa)?a=r(D(Sa),[a]):b===w(Ra)?a=r(D(Aa),[a]):(Bg||(Bg=(new Ag).a()),b=this.Ub(),a=ug(b,[a]));return a};d.t=function(a){if(a&&a.$classData&&a.$classData.qa.Lc){var b=this.Ub();a=a.Ub();b=b===a}else b=!1;return b};d.n=function(){return rt(this,this.Mj)};\nd.Ub=function(){return this.Mj};d.oa=function(a){return!!(a&&a.$classData&&a.$classData.qa.Lc)};function Xb(){var a=new Mv,b=w(Nv);a.Mj=b;return a}d.z=function(){return wi(xi(),this.Mj)};d.$classData=z({tw:0},!1,\"scala.reflect.ClassTag$GenericClassTag\",{tw:1,c:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});function Ov(){this.G=null}Ov.prototype=new kv;Ov.prototype.constructor=Ov;Ov.prototype.a=function(){Gm.prototype.a.call(this);return this};Ov.prototype.fa=function(){Pv||(Pv=(new Qv).a());return(new sn).a()};\nOv.prototype.$classData=z({ox:0},!1,\"scala.collection.Seq$\",{ox:1,me:1,le:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Rv=void 0;function ch(){Rv||(Rv=(new Ov).a());return Rv}function Sv(){this.G=null}Sv.prototype=new kv;Sv.prototype.constructor=Sv;function Tv(){}Tv.prototype=Sv.prototype;function Uv(){}Uv.prototype=new vq;Uv.prototype.constructor=Uv;Uv.prototype.a=function(){Vv=this;Om(new Nm,Od(function(){return function(a){return a}}(this)));return this};\nfunction Wv(a,b,c,e,f,g,h){var k=31&(b>>>g|0),m=31&(e>>>g|0);if(k!==m)return a=1<a.Kd?(Uu||(Uu=(new Tu).a()),b=Uu):b=a instanceof Pu?og(b,a.gd,a.Kd,a.ve):a===Su()?ng(qg(),b):a;return iw(b)}\nhw.prototype.Jd=function(){return iw(ng(qg(),16))};hw.prototype.$classData=z({Yt:0},!1,\"scalax.collection.mutable.SimpleArraySet$\",{Yt:1,wl:1,Og:1,Ng:1,Cb:1,c:1,Db:1,e:1,d:1});var jw=void 0;function Ls(){jw||(jw=(new hw).a());return jw}function zg(){this.yn=!1;this.Sh=null}zg.prototype=new Fv;zg.prototype.constructor=zg;\nfunction Sb(a,b){for(;\"\"!==b;){var c=b.indexOf(\"\\n\")|0;if(0>c)a.Sh=\"\"+a.Sh+b,b=\"\";else{var e=\"\"+a.Sh+b.substring(0,c);l.console&&(a.yn&&l.console.error?l.console.error(e):l.console.log(e));a.Sh=\"\";b=b.substring(1+c|0)}}}zg.prototype.$e=function(a){this.yn=a;(new Us).a();this.Sh=\"\";return this};zg.prototype.ej=function(){};zg.prototype.$classData=z({Mu:0},!1,\"java.lang.JSConsoleBasedPrintStream\",{Mu:1,FG:1,EG:1,ys:1,c:1,qk:1,Fn:1,gm:1,zu:1});function Kq(){K.call(this);this.ck=this.ak=0}\nKq.prototype=new Vu;Kq.prototype.constructor=Kq;d=Kq.prototype;d.bk=function(){return this.ak};d.g=function(a,b){this.ak=a;this.ck=b;K.prototype.Q.call(this,null,null);return this};d.Qa=function(){return this.ck};d.dk=function(){return this.ck};d.Ga=function(){return this.ak};d.$classData=z({Vv:0},!1,\"scala.Tuple2$mcII$sp\",{Vv:1,um:1,c:1,Sv:1,Ia:1,p:1,e:1,d:1,GH:1});function ve(){W.call(this);this.Fj=null}ve.prototype=new Er;ve.prototype.constructor=ve;d=ve.prototype;d.Ba=function(){return\"UninitializedFieldError\"};\nd.za=function(){return 1};d.t=function(a){return this===a?!0:a instanceof ve?this.Fj===a.Fj:!1};d.U=function(a){switch(a){case 0:return this.Fj;default:throw(new X).h(\"\"+a);}};d.oa=function(a){return a instanceof ve};d.h=function(a){this.Fj=a;W.prototype.Ua.call(this,a,null);return this};d.z=function(){return ui(this)};d.$classData=z({Wv:0},!1,\"scala.UninitializedFieldError\",{Wv:1,wb:1,vb:1,hb:1,c:1,d:1,Ia:1,p:1,e:1});function kw(){}kw.prototype=new A;kw.prototype.constructor=kw;kw.prototype.a=function(){return this};\nkw.prototype.$a=function(a,b){a|=0;b|=0;return a===b?0:a=this.$a(a,b)};kw.prototype.$classData=z({nw:0},!1,\"scala.math.Ordering$Int$\",{nw:1,c:1,NH:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1});var lw=void 0;function mw(){lw||(lw=(new kw).a());return lw}function nw(){this.jc=null}nw.prototype=new A;nw.prototype.constructor=nw;function ow(){}ow.prototype=nw.prototype;nw.prototype.t=function(a){return this===a};nw.prototype.n=function(){return this.jc};\nnw.prototype.oa=function(a){return a instanceof nw};nw.prototype.z=function(){return Ia(this)};function pw(){}pw.prototype=new A;pw.prototype.constructor=pw;function qw(){}qw.prototype=pw.prototype;pw.prototype.oa=function(a){return!!(a&&a.$classData&&a.$classData.qa.md)};function rw(){this.G=null}rw.prototype=new Tv;rw.prototype.constructor=rw;rw.prototype.a=function(){Gm.prototype.a.call(this);sw=this;(new rq).a();return this};rw.prototype.fa=function(){cm();oh();return(new dm).a()};\nrw.prototype.$classData=z({dx:0},!1,\"scala.collection.IndexedSeq$\",{dx:1,vo:1,me:1,le:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var sw=void 0;function dh(){sw||(sw=(new rw).a());return sw}function tw(){this.wd=this.wg=0;this.Fa=null}tw.prototype=new Yr;tw.prototype.constructor=tw;tw.prototype.u=function(){this.wd>=this.wg&&eh().nb.u();var a=this.Fa.db(this.wd);this.wd=1+this.wd|0;return a};function uw(a,b,c){a.wg=c;if(null===b)throw T(S(),null);a.Fa=b;a.wd=0;return a}tw.prototype.r=function(){return this.wd>>g|0),k=31&(e>>>g|0);if(h!==k)return a=1<>24&&0===(1&a.q)<<24>>24&&(a.Wl=gq(),a.q=(1|a.q)<<24>>24);var b=a.Wl;var c=a=b.mh;if((null===a?null===c:a.t(c))&&0>=b.Fe&&0<=b.Sf){c=0-b.Fe|0;var e=(b.q?b.Cf:aq(b)).b[c];null===e&&(e=Y(),e=fq(new dq,Fn(e,(new x).g(0,0)),a),(b.q?b.Cf:aq(b)).b[c]=e);a=e}else b=(new x).g(0,0),c=new dq,e=new Gn,Gn.prototype.Xk.call(e,b,0),eq(e,a),a=fq(c,e,a);this.nb=a;return this};\nJw.prototype.$classData=z({Dr:0},!1,\"cats.kernel.instances.BigDecimalGroup\",{Dr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Kw(){this.nb=null}Kw.prototype=new A;Kw.prototype.constructor=Kw;Kw.prototype.a=function(){var a=vc();0===(2&a.q)<<24>>24&&0===(2&a.q)<<24>>24&&(a.Xl=nq(),a.q=(2|a.q)<<24>>24);this.nb=kq(a.Xl,0);return this};Kw.prototype.$classData=z({Fr:0},!1,\"cats.kernel.instances.BigIntGroup\",{Fr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Lw(){}Lw.prototype=new A;\nLw.prototype.constructor=Lw;Lw.prototype.a=function(){return this};Lw.prototype.$classData=z({Kr:0},!1,\"cats.kernel.instances.ByteGroup\",{Kr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Mw(){}Mw.prototype=new A;Mw.prototype.constructor=Mw;Mw.prototype.a=function(){return this};Mw.prototype.$classData=z({Pr:0},!1,\"cats.kernel.instances.DurationGroup\",{Pr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Nw(){}Nw.prototype=new A;Nw.prototype.constructor=Nw;Nw.prototype.a=function(){return this};\nNw.prototype.$classData=z({Rr:0},!1,\"cats.kernel.instances.FiniteDurationGroup\",{Rr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Ow(){}Ow.prototype=new A;Ow.prototype.constructor=Ow;Ow.prototype.a=function(){return this};Ow.prototype.$classData=z({fs:0},!1,\"cats.kernel.instances.ShortGroup\",{fs:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Pw(){}Pw.prototype=new A;Pw.prototype.constructor=Pw;Pw.prototype.a=function(){return this};\nPw.prototype.$a=function(a,b){return a===b?0:a===b?0:a=this.$a(a,b)};\nQl.prototype.$classData=z({Ts:0},!1,\"scalax.collection.GraphBase$EdgeOrdering$$anon$2\",{Ts:1,c:1,HG:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1,Us:1});function Ll(){this.Vh=this.k=null}Ll.prototype=new A;Ll.prototype.constructor=Ll;function Kl(a,b,c){if(null===b)throw T(S(),null);a.k=b;a.Vh=c;return a}Ll.prototype.$a=function(a,b){return de(this.Vh,a,b)|0};Ll.prototype.mi=function(a,b){return 0>=this.$a(a,b)};\nLl.prototype.$classData=z({Ys:0},!1,\"scalax.collection.GraphBase$NodeOrdering$$anon$1\",{Ys:1,c:1,LG:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1,Us:1});function dq(){this.Ha=null;this.fj=0}dq.prototype=new oq;dq.prototype.constructor=dq;d=dq.prototype;d.hi=function(){try{return Yq(this.Ha,32),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Yc=function(){return this.Ha.Yc()};\nfunction fq(a,b,c){a.Ha=b;if(null===b)throw(new Bb).h(\"null value for BigDecimal\");if(null===c)throw(new Bb).h(\"null MathContext for BigDecimal\");a.fj=1565550863;return a}d.Aj=function(){try{return Yq(this.Ha,16),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Th=function(){return this.Ha.Xc()<<24>>24};\nd.t=function(a){if(a instanceof dq)return Rw(this,a);if(a instanceof lq){var b=a.qb;b=nf(qf(),b);var c=er(this.Ha);if(b>3.3219280948873626*(-2+(c-this.Ha.R|0)|0)){if(0>=this.Ha.R||0>=ar(this.Ha).R)try{var e=(new Q).j((new lq).Ag(Zq(this.Ha)))}catch(f){if(f instanceof Mn)e=R();else throw f;}else e=R();if(e.m())return!1;e=e.Nb();return 0===fr(a.qb,e.qb)}return!1}return\"number\"===typeof a?(e=+a,Infinity!==e&&-Infinity!==e&&(a=this.Ha.ee(),Infinity!==a&&-Infinity!==a&&a===e)?(e=gq(),Rw(this,cq(a,e.mh))):\n!1):wa(a)?(e=+a,Infinity!==e&&-Infinity!==e&&(a=this.Ha.Kf(),Infinity!==a&&-Infinity!==a&&a===e)?(e=gq(),Rw(this,cq(a,e.mh))):!1):this.zj()&&vb(this,a)};d.yj=function(){return this.hi()&&0<=Yq(this.Ha,32).f&&65535>=Yq(this.Ha,32).f};d.n=function(){return this.Ha.n()};d.xj=function(){try{return Yq(this.Ha,8),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Sb=function(a){return nr(this.Ha,a.Ha)};d.Ro=function(){return this.Ha};d.zi=function(){return this.Ha.Xc()<<16>>16};d.ee=function(){return this.Ha.ee()};\nd.z=function(){if(1565550863===this.fj){if((0>=this.Ha.R||0>=ar(this.Ha).R)&&4934>(er(this.Ha)-this.Ha.R|0))var a=(new lq).Ag(Xq(this.Ha)).z();else{a=this.Ha.ee();if(Infinity!==a&&-Infinity!==a){var b=gq();a=Rw(this,cq(a,b.mh))}else a=!1;a?a=jl(xi(),this.Ha.ee()):(a=ar(this.Ha),a=vi().pi(Xq(lr(a,a.R)).z(),a.R))}this.fj=a}return this.fj};d.Xc=function(){return this.Ha.Xc()};d.zj=function(){try{return Yq(this.Ha,64),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Kf=function(){return this.Ha.Kf()};\nfunction Rw(a,b){return 0===nr(a.Ha,b.Ha)}var bq=z({dw:0},!1,\"scala.math.BigDecimal\",{dw:1,ow:1,Be:1,c:1,d:1,pw:1,ql:1,e:1,Rd:1,bb:1});dq.prototype.$classData=bq;function lq(){this.qb=null}lq.prototype=new oq;lq.prototype.constructor=lq;d=lq.prototype;d.hi=function(){var a=kq(nq(),-2147483648);return 0<=this.Sb(a)?(a=kq(nq(),2147483647),0>=this.Sb(a)):!1};d.Yc=function(){return this.qb.Yc()};d.Aj=function(){var a=kq(nq(),-32768);return 0<=this.Sb(a)?(a=kq(nq(),32767),0>=this.Sb(a)):!1};\nd.Th=function(){return this.qb.Xc()<<24>>24};\nd.t=function(a){if(a instanceof lq)return 0===fr(this.qb,a.qb);if(a instanceof dq)return a.t(this);if(\"number\"===typeof a){a=+a;var b=this.qb;b=nf(qf(),b);if(53>=b)b=!0;else{var c=mr(this.qb);b=1024>=b&&c>=(-53+b|0)&&1024>c}return b&&!Sw(this)?(b=this.qb,Qo(So(),vf(xf(),b))===a):!1}return wa(a)?(a=+a,b=this.qb,b=nf(qf(),b),24>=b?b=!0:(c=mr(this.qb),b=128>=b&&c>=(-24+b|0)&&128>c),b&&!Sw(this)?(b=this.qb,b=vf(xf(),b),ca(Qo(So(),b))===a):!1):this.zj()&&vb(this,a)};\nfunction Sw(a){a=cg(a.qb,2147483647);return 0!==a.N&&!a.t(nq().ro)}d.yj=function(){var a=kq(nq(),0);return 0<=this.Sb(a)?(a=kq(nq(),65535),0>=this.Sb(a)):!1};d.n=function(){var a=this.qb;return vf(xf(),a)};d.xj=function(){var a=kq(nq(),-128);return 0<=this.Sb(a)?(a=kq(nq(),127),0>=this.Sb(a)):!1};d.Sb=function(a){return fr(this.qb,a.qb)};d.Ro=function(){return this.qb};d.zi=function(){return this.qb.Xc()<<16>>16};d.ee=function(){var a=this.qb;return Qo(So(),vf(xf(),a))};\nd.z=function(){if(this.zj()){var a=this.Yc();var b=a.f;a=a.i;b=(-1===a?0<=(-2147483648^b):-1=(-2147483648^b):0>a)?b:ll(xi(),(new x).g(b,a))}else b=wi(xi(),this.qb);return b};d.Xc=function(){return this.qb.Xc()};d.Ag=function(a){this.qb=a;return this};d.zj=function(){var a=mq(nq(),(new x).g(0,-2147483648));return 0<=this.Sb(a)?(a=mq(nq(),(new x).g(-1,2147483647)),0>=this.Sb(a)):!1};d.Kf=function(){var a=this.qb;a=vf(xf(),a);return ca(Qo(So(),a))};\nvar jq=z({fw:0},!1,\"scala.math.BigInt\",{fw:1,ow:1,Be:1,c:1,d:1,pw:1,ql:1,e:1,Rd:1,bb:1});lq.prototype.$classData=jq;function Zh(){this.jc=null}Zh.prototype=new ow;Zh.prototype.constructor=Zh;Zh.prototype.a=function(){this.jc=\"Boolean\";return this};Zh.prototype.$c=function(a){return r(D(Sa),[a])};Zh.prototype.Ub=function(){return w(Sa)};Zh.prototype.$classData=z({xw:0},!1,\"scala.reflect.ManifestFactory$BooleanManifest$\",{xw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Yh=void 0;\nfunction Lh(){this.jc=null}Lh.prototype=new ow;Lh.prototype.constructor=Lh;Lh.prototype.a=function(){this.jc=\"Byte\";return this};Lh.prototype.$c=function(a){return r(D(Va),[a])};Lh.prototype.Ub=function(){return w(Va)};Lh.prototype.$classData=z({yw:0},!1,\"scala.reflect.ManifestFactory$ByteManifest$\",{yw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Kh=void 0;function Ph(){this.jc=null}Ph.prototype=new ow;Ph.prototype.constructor=Ph;Ph.prototype.a=function(){this.jc=\"Char\";return this};\nPh.prototype.$c=function(a){return r(D(Ua),[a])};Ph.prototype.Ub=function(){return w(Ua)};Ph.prototype.$classData=z({zw:0},!1,\"scala.reflect.ManifestFactory$CharManifest$\",{zw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Oh=void 0;function Xh(){this.jc=null}Xh.prototype=new ow;Xh.prototype.constructor=Xh;Xh.prototype.a=function(){this.jc=\"Double\";return this};Xh.prototype.$c=function(a){return r(D(Za),[a])};Xh.prototype.Ub=function(){return w(Za)};\nXh.prototype.$classData=z({Aw:0},!1,\"scala.reflect.ManifestFactory$DoubleManifest$\",{Aw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Wh=void 0;function Vh(){this.jc=null}Vh.prototype=new ow;Vh.prototype.constructor=Vh;Vh.prototype.a=function(){this.jc=\"Float\";return this};Vh.prototype.$c=function(a){return r(D(Ya),[a])};Vh.prototype.Ub=function(){return w(Ya)};Vh.prototype.$classData=z({Bw:0},!1,\"scala.reflect.ManifestFactory$FloatManifest$\",{Bw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});\nvar Uh=void 0;function Rh(){this.jc=null}Rh.prototype=new ow;Rh.prototype.constructor=Rh;Rh.prototype.a=function(){this.jc=\"Int\";return this};Rh.prototype.$c=function(a){return r(D(E),[a])};Rh.prototype.Ub=function(){return w(E)};Rh.prototype.$classData=z({Cw:0},!1,\"scala.reflect.ManifestFactory$IntManifest$\",{Cw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Qh=void 0;function Th(){this.jc=null}Th.prototype=new ow;Th.prototype.constructor=Th;Th.prototype.a=function(){this.jc=\"Long\";return this};\nTh.prototype.$c=function(a){return r(D(Xa),[a])};Th.prototype.Ub=function(){return w(Xa)};Th.prototype.$classData=z({Dw:0},!1,\"scala.reflect.ManifestFactory$LongManifest$\",{Dw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Sh=void 0;function Tw(){this.oe=null}Tw.prototype=new qw;Tw.prototype.constructor=Tw;function Uw(){}Uw.prototype=Tw.prototype;Tw.prototype.t=function(a){return this===a};Tw.prototype.n=function(){return this.oe};Tw.prototype.z=function(){return Ia(this)};\nfunction Nh(){this.jc=null}Nh.prototype=new ow;Nh.prototype.constructor=Nh;Nh.prototype.a=function(){this.jc=\"Short\";return this};Nh.prototype.$c=function(a){return r(D(Wa),[a])};Nh.prototype.Ub=function(){return w(Wa)};Nh.prototype.$classData=z({Hw:0},!1,\"scala.reflect.ManifestFactory$ShortManifest$\",{Hw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Mh=void 0;function ai(){this.jc=null}ai.prototype=new ow;ai.prototype.constructor=ai;ai.prototype.a=function(){this.jc=\"Unit\";return this};\nai.prototype.$c=function(a){return r(D(Aa),[a])};ai.prototype.Ub=function(){return w(Ra)};ai.prototype.$classData=z({Iw:0},!1,\"scala.reflect.ManifestFactory$UnitManifest$\",{Iw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var $h=void 0;function Vw(a,b){if(b instanceof tv&&a instanceof tv){if(a===b)return!0;var c=a.na()===b.na();if(c)for(var e=b.na(),f=0;f=b)){c.ed(b,a);var e=0;for(a=a.v();eb?0:b)|0);var e=0;for(a=a.v();e>16===a};d.Th=function(){Xk();return this.la<<24>>24};\nd.t=function(a){Xk();return a instanceof ux?this.la===a.la:!1};function Fu(a){var b=new ux;b.la=a;return b}d.yj=function(){Xk();var a=this.la;return(65535&Ja(a))===a};d.n=function(){return\"\"+this.la};d.xj=function(){Xk();var a=this.la;return a<<24>>24===a};d.Sb=function(a){var b=this.la;a=+a;return Po(So(),b,a)};d.zi=function(){Xk();return this.la<<16>>16};d.ee=function(){return this.la};d.z=function(){var a=this.la;return Ga(Ha(),a)};d.Xc=function(){Xk();return Ja(this.la)};\nd.Kf=function(){Xk();return ca(this.la)};d.$classData=z({Nz:0},!1,\"scala.runtime.RichDouble\",{Nz:1,c:1,fI:1,Rz:1,ql:1,Tv:1,oo:1,Lz:1,Rd:1,bb:1,Mz:1});z({zq:0},!1,\"cats.instances.Function1Instances$$anon$8\",{zq:1,c:1,AA:1,yA:1,CA:1,Cp:1,e:1,d:1,KA:1,IA:1,DA:1,FA:1});function vx(){}vx.prototype=new A;vx.prototype.constructor=vx;vx.prototype.a=function(){return this};vx.prototype.$a=function(a,b){a=+a;b=+b;return Po(So(),a,b)};vx.prototype.Bc=function(a,b){return+a===+b};\nvx.prototype.$classData=z({Or:0},!1,\"cats.kernel.instances.DoubleOrder\",{Or:1,c:1,sD:1,Pc:1,Jc:1,zc:1,e:1,d:1,CD:1,JC:1,XC:1,Ic:1});function wx(){}wx.prototype=new A;wx.prototype.constructor=wx;wx.prototype.a=function(){return this};wx.prototype.$a=function(a,b){a=+a;b=+b;return Po(So(),a,b)};wx.prototype.Bc=function(a,b){return+a===+b};wx.prototype.$classData=z({Ur:0},!1,\"cats.kernel.instances.FloatOrder\",{Ur:1,c:1,tD:1,Pc:1,Jc:1,zc:1,e:1,d:1,DD:1,KC:1,YC:1,Ic:1});\nfunction hc(a){var b=(new Co).ua(a.Ve.x()),c=a.Ve;a=function(h,k){return function(m){Sl(h.k);var p=m.ra.Xa.U(0);p!==h&&Do(k,p,m)}}(a,b);if(null===c.pb){c=c.vd;for(var e=0,f=c.Ya.b.length;eb)return 1;var c=0;for(a=a.v();a.r();){if(c===b)return a.r()?1:0;a.u();c=1+c|0}return c-b|0}function Bx(a,b){var c=a.na(),e=a.fa();if(1===c)e.Gb(a);else if(1>31===a.i};d.Yc=function(){var a=this.la;return(new x).g(a.f,a.i)};d.Aj=function(){al();var a=this.la,b=a.f<<16>>16;return b===a.f&&b>>31===a.i};function Hu(a,b){a.la=b;return a}d.Th=function(){al();return this.la.f<<24>>24};d.t=function(a){al();var b=this.la;if(a instanceof Iu){a=a.la;var c=a.i;b=b.f===a.f&&b.i===c}else b=!1;return b};\nd.yj=function(){al();var a=this.la,b=65535&a.f;return b===a.f&&b>>31===a.i};d.n=function(){return\"\"+this.la};d.xj=function(){al();var a=this.la,b=a.f<<24>>24;return b===a.f&&b>>31===a.i};d.Sb=function(a){var b=this.la,c=Ma((new x).g(b.f,b.i));b=c.f;c=c.i;var e=Ma(a);a=e.f;e=e.i;return Iq(y(),b,c,a,e)};d.zi=function(){al();return this.la.f<<16>>16};d.ee=function(){return Zk(al(),this.la)};d.z=function(){var a=this.la;return a.f^a.i};d.Xc=function(){al();return this.la.f};\nd.Kf=function(){al();var a=this.la;return ca(Rk(y(),a.f,a.i))};d.$classData=z({Pz:0},!1,\"scala.runtime.RichLong\",{Pz:1,c:1,gI:1,iI:1,Rz:1,ql:1,Tv:1,oo:1,Lz:1,Rd:1,bb:1,Mz:1});function Cx(){}Cx.prototype=new A;Cx.prototype.constructor=Cx;Cx.prototype.a=function(){return this};Cx.prototype.$classData=z({os:0},!1,\"cats.kernel.instances.UnitAlgebra\",{os:1,c:1,kr:1,Cr:1,jr:1,Hd:1,e:1,d:1,$d:1,Zd:1,Gd:1,re:1,se:1});function Dx(a){var b=(new wr).ua(a.x());a=a.pa();Ex(b,a);return b}\nfunction Fx(){this.E=this.k=null}Fx.prototype=new px;Fx.prototype.constructor=Fx;function Gx(){}Gx.prototype=Fx.prototype;Fx.prototype.su=function(a,b){this.E=b;ox.prototype.Ze.call(this,a)};function Hx(a){return 0===a.na()?uw(new tw,a,a.na()).u():a.db(0)}function Ix(a,b){return a.na()-b|0}function Jx(a,b){if(b&&b.$classData&&b.$classData.qa.yh){var c=a.na();if(c===b.na()){for(var e=0;eb||a.m())throw(new X).h(\"\"+b);return a.w()}\nfunction Rx(a,b){if(b&&b.$classData&&b.$classData.qa.Jg){if(a===b)return!0;for(;!a.m()&&!b.m()&&G(H(),a.w(),b.w());)a=a.Aa(),b=b.Aa();return a.m()&&b.m()}return Vw(a,b)}function Sx(a,b){for(;!a.m();){if(!b.l(a.w()))return!1;a=a.Aa()}return!0}function Tx(a,b){for(;!a.m();){if(b.l(a.w()))return(new Q).j(a.w());a=a.Aa()}return R()}function gc(a){for(var b=0;!a.m();)b=1+b|0,a=a.Aa();return b}function Sp(a){if(a.m())throw(new V).a();for(var b=a.Aa();!b.m();)a=b,b=b.Aa();return a.w()}\nfunction Oy(a,b){var c=0;for(;;){if(c===b)return a.m()?0:1;if(a.m())return-1;c=1+c|0;a=a.Aa()}}function Py(a){var b=(new wr).ua(a.x());a.K(F(function(c,e){return function(f){return ur(e,f)}}(a,b)));return b}function Qy(a){return!!(a&&a.$classData&&a.$classData.qa.aa)}function Ry(a){var b=(new wr).ua(a.x());a.K(F(function(c,e){return function(f){return ur(e,f)}}(a,b)));return b}function Sy(a){throw(new V).h(\"key not found: \"+a);}\nfunction Ty(a,b,c,e,f){var g=a.v();a=(new Dt).fi(g,F(function(){return function(h){if(null!==h){var k=h.Ga();h=h.Qa();Sg||(Sg=(new Qg).a());return\"\"+k+\" -\\x3e \"+h}throw(new J).j(h);}}(a)));return Ni(a,b,c,e,f)}function Uy(){}Uy.prototype=new A;Uy.prototype.constructor=Uy;Uy.prototype.a=function(){return this};Uy.prototype.$classData=z({Nr:0},!1,\"cats.kernel.instances.DoubleGroup\",{Nr:1,c:1,vC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,zC:1,DC:1,JD:1,mD:1,QC:1});function Vy(){}Vy.prototype=new A;\nVy.prototype.constructor=Vy;Vy.prototype.a=function(){return this};Vy.prototype.$classData=z({Tr:0},!1,\"cats.kernel.instances.FloatGroup\",{Tr:1,c:1,wC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,AC:1,EC:1,KD:1,nD:1,RC:1});function Wy(){}Wy.prototype=new A;Wy.prototype.constructor=Wy;Wy.prototype.a=function(){return this};Wy.prototype.$classData=z({Vr:0},!1,\"cats.kernel.instances.IntGroup\",{Vr:1,c:1,xC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,BC:1,FC:1,LD:1,oD:1,SC:1});function Xy(){}Xy.prototype=new A;\nXy.prototype.constructor=Xy;Xy.prototype.a=function(){return this};Xy.prototype.$classData=z({$r:0},!1,\"cats.kernel.instances.LongGroup\",{$r:1,c:1,yC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,CC:1,GC:1,MD:1,pD:1,TC:1});function Yy(){Fx.call(this);this.Gi=this.fk=this.Ve=null}Yy.prototype=new Gx;Yy.prototype.constructor=Yy;function Zy(){}Zy.prototype=Yy.prototype;Yy.prototype.tu=function(a,b,c){Fx.prototype.su.call(this,a,b);this.Ve=iw(c)};\nfunction $y(a){if(null===a.Gi&&null===a.Gi){var b=new Ao;if(null===a)throw T(S(),null);b.k=a;a.Gi=b}return a.Gi}function fc(a){null===a.fk&&(a.fk=(new xx).Dc(Bo($y(a))));return a.fk}z({yq:0},!1,\"cats.instances.Function0Instances$$anon$4\",{yq:1,c:1,lp:1,vf:1,uf:1,sf:1,Ne:1,dc:1,e:1,d:1,Hc:1,yc:1,tf:1,rf:1,Gc:1,rp:1,ch:1});function az(){}az.prototype=new A;az.prototype.constructor=az;az.prototype.a=function(){return this};az.prototype.$a=function(a,b){a=!!a;return a===!!b?0:a?1:-1};\naz.prototype.Bc=function(a,b){return!!a===!!b};az.prototype.$classData=z({Jr:0},!1,\"cats.kernel.instances.BooleanOrder\",{Jr:1,c:1,yD:1,Pc:1,Jc:1,zc:1,e:1,d:1,ID:1,PC:1,cD:1,Ic:1,XD:1,lD:1,ae:1,TD:1,Oe:1});function bz(){}bz.prototype=new A;bz.prototype.constructor=bz;bz.prototype.a=function(){return this};bz.prototype.$a=function(a,b){a|=0;b|=0;return ab?1:0};bz.prototype.Bc=function(a,b){return(a|0)===(b|0)};\nbz.prototype.$classData=z({Lr:0},!1,\"cats.kernel.instances.ByteOrder\",{Lr:1,c:1,qD:1,Pc:1,Jc:1,zc:1,e:1,d:1,AD:1,HC:1,VC:1,Ic:1,ZD:1,fD:1,ae:1,ND:1,Oe:1});function cz(){}cz.prototype=new A;cz.prototype.constructor=cz;cz.prototype.a=function(){return this};cz.prototype.$a=function(a,b){a=null===a?0:a.s;b=null===b?0:b.s;return ab?1:0};cz.prototype.Bc=function(a,b){return(null===a?0:a.s)===(null===b?0:b.s)};\ncz.prototype.$classData=z({Mr:0},!1,\"cats.kernel.instances.CharOrder\",{Mr:1,c:1,rD:1,Pc:1,Jc:1,zc:1,e:1,d:1,BD:1,IC:1,WC:1,Ic:1,aE:1,gD:1,ae:1,OD:1,Oe:1});function dz(){}dz.prototype=new A;dz.prototype.constructor=dz;dz.prototype.a=function(){return this};dz.prototype.$a=function(a,b){a|=0;b|=0;return ab?1:0};dz.prototype.Bc=function(a,b){return(a|0)===(b|0)};\ndz.prototype.$classData=z({Wr:0},!1,\"cats.kernel.instances.IntOrder\",{Wr:1,c:1,uD:1,Pc:1,Jc:1,zc:1,e:1,d:1,ED:1,LC:1,ZC:1,Ic:1,tE:1,hD:1,ae:1,PD:1,Oe:1});function ez(){}ez.prototype=new A;ez.prototype.constructor=ez;ez.prototype.a=function(){return this};ez.prototype.$a=function(a,b){var c=Ma(a);a=c.f;c=c.i;var e=Ma(b);b=e.f;e=e.i;a=(new x).g(a,c);c=(new x).g(b,e);b=a.i;e=c.i;(b===e?(-2147483648^a.f)<(-2147483648^c.f):b(-2147483648^c.f):b>e)?1:0);return a};\nez.prototype.Bc=function(a,b){var c=Ma(a);a=c.f;c=c.i;var e=Ma(b);b=e.f;e=e.i;a=(new x).g(a,c);c=(new x).g(b,e);return a.f===c.f&&a.i===c.i};ez.prototype.$classData=z({as:0},!1,\"cats.kernel.instances.LongOrder\",{as:1,c:1,vD:1,Pc:1,Jc:1,zc:1,e:1,d:1,FD:1,MC:1,$C:1,Ic:1,vE:1,iD:1,ae:1,QD:1,Oe:1});function fz(){}fz.prototype=new A;fz.prototype.constructor=fz;fz.prototype.a=function(){return this};fz.prototype.$a=function(a,b){a|=0;b|=0;return ab?1:0};\nfz.prototype.Bc=function(a,b){return(a|0)===(b|0)};fz.prototype.$classData=z({gs:0},!1,\"cats.kernel.instances.ShortOrder\",{gs:1,c:1,wD:1,Pc:1,Jc:1,zc:1,e:1,d:1,GD:1,NC:1,aD:1,Ic:1,GE:1,jD:1,ae:1,RD:1,Oe:1});function gz(){}gz.prototype=new A;gz.prototype.constructor=gz;gz.prototype.a=function(){return this};gz.prototype.$a=function(){return 0};gz.prototype.Bc=function(){return!0};\ngz.prototype.$classData=z({ps:0},!1,\"cats.kernel.instances.UnitOrder\",{ps:1,c:1,xD:1,Pc:1,Jc:1,zc:1,e:1,d:1,HD:1,OC:1,bD:1,Ic:1,XE:1,kD:1,ae:1,SD:1,Oe:1});function yt(a,b){if(0<=b){a=hz(a,b>>6);var c=a.i&(0===(32&b)?0:1<=e)return a.fa().Ca();c=a.fa();a=a.n().substring(b,e);return c.Gb((new Bc).h(a)).Ca()}\nfunction jz(a,b){Fa();var c=a.n();a=F(function(){return function(f){return f instanceof Sk?f.Ro():f}}(a));var e=ch();return Uj(c,b.Kc(a,e.G).Kb(di()))}function kz(){}kz.prototype=new zx;kz.prototype.constructor=kz;function lz(){}d=lz.prototype=kz.prototype;d.w=function(){return this.v().u()};d.ic=function(){return this.v()};d.je=function(a){return Vw(this,a)};d.Wa=function(a){var b=this.v();return mm(b,a)};d.K=function(a){var b=this.v();nm(b,a)};d.oa=function(){return!0};\nd.Mb=function(a){var b=this.v();return qm(b,a)};d.Jl=function(a){return Ww(this,a)};d.Tb=function(a){return Xw(this,a)};d.Ka=function(){return this.v().Ka()};d.tb=function(a,b,c){Yw(this,a,b,c)};var eu=z({Ja:0},!0,\"scala.collection.immutable.Iterable\",{Ja:1,Oa:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,Na:1,aa:1,ha:1,Y:1,ba:1,p:1});function mz(){this.qf=null}mz.prototype=new A;mz.prototype.constructor=mz;d=mz.prototype;d.ni=function(a,b){return fs(a,b,this.qf)};\nd.xh=function(a){gd||(gd=(new fd).a());var b=this.qf;return nc().Oh(b.xh(a),b)};d.io=function(a){ed||(ed=(new cd).a());return ed.Oh(this.qf.xh(a),this.qf)};d.Rk=function(a,b){return cs(a,b,this.qf)};d.$classData=z({Jp:0},!1,\"cats.data.EitherTInstances1$$anon$14\",{Jp:1,c:1,SA:1,dm:1,cm:1,rf:1,sf:1,Ne:1,dc:1,e:1,d:1,Hc:1,yc:1,tf:1,Gc:1,vf:1,uf:1,RA:1,MA:1});function Tl(a){var b=a.Xa;if(Qy(b))return b.x();if(null!==b)return a.Xa.za();throw(new J).j(b);}\nfunction ho(a,b){switch(b){case 0:return a.Xa.U(0);case 1:return fo(a);default:if(0>b||b>=Tl(a))throw(new X).a();var c=a.Xa;if(Qy(c))return c.Tb(b).w();if(null!==c)return a.Xa.U(b);throw(new J).j(c);}}function nz(a,b){if(oz(b)){var c;!(c=a===b)&&(c=!!(a&&a.$classData&&a.$classData.qa.tk)===!!(b&&b.$classData&&b.$classData.qa.tk))&&(2===Tl(b)?(c=b.Xa.U(0),b=fo(b),c=G(H(),a.Xa.U(0),c)?G(H(),fo(a),b):!1):c=!1);a=c}else a=!1;return a}\nfunction pz(a){a=ko(a);qo||(qo=(new po).a());return U(a,\"\",qo.Tn,\"\")+\"\"}function fo(a){var b=a.Xa;if(Qy(b))return b.Tb(1).w();if(null!==b)return a.Xa.U(1);throw(new J).j(b);}function oz(a){return!!(a&&a.$classData&&a.$classData.qa.sk)}function bo(){Yy.call(this);this.nu=wg();this.ou=null}bo.prototype=new Zy;bo.prototype.constructor=bo;function ao(a,b,c,e){Yy.prototype.tu.call(a,b,c,e);a.nu=wg();a.ou=null;return a}\nbo.prototype.$classData=z({Ft:0},!1,\"scalax.collection.immutable.DefaultGraphImpl$NodeBase\",{Ft:1,oH:1,TG:1,KG:1,c:1,Vs:1,jt:1,Oi:1,Pi:1,VG:1,JG:1,e:1,d:1,hm:1,SG:1,XG:1,lH:1,ZG:1,aH:1});function Bc(){this.ob=null}Bc.prototype=new A;Bc.prototype.constructor=Bc;d=Bc.prototype;d.pa=function(){return(new lj).h(this.ob)};d.Yb=function(a,b){Hi(this,a,b)};d.w=function(){return Hx(this)};d.db=function(a){a=65535&(this.ob.charCodeAt(a)|0);return Zj(a)};d.xd=function(a){return Ix(this,a)};\nd.ic=function(){return uw(new tw,this,this.ob.length|0)};d.je=function(a){return Jx(this,a)};d.Sa=function(){return Kx(this)};d.m=function(){return 0===this.na()};d.Pa=function(){return(new lj).h(this.ob)};d.t=function(a){hj();return a instanceof Bc?this.ob===(null===a?null:a.ob):!1};d.Zc=function(a,b,c){return U(this,a,b,c)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return Lx(this,a)};d.n=function(){return this.ob};d.K=function(a){Mx(this,a)};\nd.Sb=function(a){var b=this.ob;return b===a?0:b>>14|0;a=a+(a<<4)|0;return a^(a>>>10|0)};d.eb=function(a){return this.Lf(a,this.kh(a),0)};d.lb=function(){return this};d.Lf=function(){return!1};\nd.wc=function(a){return kA(this,a)};d.Bi=function(){return!0};var xw=z({wi:0},!1,\"scala.collection.immutable.HashSet\",{wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});lA.prototype.$classData=xw;function oA(){}oA.prototype=new bA;oA.prototype.constructor=oA;oA.prototype.a=function(){return this};\noA.prototype.$classData=z({hy:0},!1,\"scala.collection.immutable.ListSet$EmptyListSet$\",{hy:1,fy:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,e:1,d:1});var pA=void 0;function Fw(){pA||(pA=(new oA).a());return pA}function qA(){this.Pl=this.dn=null}qA.prototype=new bA;qA.prototype.constructor=qA;d=qA.prototype;d.Hj=function(){return this.Pl};d.m=function(){return!1};\nd.Hh=function(a){return rA(this,a)?this:cA(this,a)};d.x=function(){a:{var a=this,b=0;for(;;){if(a.m())break a;a=a.Hj();b=1+b|0}}return b};function cA(a,b){var c=new qA;c.dn=b;if(null===a)throw T(S(),null);c.Pl=a;return c}d.eb=function(a){return rA(this,a)};d.Lk=function(){return this.dn};function rA(a,b){for(;;){if(a.m())return!1;if(G(H(),a.Lk(),b))return!0;a=a.Hj()}}d.wc=function(a){return this.Hh(a)};\nd.$classData=z({iy:0},!1,\"scala.collection.immutable.ListSet$Node\",{iy:1,fy:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,e:1,d:1});function sA(){}sA.prototype=new Dz;sA.prototype.constructor=sA;function tA(){}tA.prototype=sA.prototype;sA.prototype.pa=function(){return this};function uA(){}uA.prototype=new mA;uA.prototype.constructor=uA;uA.prototype.a=function(){return this};\nuA.prototype.w=function(){throw(new V).h(\"Empty Set\");};uA.prototype.$classData=z({Sx:0},!1,\"scala.collection.immutable.HashSet$EmptyHashSet$\",{Sx:1,wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});var vA=void 0;function zw(){vA||(vA=(new uA).a());return vA}function cu(){this.te=0;this.fb=null;this.Pg=0}cu.prototype=new mA;cu.prototype.constructor=cu;d=cu.prototype;\nd.Ci=function(a,b,c){var e=1<<(31&(b>>>c|0)),f=oj(Xc(),this.te&(-1+e|0));if(0!==(this.te&e)){e=this.fb.b[f];a=e.Ci(a,b,5+c|0);if(e===a)return this;b=r(D(xw),[this.fb.b.length]);Qr(Sr(),this.fb,0,b,0,this.fb.b.length);b.b[f]=a;return yw(new cu,this.te,b,this.Pg+(a.x()-e.x()|0)|0)}c=r(D(xw),[1+this.fb.b.length|0]);Qr(Sr(),this.fb,0,c,0,f);c.b[f]=nA(a,b);Qr(Sr(),this.fb,f,c,1+f|0,this.fb.b.length-f|0);return yw(new cu,this.te|e,c,1+this.Pg|0)};\nd.K=function(a){for(var b=0;b>>c|0),f=1<>>14|0;a=a+(a<<4)|0;return a^(a>>>10|0)};d.Tc=function(a){return this.rh(a,this.kh(a),0)};\nd.qe=function(a){return SA(this,a)};var Xv=z({vi:0},!1,\"scala.collection.immutable.HashMap\",{vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});MA.prototype.$classData=Xv;function au(){this.Ec=null;this.yb=0}au.prototype=new xA;au.prototype.constructor=au;d=au.prototype;\nd.Ci=function(a,b,c){if(b===this.yb&&G(H(),a,this.Ec))return this;if(b!==this.yb)return ww(Bw(),this.yb,this,b,nA(a,b),c);var e=Fw();c=new UA;a=cA(e,this.Ec).Hh(a);c.yb=b;c.Qf=a;return c};d.K=function(a){a.l(this.Ec)};function nA(a,b){var c=new au;c.Ec=a;c.yb=b;return c}d.x=function(){return 1};d.v=function(){eh();var a=(new cw).Md([this.Ec]);return uw(new tw,a,a.Va.length|0)};d.Lf=function(a,b){return b===this.yb&&G(H(),a,this.Ec)};d.Bi=function(a,b){return a.Lf(this.Ec,this.yb,b)};\nd.$classData=z({Tx:0},!1,\"scala.collection.immutable.HashSet$HashSet1\",{Tx:1,Xx:1,wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});function UA(){this.yb=0;this.Qf=null}UA.prototype=new xA;UA.prototype.constructor=UA;d=UA.prototype;d.Ci=function(a,b,c){b===this.yb?(c=new UA,a=this.Qf.Hh(a),c.yb=b,c.Qf=a,b=c):b=ww(Bw(),this.yb,this,b,nA(a,b),c);return b};\nd.K=function(a){var b=dA(this.Qf);nm(yl(b),a)};d.x=function(){return this.Qf.x()};d.v=function(){var a=dA(this.Qf);return yl(a)};d.Lf=function(a,b){return b===this.yb&&this.Qf.eb(a)};d.Bi=function(a,b){var c=dA(this.Qf);c=yl(c);for(var e=!0;e&&c.r();)e=c.u(),e=a.Lf(e,this.yb,b);return e};\nd.$classData=z({Ux:0},!1,\"scala.collection.immutable.HashSet$HashSetCollision1\",{Ux:1,Xx:1,wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});function VA(){}VA.prototype=new zA;VA.prototype.constructor=VA;VA.prototype.a=function(){return this};\nVA.prototype.$classData=z({dy:0},!1,\"scala.collection.immutable.ListMap$EmptyListMap$\",{dy:1,cy:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1});var WA=void 0;function AA(){WA||(WA=(new VA).a());return WA}function XA(){this.Ql=this.fg=this.Ec=null}XA.prototype=new zA;XA.prototype.constructor=XA;\nfunction YA(a,b){var c=M();for(;;){if(b.m())return Sp(c);if(G(H(),a,b.Eg())){b=b.Tf();for(a=c;!a.m();)c=a.w(),b=BA(b,c.Eg(),c.lf()),a=a.Aa();return b}var e=b.Tf();c=Vb(new N,b,c);b=e}}d=XA.prototype;d.l=function(a){a:{var b=this;for(;;){if(b.m())throw(new V).h(\"key not found: \"+a);if(G(H(),a,b.Eg())){a=b.lf();break a}b=b.Tf()}}return a};d.lf=function(){return this.fg};d.m=function(){return!1};d.Ke=function(a){return this.$g(a)};\nd.x=function(){a:{var a=this,b=0;for(;;){if(a.m())break a;a=a.Tf();b=1+b|0}}return b};d.Eg=function(){return this.Ec};d.$g=function(a){var b=YA(a.Ga(),this);return BA(b,a.Ga(),a.Qa())};d.Nl=function(a,b){var c=YA(a,this);return BA(c,a,b)};d.Tc=function(a){a:{var b=this;for(;;){if(b.m()){a=R();break a}if(G(H(),a,b.Eg())){a=(new Q).j(b.lf());break a}b=b.Tf()}}return a};d.eb=function(a){a:{var b=this;for(;;){if(b.m()){a=!1;break a}if(G(H(),a,b.Eg())){a=!0;break a}b=b.Tf()}}return a};\nfunction BA(a,b,c){var e=new XA;e.Ec=b;e.fg=c;if(null===a)throw T(S(),null);e.Ql=a;return e}d.Tf=function(){return this.Ql};d.qe=function(a){return this.$g(a)};d.$classData=z({ey:0},!1,\"scala.collection.immutable.ListMap$Node\",{ey:1,cy:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1});function cx(){dx.call(this)}cx.prototype=new NA;cx.prototype.constructor=cx;\ncx.prototype.a=function(){dx.prototype.vj.call(this,M(),M());return this};cx.prototype.$classData=z({sy:0},!1,\"scala.collection.immutable.Queue$EmptyQueue$\",{sy:1,xo:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,xi:1,bg:1,Ja:1,Oa:1,Na:1,Jg:1,ti:1,e:1,d:1});var bx=void 0;function ZA(){this.sd=this.xg=this.Xd=0;this.ze=!1;this.tl=this.Lg=0}ZA.prototype=new Dz;ZA.prototype.constructor=ZA;d=ZA.prototype;d.pa=function(){return this};\nd.w=function(){return this.ze?M().pj():this.Xd};d.db=function(a){return $A(this,a)};d.l=function(a){return $A(this,a|0)};d.m=function(){return this.ze};d.Pa=function(){return this};d.t=function(a){if(a instanceof ZA){if(this.ze)return a.ze;if(!a.m()&&this.Xd===a.Xd){var b=aB(this);return b===aB(a)&&(this.Xd===b||this.sd===a.sd)}return!1}return zt(this,a)};function $A(a,b){0>a.Lg&&xq(rh(),a.Xd,a.xg,a.sd);if(0>b||b>=a.Lg)throw(new X).h(\"\"+b);return a.Xd+n(a.sd,b)|0}\nd.Mf=function(a,b,c){this.Xd=a;this.xg=b;this.sd=c;this.ze=a>b&&0c||a===b;if(0===c)throw(new Bb).h(\"step cannot be 0.\");if(this.ze)a=0;else{var e=bB(this);a=e.f;var f=e.i,g=this.sd,h=g>>31;e=y();a=uf(e,a,f,g,h);e=e.M;g=cB(this)?0:1;f=g>>31;g=a+g|0;e=(new x).g(g,(-2147483648^g)<(-2147483648^a)?1+(e+f|0)|0:e+f|0);a=e.f;e=e.i;a=(0===e?-1<(-2147483648^a):0>31,a=gg(y(),a,e,c,f),b=0!==\na?b-a|0:b-c|0}this.tl=b;return this};d.Ra=function(){return cm()};d.n=function(){var a=1===this.sd?\"\":\" by \"+this.sd;return(this.ze?\"empty \":cB(this)?\"\":\"inexact \")+\"Range \"+this.Xd+\" until \"+this.xg+a};d.K=function(a){if(!this.ze)for(var b=this.Xd;;){a.l(b);if(b===this.tl)break;b=b+this.sd|0}};d.x=function(){return this.na()};d.ib=function(){return Dx(this)};d.v=function(){return uw(new tw,this,this.na())};d.na=function(){return 0>this.Lg?xq(rh(),this.Xd,this.xg,this.sd):this.Lg};d.gc=function(){return this.na()};\nfunction cB(a){var b=bB(a),c=b.f;b=b.i;var e=a.sd,f=e>>31;a=y();c=gg(a,c,b,e,f);b=a.M;return 0===c&&0===b}d.Tb=function(a){0>=a||this.ze?a=this:a>=this.Lg&&0<=this.Lg?(a=this.xg,a=(new ZA).Mf(a,a,this.sd)):(a=this.Xd+n(this.sd,a)|0,a=(new ZA).Mf(a,this.xg,this.sd));return a};function aB(a){return a.ze?(a=M(),Sp(a)|0):a.tl}d.z=function(){return jm(this)};function bB(a){var b=a.xg,c=b>>31,e=a.Xd;a=e>>31;e=b-e|0;return(new x).g(e,(-2147483648^e)>(-2147483648^b)?-1+(c-a|0)|0:c-a|0)}\nd.$classData=z({ty:0},!1,\"scala.collection.immutable.Range\",{ty:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,wo:1,bg:1,Ja:1,Oa:1,Na:1,yh:1,Yf:1,nd:1,e:1,d:1});function dB(){}dB.prototype=new Dz;dB.prototype.constructor=dB;function eB(){}d=eB.prototype=dB.prototype;d.pa=function(){return this};d.xd=function(a){return 0>a?1:Oy(this,a)};d.je=function(a){return Rx(this,a)};d.l=function(a){return Qx(this,a|0)};d.Pa=function(){return this};\nd.Qk=function(a,b){if(b.Qe(this)instanceof qv){if(this.m())a=zm();else{b=(new ie).j(this);for(var c=a.l(b.o.w()).Ka();!b.o.m()&&c.m();)b.o=b.o.Aa(),b.o.m()||(c=a.l(b.o.w()).Ka());a=b.o.m()?(lh(),zm()):fB(c,Ob(function(e,f,g){return function(){return f.o.Aa().Qk(g,(lh(),(new zq).a()))}}(this,b,a)))}return a}return ev(this,a,b)};d.t=function(a){return this===a||zt(this,a)};d.bn=function(a){return gB(this,a)};d.Pb=function(a){return this.Zc(\"\",a,\"\")};\nd.Zc=function(a,b,c){var e=this,f=this;for(e.m()||(e=e.Aa());f!==e&&!e.m();){e=e.Aa();if(e.m())break;e=e.Aa();if(e===f)break;f=f.Aa()}return U(this,a,b,c)};d.Wa=function(a){return Sx(this,a)};d.Ra=function(){return lh()};d.n=function(){return U(this,\"Stream(\",\", \",\")\")};d.K=function(a){var b=this;a:for(;;){if(!b.m()){a.l(b.w());b=b.Aa();continue a}break}};d.v=function(){return Xt(this)};d.Mb=function(a){return Tx(this,a)};d.na=function(){for(var a=0,b=this;!b.m();)a=1+a|0,b=b.Aa();return a};\nd.Jl=function(a){return hB(this,a)};d.Ka=function(){return this};d.Tb=function(a){return gB(this,a)};function gB(a,b){for(;;){if(0>=b||a.m())return a;a=a.Aa();b=-1+b|0}}\nd.Hb=function(a,b,c,e){Pi(a,b);if(!this.m()){Qi(a,this.w());b=this;if(b.kf()){var f=this.Aa();if(f.m())return Pi(a,e),a;if(b!==f&&(b=f,f.kf()))for(f=f.Aa();b!==f&&f.kf();)Qi(Pi(a,c),b.w()),b=b.Aa(),f=f.Aa(),f.kf()&&(f=f.Aa());if(f.kf()){for(var g=this,h=0;g!==f;)g=g.Aa(),f=f.Aa(),h=1+h|0;b===f&&0=b||a.m())return lh(),zm();if(1===b)return b=a.w(),xm(new ym,b,Ob(function(){return function(){lh();return zm()}}(a)));var c=a.w();return xm(new ym,c,Ob(function(e,f){return function(){return hB(e.Aa(),-1+f|0)}}(a,b)))}\nfunction fB(a,b){if(a.m())return Sd(b).Ka();var c=a.w();return xm(new ym,c,Ob(function(e,f){return function(){return fB(e.Aa(),f)}}(a,b)))}d.Fb=function(){return\"Stream\"};function iB(a,b){if(b>=a.Eb)throw(new X).h(\"\"+b);return a.Va.b[b]}\nfunction jB(a,b){var c=a.Va.b.length,e=c>>31,f=b>>31;if(f===e?(-2147483648^b)>(-2147483648^c):f>e){f=c<<1;for(c=c>>>31|0|e<<1;;){e=b>>31;var g=f,h=c;if(e===h?(-2147483648^b)>(-2147483648^g):e>h)c=f>>>31|0|c<<1,f<<=1;else break}b=c;if(0===b?-1<(-2147483648^f):0>24&&0===(1&a.q)<<24>>24&&(a.wm=(new Gv).a(),a.q=(1|a.q)<<24>>24);return a.wm}d.ic=function(){return tz(this)};\nd.l=function(a){a:{if(a&&a.$classData&&a.$classData.qa.vk){if(to(a)){var b=this.rd;a=co(Sl(this),a);a=vz(this,a);b=Nz(b,a);break a}throw(new J).j(a);}if(a&&a.$classData&&a.$classData.qa.Oi){if(so(a)){b=this.ac;if(this!==a.k){a=a.E;var c=this.rg.Pe;a=ao(new bo,this,a,c)}b=null!==uj(b.Za,a);break a}if(ro(a)){b=this.rd;this!==a.ra.Xa.U(0).k&&(a=vr(a),a=co(Sl(this),a),a=vz(this,a));b=Nz(b,a);break a}}throw(new J).j(a);}return b};d.Sa=function(){var a=L().G;return O(this,a)};\nd.m=function(){return 0===this.x()};d.Pa=function(){return this};d.t=function(a){return qz(this,a)};function os(a,b,c,e){var f=new kB;f.ug=c;f.rg=e;Ul(f);f.xn=tg(w(uz),f.ug.Ub());f.zn=!tg(w(Wz),f.ug.Ub());f.yu=tg(w(kb),f.ug.Ub());f.yx=wo();f.xx=wo();f.zx=new uo;Ou();f.ac=(new Oz).sj(f);f.rd=(new Xz).sj(f);Ez(f.ac,a);Yz(f.rd,b);return f}d.Pb=function(a){return U(this,\"\",a,\"\")};d.Zc=function(a,b,c){return U(this,a,b,c)};d.Wa=function(a){var b=tz(this);return mm(b,a)};\nd.n=function(){if(100>=Mi(this)){var a=Xn().gj,b=Xn().gj;var c=Xn().gj;0===(2&this.q)<<24>>24&&0===(2&this.q)<<24>>24&&(this.Om=Il(this),this.q=(2|this.q)<<24>>24);var e=this.Om;0===(4&this.q)<<24>>24&&0===(4&this.q)<<24>>24&&(this.Nm=Nl(this),this.q=(4|this.q)<<24>>24);var f=this.Nm;var g=this.ac,h=L().G;g=O(g,h);a=Bx(g,e).Pb(a);e=this.rd;g=L().G;e=O(e,g);b=Bx(e,f).Pb(b);c=\"Graph(\"+(\"\"+a+(0<(a.length|0)&&0<(b.length|0)?c:\"\")+b)+\")\"}else c=fv(this);return c};d.Ra=function(){return ic()};\nd.K=function(a){var b=tz(this);nm(b,a)};d.jf=function(a){var b=tz(this);return mm(b,a)};d.x=function(){return Mi(this)};d.ib=function(){return Py(this)};d.oa=function(){return!0};d.v=function(){return tz(this)};d.Mb=function(a){var b=tz(this);return qm(b,a)};function lB(a,b){var c=a.rd;var e=Sl(a);var f=co(Sl(a),b);e=vz(e.k,f);if(Nz(c,e))return a;c=rz(a.ac);e=sz(a.rd);b=Py(e).Di(b);return os(c,b,a.ug,a.rg)}d.gc=function(){return-1};\nfunction Ol(a){null===a.Ii&&null===a.Ii&&(a.Ii=(new lo).Ze(a));return a.Ii}d.Ka=function(){return tz(this).Ka()};d.Tb=function(a){return Xw(this,a)};d.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};function Sl(a){null===a.Hi&&null===a.Hi&&(a.Hi=(new Yn).Ze(a));return a.Hi}d.lb=function(){var a=Fp();a=jc(a);return O(this,a)};d.ad=function(){return this};d.tb=function(a,b,c){Yw(this,a,b,c)};d.fc=function(){return!0};d.z=function(){var a=vi();return yi(a,this,a.cg)};\nd.Qb=function(){for(var a=Mp(new Np,eo()),b=tz(this);b.r();){var c=b.u();Op(a,c)}};d.Kc=function(a,b){return hv(this,a,b)};d.Kb=function(a){return Ri(this,a)};d.Rb=function(a){return jb(this,a)};function Jl(a){null===a.Xi&&null===a.Xi&&(a.Xi=(new oo).Ze(a));return a.Xi}\nd.wc=function(a){a:{if(a&&a.$classData&&a.$classData.qa.vk){if(to(a)){a=lB(this,a);break a}throw(new J).j(a);}if(a&&a.$classData&&a.$classData.qa.Oi){if(so(a)){a=a.E;var b=this.ac,c=no(Bz(this),a);null!==uj(b.Za,c)?a=this:(b=rz(this.ac),a=Py(b).Di(a),b=sz(this.rd),a=os(a,b,this.ug,this.rg));break a}if(ro(a)){a=vr(a);a=lB(this,a);break a}}throw(new J).j(a);}return a};function Bz(a){null===a.Wi&&null===a.Wi&&(a.Wi=(new mo).Ze(a));return a.Wi}d.fa=function(){return rs(Ou(),this.ug,this.rg)};d.Fb=function(){return\"Graph\"};\nd.$classData=z({Dt:0},!1,\"scalax.collection.immutable.DefaultGraphImpl\",{Dt:1,c:1,pH:1,Ns:1,Wb:1,P:1,aa:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,ha:1,Y:1,ba:1,p:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,QG:1,WG:1,GG:1,e:1,d:1,NG:1,nH:1,jH:1,YG:1,bH:1,$G:1});function Co(){this.Me=this.Vl=0;this.vl=null;this.Sg=0;this.Dd=null}Co.prototype=new A;Co.prototype.constructor=Co;d=Co.prototype;d.pa=function(){return this};d.Yb=function(a,b){Hi(this,a,b)};\nfunction Do(a,b,c){b=null===b?pb().Ee:b;var e=a.Dd,f=e.b.length;pb();var g=Ia(b);f=qb(a,b,((g<<1)-(g<<8)|0)&(-1+f|0),f);if(0>f){f=~f;e.b[f]=b;e.b[1+f|0]=c;a.Me=1+a.Me|0;if(a.Me>=a.Sg)if(c=a.Dd,b=c.b.length,e=b<<1,1073741824===b){if(536870911===a.Sg)throw(new am).h(\"Capacity exhausted.\");a.Sg=536870911}else if(ba?a=8:536870912a?a=536870912:(Ti||(Ti=(new Si).a()),a=Ti.Gj(a));var b=a<<1;a=b/3|0;b=r(D(C),[b]);this.vl=(new K).Q(a,b);this.Sg=this.vl.bk();this.Dd=this.vl.Qa();return this};function mB(a,b){Do(a,b.Ga(),b.Qa());return a}d.gc=function(){return-1};d.Dc=function(a){Co.prototype.ua.call(this,32);this.Sg=a.Sg;this.Dd=a.Dd.mu();this.Me=a.Me;return this};d.Tc=function(a){up();a=Qz(this,a);return sp(0,a)};\nd.Ka=function(){var a=(new Es).Dc(this);return rm(a)};d.Tb=function(a){return Xw(this,a)};d.Hb=function(a,b,c,e){return Ty(this,a,b,c,e)};function nB(a){return Od(function(){return function(b,c){c|=0;var e=b.b[c];e=e===pb().Ee?pb().Ee:e;return Ia(e)^Ia(b.b[1+c|0])}}(a))}d.lb=function(){var a=Fp();a=jc(a);return O(this,a)};d.ad=function(){return this};d.Ta=function(a){return mB(this,a)};d.hc=function(){};d.tb=function(a,b,c){Yw(this,a,b,c)};d.fc=function(){return!0};\nd.z=function(){var a=this.Dd,b=(new Ds).ei(this),c;for(c=0;b.r();){var e=Ar(b);c=(c|0)+(de(nB(this),a,e)|0)|0}return c|0};d.Qb=function(){for(var a=Mp(new Np,eo()),b=(new Es).Dc(this);b.r();){var c=Fs(b);Op(a,c)}};d.Kc=function(a,b){return hv(this,a,b)};d.Kb=function(a){return Ri(this,a)};d.Rb=function(a){return nt(this,a)};d.qe=function(a){return mB((new Co).Dc(this),a)};d.fa=function(){return(new Co).ua(32)};d.Gb=function(a){return Zi(this,a)};d.Fb=function(){return\"Map\"};\nfunction Qz(a,b){b=null===b?pb().Ee:b;var c=a.Dd.b.length;pb();var e=Ia(b);b=qb(a,b,((e<<1)-(e<<8)|0)&(-1+c|0),c);return 0>b?null:a.Dd.b[1+b|0]}d.$classData=z({Pt:0},!1,\"scalax.collection.mutable.EqHashMap\",{Pt:1,c:1,$H:1,gf:1,hf:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,ef:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,aI:1,tc:1,sc:1,rc:1,ag:1,ff:1,df:1,Ae:1,Mt:1});function oB(){}oB.prototype=new QA;oB.prototype.constructor=oB;oB.prototype.a=function(){return this};\noB.prototype.w=function(){throw(new V).h(\"Empty Map\");};oB.prototype.$classData=z({Lx:0},!1,\"scala.collection.immutable.HashMap$EmptyHashMap$\",{Lx:1,vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});var pB=void 0;function TA(){pB||(pB=(new oB).a());return pB}function $t(){this.Ec=null;this.yb=0;this.Dj=this.fg=null}$t.prototype=new QA;$t.prototype.constructor=$t;\nfunction mv(a){null===a.Dj&&(a.Dj=(new K).Q(a.Ec,a.fg));return a.Dj}function RA(a,b,c,e){var f=new $t;f.Ec=a;f.yb=b;f.fg=c;f.Dj=e;return f}d=$t.prototype;d.Fh=function(a,b,c,e,f,g){if(b===this.yb&&G(H(),a,this.Ec)){if(null===g)return this.fg===e?this:RA(a,b,e,f);a=g.ym(mv(this),null!==f?f:(new K).Q(a,e));return RA(a.Ga(),b,a.Qa(),a)}if(b!==this.yb)return a=RA(a,b,e,f),Wv(Zv(),this.yb,this,b,a,c,2);c=AA();return qB(new rB,b,BA(c,this.Ec,this.fg).Nl(a,e))};\nd.rh=function(a,b){return b===this.yb&&G(H(),a,this.Ec)?(new Q).j(this.fg):R()};d.K=function(a){a.l(mv(this))};d.v=function(){eh();var a=[mv(this)];a=(new cw).Md(a);return uw(new tw,a,a.Va.length|0)};d.x=function(){return 1};d.$classData=z({Mx:0},!1,\"scala.collection.immutable.HashMap$HashMap1\",{Mx:1,vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});\nfunction rB(){this.yb=0;this.Ce=null}rB.prototype=new QA;rB.prototype.constructor=rB;d=rB.prototype;d.Fh=function(a,b,c,e,f,g){if(b===this.yb)return null!==g&&this.Ce.eb(a)?qB(new rB,b,this.Ce.$g(g.ym((new K).Q(a,this.Ce.l(a)),f))):qB(new rB,b,this.Ce.Nl(a,e));a=RA(a,b,e,f);return Wv(Zv(),this.yb,this,b,a,c,1+this.Ce.x()|0)};d.rh=function(a,b){return b===this.yb?this.Ce.Tc(a):R()};d.K=function(a){var b=CA(this.Ce);nm(yl(b),a)};d.v=function(){var a=CA(this.Ce);return yl(a)};d.x=function(){return this.Ce.x()};\nfunction qB(a,b,c){a.yb=b;a.Ce=c;return a}d.$classData=z({Nx:0},!1,\"scala.collection.immutable.HashMap$HashMapCollision1\",{Nx:1,vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});function bu(){this.zf=0;this.Sc=null;this.Eb=0}bu.prototype=new QA;bu.prototype.constructor=bu;d=bu.prototype;\nd.Fh=function(a,b,c,e,f,g){var h=1<<(31&(b>>>c|0)),k=oj(Xc(),this.zf&(-1+h|0));if(0!==(this.zf&h)){h=this.Sc.b[k];a=h.Fh(a,b,5+c|0,e,f,g);if(a===h)return this;b=r(D(Xv),[this.Sc.b.length]);Qr(Sr(),this.Sc,0,b,0,this.Sc.b.length);b.b[k]=a;return Yv(this.zf,b,this.Eb+(a.x()-h.x()|0)|0)}c=r(D(Xv),[1+this.Sc.b.length|0]);Qr(Sr(),this.Sc,0,c,0,k);c.b[k]=RA(a,b,e,f);Qr(Sr(),this.Sc,k,c,1+k|0,this.Sc.b.length-k|0);return Yv(this.zf|h,c,1+this.Eb|0)};\nd.rh=function(a,b,c){var e=31&(b>>>c|0);if(-1===this.zf)return this.Sc.b[e].rh(a,b,5+c|0);e=1<a?1:Oy(this,a)};d.l=function(a){return Qx(this,a|0)};d.je=function(a){return Rx(this,a)};\nd.Sa=function(){return this};d.Pa=function(){return this};d.Qk=function(a,b){if(b===L().G){if(this===M())return M();b=this;for(var c=(new Oi).$e(!1),e=(new ie).j(null),f=(new ie).j(null);b!==M();)a.l(b.w()).pa().K(F(function(g,h,k,m){return function(p){h.o?(p=Vb(new N,p,M()),m.o.uc=p,m.o=p):(k.o=Vb(new N,p,M()),m.o=k.o,h.o=!0)}}(this,c,e,f))),b=b.cb();return c.o?e.o:M()}return ev(this,a,b)};d.bn=function(a){return tB(this,a)};d.Wa=function(a){return Sx(this,a)};d.Ra=function(){return L()};\nd.K=function(a){for(var b=this;!b.m();)a.l(b.w()),b=b.cb()};d.v=function(){return yl(this)};function tB(a,b){for(;!a.m()&&0=a)a=M();else{for(var b=Vb(new N,this.w(),M()),c=b,e=this.cb(),f=1;;){if(e.m()){a=this;break a}if(f>>25|0)]=a.gb();a.gb().b[31&(b>>>20|0)]=a.ta();a.ta().b[31&(b>>>15|0)]=a.X();a.X().b[31&(b>>>10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 4:a.Qc(I(a.gb()));a.Ib(I(a.ta()));a.ab(I(a.X()));a.xa(I(a.L()));a.gb().b[31&(b>>>20|0)]=a.ta();a.ta().b[31&(b>>>15|0)]=a.X();a.X().b[31&(b>>>\n10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 3:a.Ib(I(a.ta()));a.ab(I(a.X()));a.xa(I(a.L()));a.ta().b[31&(b>>>15|0)]=a.X();a.X().b[31&(b>>>10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 2:a.ab(I(a.X()));a.xa(I(a.L()));a.X().b[31&(b>>>10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 1:a.xa(I(a.L()));a.L().b[31&(b>>>5|0)]=a.mb();break;case 0:break;default:throw(new J).j(c);}}1=a)a=this;else if(this.dg<(this.yg-a|0)){var b=this.dg+a|0,c=-32&b,e=NB(b^(-1+this.yg|0)),f=b&~(-1+(1<h)a.La(I(a.mb()));else if(1024>h)a.xa(I(a.L())),a.L().b[31&(g>>>5|0)]=a.mb(),a.La(Db(a.L(),31&(c>>>5|0)));else if(32768>h)a.xa(I(a.L())),a.ab(I(a.X())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),\n31&(c>>>5|0)));else if(1048576>h)a.xa(I(a.L())),a.ab(I(a.X())),a.Ib(I(a.ta())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.ta().b[31&(g>>>15|0)]=a.X(),a.ab(Db(a.ta(),31&(c>>>15|0))),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),31&(c>>>5|0)));else if(33554432>h)a.xa(I(a.L())),a.ab(I(a.X())),a.Ib(I(a.ta())),a.Qc(I(a.gb())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.ta().b[31&(g>>>15|0)]=a.X(),a.gb().b[31&(g>>>20|0)]=a.ta(),a.Ib(Db(a.gb(),31&(c>>>20|0))),a.ab(Db(a.ta(),\n31&(c>>>15|0))),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),31&(c>>>5|0)));else if(1073741824>h)a.xa(I(a.L())),a.ab(I(a.X())),a.Ib(I(a.ta())),a.Qc(I(a.gb())),a.tg(I(a.Rc())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.ta().b[31&(g>>>15|0)]=a.X(),a.gb().b[31&(g>>>20|0)]=a.ta(),a.Rc().b[31&(g>>>25|0)]=a.gb(),a.Qc(Db(a.Rc(),31&(c>>>25|0))),a.Ib(Db(a.gb(),31&(c>>>20|0))),a.ab(Db(a.ta(),31&(c>>>15|0))),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),31&(c>>>5|0)));else throw(new Bb).a();}else{g=\n-1+a.kd()|0;switch(g){case 5:a.tg(I(a.Rc()));a.Qc(Db(a.Rc(),31&(c>>>25|0)));a.Ib(Db(a.gb(),31&(c>>>20|0)));a.ab(Db(a.ta(),31&(c>>>15|0)));a.xa(Db(a.X(),31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 4:a.Qc(I(a.gb()));a.Ib(Db(a.gb(),31&(c>>>20|0)));a.ab(Db(a.ta(),31&(c>>>15|0)));a.xa(Db(a.X(),31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 3:a.Ib(I(a.ta()));a.ab(Db(a.ta(),31&(c>>>15|0)));a.xa(Db(a.X(),31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 2:a.ab(I(a.X()));a.xa(Db(a.X(),\n31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 1:a.xa(I(a.L()));a.La(Db(a.L(),31&(c>>>5|0)));break;case 0:a.La(I(a.mb()));break;default:throw(new J).j(g);}a.nh=!0}a.$h=e;c=-1+e|0;switch(c){case 0:a.td=null;a.Id=null;a.de=null;a.ye=null;a.Ue=null;break;case 1:a.Id=null;a.de=null;a.ye=null;a.Ue=null;break;case 2:a.de=null;a.ye=null;a.Ue=null;break;case 3:a.ye=null;a.Ue=null;break;case 4:a.Ue=null;break;case 5:break;default:throw(new J).j(c);}b=b-f|0;if(32>b)OB(a.Ff,b);else if(1024>b)OB(a.Ff,\n31&b),a.td=PB(a.td,b>>>5|0);else if(32768>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,b>>>10|0);else if(1048576>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,31&(b>>>10|0)),a.de=PB(a.de,b>>>15|0);else if(33554432>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,31&(b>>>10|0)),a.de=PB(a.de,31&(b>>>15|0)),a.ye=PB(a.ye,b>>>20|0);else if(1073741824>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,31&(b>>>10|0)),a.de=PB(a.de,31&(b>>>15|0)),a.ye=PB(a.ye,31&(b>>>20|0)),\na.Ue=PB(a.Ue,b>>>25|0);else throw(new Bb).a();}else a=oh().Vi;return a};d.Rc=function(){return this.Ue};function NB(a){if(32>a)return 1;if(1024>a)return 2;if(32768>a)return 3;if(1048576>a)return 4;if(33554432>a)return 5;if(1073741824>a)return 6;throw(new Bb).a();}function OB(a,b){for(var c=0;cb?0:b;if(c<=b||b>=(a.Oc.length|0))return(new lj).h(\"\");c=c>(a.Oc.length|0)?a.Oc.length|0:c;Cc();return(new lj).h((null!==a?a.Oc:null).substring(b,c))}d.fa=function(){mj||(mj=(new ij).a());return mj.fa()};d.$classData=z({Ty:0},!1,\"scala.collection.immutable.WrappedString\",{Ty:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,wo:1,bg:1,Ja:1,Oa:1,Na:1,yh:1,Yf:1,yo:1,Tj:1,Rd:1,bb:1});\nfunction N(){this.uc=this.th=null}N.prototype=new sB;N.prototype.constructor=N;d=N.prototype;d.Ba=function(){return\"::\"};d.w=function(){return this.th};d.za=function(){return 2};d.m=function(){return!1};d.cb=function(){return this.uc};d.U=function(a){switch(a){case 0:return this.th;case 1:return this.uc;default:throw(new X).h(\"\"+a);}};d.Aa=function(){return this.uc};function Vb(a,b,c){a.th=b;a.uc=c;return a}\nd.$classData=z({Gx:0},!1,\"scala.collection.immutable.$colon$colon\",{Gx:1,$x:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,xi:1,bg:1,Ja:1,Oa:1,Na:1,Jg:1,ti:1,Ia:1,sl:1,e:1,d:1});function RB(){}RB.prototype=new sB;RB.prototype.constructor=RB;d=RB.prototype;d.a=function(){return this};d.w=function(){this.pj()};d.Ba=function(){return\"Nil\"};d.za=function(){return 0};d.cb=function(){throw(new Pc).h(\"tail of empty list\");};d.m=function(){return!0};\nd.t=function(a){return a&&a.$classData&&a.$classData.qa.dd?a.m():!1};d.U=function(a){throw(new X).h(\"\"+a);};d.pj=function(){throw(new V).h(\"head of empty list\");};d.Aa=function(){return this.cb()};d.$classData=z({qy:0},!1,\"scala.collection.immutable.Nil$\",{qy:1,$x:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,xi:1,bg:1,Ja:1,Oa:1,Na:1,Jg:1,ti:1,Ia:1,sl:1,e:1,d:1});var SB=void 0;function M(){SB||(SB=(new RB).a());return SB}\nfunction TB(){}TB.prototype=new zz;TB.prototype.constructor=TB;function UB(){}d=UB.prototype=TB.prototype;d.pa=function(){return this};d.m=function(){return 0===this.x()};d.t=function(a){return dv(this,a)};d.Ra=function(){xv||(xv=(new vv).a());return xv};d.n=function(){return fv(this)};d.jf=function(a){var b=this.v();return mm(b,a)};d.ib=function(){return Py(this)};d.ed=function(a,b){Sm(this,a,b)};d.hc=function(){};d.z=function(){var a=vi();return yi(a,this,a.cg)};\nd.Kc=function(a,b){return hv(this,a,b)};d.Rb=function(a){return jb(this,a)};d.Gb=function(a){return Zi(this,a)};d.fa=function(){return this.fe()};d.Fb=function(){return\"Set\"};function VB(){this.qj=null;this.qc=0;this.vd=this.pb=null}VB.prototype=new A;VB.prototype.constructor=VB;d=VB.prototype;d.pa=function(){return this};d.Yb=function(a,b){Hi(this,a,b)};d.w=function(){return this.v().u()};d.ic=function(){return this.v()};d.l=function(a){return this.eb(a)};\nd.Sa=function(){var a=L().G;return O(this,a)};d.m=function(){return 0===this.x()};d.Pa=function(){return this};d.t=function(a){return dv(this,a)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Zc=function(a,b,c){return U(this,a,b,c)};function WB(a,b){Qs(a,b);return a}d.kc=function(a){return WB(this,a)};d.Wa=function(a){var b=this.v();return mm(b,a)};d.n=function(){return fv(this)};d.Ra=function(){return Ls()};\nd.K=function(a){if(null===this.pb)this.vd.K(a);else for(var b=0;b>>1|0,e=e>>>1|0|f<<31,f=g,c=1+c|0;else break}b=1+b|0}};function hz(a,b){return b>6;$B.prototype.zg.call(this,r(D(Xa),[1>6,e=hz(a,c);b=(new x).g(e.f|(0===(32&b)?1<c);if(c>=xt(a)){for(e=xt(a);c>=e;)e<<=1,e=33554432>e?e:33554432;e=r(D(Xa),[e]);Qr(Sr(),a.fb,0,e,0,xt(a));a.fb=e}a.fb.b[c]=b}return a}d.Hb=function(a,b,c,e){Pi(a,b);var f=\"\";b=xt(this)<<6;for(var g=0;g!==b;)yt(this,g)&&(f=Pi(a,f).vc,f.ub+=\"\"+g,f=c),g=1+g|0;return Pi(a,e)};\nd.Em=function(){var a=r(D(Xa),[this.fb.b.length]);Qr(Sr(),this.fb,0,a,0,this.fb.b.length);return(new $B).zg(a)};d.Ta=function(a){return bC(this,a|0)};d.wc=function(a){return this.Fm().Ei(a)};d.Fb=function(){return\"BitSet\"};\nd.$classData=z({Bo:0},!1,\"scala.collection.mutable.BitSet\",{Bo:1,zl:1,xl:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,gf:1,hf:1,ef:1,Wj:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Xj:1,Kg:1,tc:1,sc:1,rc:1,ag:1,ff:1,df:1,Ae:1,nz:1,qo:1,tx:1,Fx:1,ax:1,bx:1,e:1,d:1});function xo(){this.fb=null}xo.prototype=new aC;xo.prototype.constructor=xo;d=xo.prototype;d.zg=function(a){$B.prototype.zg.call(this,a);return this};\nd.n=function(){var a=this.fb;var b=[];for(var c=0,e=a.b.length;c>>0)).toString(2),g=(+(g>>>0)).toString(2),g=h+(\"\"+\"00000000000000000000000000000000\".substring(g.length|0)+g)):g=(+(g>>>0)).toString(2);f=jz(f,(new cw).Md([g]));g=l.String.fromCharCode(32);h=l.String.fromCharCode(48);f=f.split(g).join(h);b.push(null===f?null:f);c=1+c|0}a=ka(D(oa),b);b=(new Li).a();c=!0;Pi(b,\"\");e=0;for(f=a.b.length;ea||a>=this.cf)throw(new X).h(\"\"+a);return Qx(this.sb,a)};d.xd=function(a){return 0>a?1:Oy(this.sb,a)};d.l=function(a){return this.db(a|0)};d.je=function(a){return Rx(this.sb,a)};d.m=function(){return 0===this.cf};d.Sa=function(){this.bi=!this.m();return this.sb};d.Pa=function(){return this};\nd.t=function(a){return a instanceof sn?this.sb.t(a.sb):zt(this,a)};d.Pb=function(a){return U(this.sb,\"\",a,\"\")};d.Zc=function(a,b,c){return U(this.sb,a,b,c)};d.kc=function(a){return pn(this,a)};d.Wa=function(a){return Sx(this.sb,a)};d.Ra=function(){return qn()};d.K=function(a){for(var b=this.sb;!b.m();)a.l(b.w()),b=b.cb()};d.Di=function(a){return pn(this,a)};d.ib=function(){var a=this.sb,b=Qq().G;return O(a,b)};d.x=function(){return this.cf};d.Ca=function(){return this.Sa()};\nd.v=function(){var a=new lu;a.Se=this.m()?M():this.sb;return a};d.ed=function(a,b){Sm(this,a,b)};d.Mb=function(a){return Tx(this.sb,a)};d.na=function(){return this.cf};d.Ka=function(){return this.sb.Ka()};d.Hb=function(a,b,c,e){return Ni(this.sb,a,b,c,e)};function pn(a,b){a.bi&&PA(a);if(a.m())a.Rf=Vb(new N,b,M()),a.sb=a.Rf;else{var c=a.Rf;a.Rf=Vb(new N,b,M());c.uc=a.Rf}a.cf=1+a.cf|0;return a}d.lb=function(){var a=this.sb,b=Fp();b=jc(b);return O(a,b)};d.Ta=function(a){return pn(this,a)};d.hc=function(){};\nd.tb=function(a,b,c){Yw(this.sb,a,b,c)};d.Qb=function(){for(var a=this.sb,b=Mp(new Np,eo());!a.m();){var c=a.w();Op(b,c);a=a.cb()}};d.Kb=function(a){return Ri(this.sb,a)};function Up(a,b){a:for(;;){var c=b;if(null!==c&&c===a){b=Ww(a,a.cf);continue a}return Zi(a,b)}}d.Gb=function(a){return Up(this,a)};d.Fb=function(){return\"ListBuffer\"};\nd.$classData=z({hz:0},!1,\"scala.collection.mutable.ListBuffer\",{hz:1,Ao:1,yl:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,Bl:1,gf:1,hf:1,ef:1,Cl:1,ff:1,df:1,Ae:1,Co:1,Do:1,sc:1,rc:1,ag:1,Kg:1,Da:1,yi:1,tc:1,VH:1,UH:1,WH:1,e:1,d:1});function Li(){this.vc=null}Li.prototype=new tA;Li.prototype.constructor=Li;d=Li.prototype;d.pa=function(){return this};d.a=function(){Li.prototype.ru.call(this);return this};d.w=function(){return Hx(this)};\nd.db=function(a){a=65535&(this.vc.ub.charCodeAt(a)|0);return Zj(a)};d.xd=function(a){return Ix(this,a)};d.l=function(a){a=65535&(this.vc.ub.charCodeAt(a|0)|0);return Zj(a)};d.je=function(a){return Jx(this,a)};d.m=function(){return 0===this.na()};d.Sa=function(){return Kx(this)};d.Pa=function(){return this};d.Lo=function(a,b){return this.vc.ub.substring(a,b)};d.kc=function(a){dC(this,null===a?0:a.s);return this};d.Wa=function(a){return Lx(this,a)};d.Ra=function(){aw||(aw=(new $v).a());return aw};\nd.n=function(){return this.vc.ub};d.K=function(a){Mx(this,a)};d.Sb=function(a){var b=this.vc.ub;return b===a?0:bthis.Eb&&1<=a&&(a=r(D(C),[a]),Ka(this.Va,0,a,0,this.Eb),this.Va=a)};d.z=function(){return jm(this)};d.Gb=function(a){return Ex(this,a)};d.Fb=function(){return\"ArrayBuffer\"};\nd.$classData=z({Vy:0},!1,\"scala.collection.mutable.ArrayBuffer\",{Vy:1,Ao:1,yl:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,Bl:1,gf:1,hf:1,ef:1,Cl:1,ff:1,df:1,Ae:1,Co:1,Do:1,sc:1,rc:1,ag:1,Kg:1,Da:1,fz:1,Go:1,Yf:1,Tj:1,tc:1,bI:1,Fo:1,yh:1,nd:1,e:1,d:1});function eC(){this.dj=null}eC.prototype=new A;eC.prototype.constructor=eC;\neC.prototype.a=function(){fC=this;this.dj=(new dz).a();(new Wy).a();hn();(new Tq).a();(new bz).a();(new Lw).a();hn();(new Tq).a();(new cz).a();hn();(new Tq).a();(new ez).a();(new Xy).a();hn();(new Tq).a();(new fz).a();(new Ow).a();hn();(new Tq).a();(new wx).a();(new Vy).a();hn();(new Tq).a();(new vx).a();(new Uy).a();hn();(new Tq).a();(new az).a();hn();(new Tq).a();(new gz).a();(new Cx).a();hn();(new Tq).a();(new Dv).a();(new Kw).a();hn();(new Tq).a();(new Cv).a();(new Jw).a();hn();(new Tq).a();(new Du).a();\n(new lx).a();(new Pw).a();(new ls).a();hn();(new Tq).a();(new Qw).a();hn();(new Tq).a();hn();(new Tq).a();Bv||(Bv=(new Av).a());su||(su=(new ru).a());wu||(wu=(new vu).a());uu||(uu=(new tu).a());(new mx).a();(new Mw).a();Sq||(Sq=(new Rq).a());(new nx).a();(new Nw).a();Sq||(Sq=(new Rq).a());hn();(new Tq).a();hn();(new Tq).a();return this};\neC.prototype.$classData=z({qq:0},!1,\"cats.implicits$\",{qq:1,c:1,ZE:1,gF:1,jF:1,iF:1,kF:1,wG:1,nF:1,zA:1,mF:1,BA:1,pF:1,Yz:1,oF:1,Xz:1,rF:1,sF:1,nG:1,vF:1,Zz:1,wF:1,$z:1,xF:1,GA:1,AF:1,aA:1,BF:1,cA:1,yF:1,zF:1,CF:1,DF:1,FF:1,HF:1,dA:1,IF:1,eA:1,wA:1,NF:1,fA:1,OF:1,mG:1,PF:1,QF:1,hA:1,RF:1,SF:1,UF:1,VF:1,WF:1,ZF:1,$F:1,gG:1,dG:1,vG:1,hG:1,JA:1,iG:1,oA:1,lG:1,qA:1,pG:1,sA:1,qG:1,LA:1,tG:1,uA:1,YF:1,kA:1,AG:1,CG:1,DG:1,$E:1,yG:1,xA:1,hF:1,uG:1,aF:1,GF:1,uF:1,EA:1,XF:1,qF:1,cG:1,oG:1,zG:1,kG:1,bF:1,eG:1,\nrG:1,vA:1,MF:1,gA:1,EF:1,TF:1,BG:1,cF:1,xG:1,LF:1,dF:1,sG:1,lF:1,aG:1,JF:1,jG:1,KF:1,tF:1,eF:1,bG:1,fF:1,fG:1,cB:1,kB:1,IB:1,uE:1,pB:1,$D:1,qB:1,bE:1,KB:1,wE:1,XB:1,HE:1,xB:1,lE:1,rB:1,cE:1,oB:1,YD:1,uC:1,YE:1,sC:1,mC:1,nC:1,oC:1,pC:1,qC:1,RE:1,SE:1,TE:1,UE:1,mB:1,VD:1,lB:1,UD:1,nB:1,WD:1,tB:1,fE:1,gE:1,hE:1,uB:1,iE:1,rr:1,vB:1,CB:1,mE:1,nE:1,oE:1,pE:1,qE:1,rE:1,yB:1,zB:1,AB:1,BB:1,EB:1,FB:1,GB:1,HB:1,sE:1,eD:1,JB:1,Fq:1,Xr:1,Yr:1,Zr:1,MB:1,xE:1,yE:1,Kq:1,bs:1,cs:1,ds:1,es:1,PB:1,zE:1,xr:1,QB:1,RB:1,\nSB:1,TB:1,AE:1,Ar:1,UB:1,VB:1,BE:1,CE:1,DE:1,WB:1,EE:1,FE:1,YB:1,$B:1,ZB:1,dC:1,eC:1,Wq:1,hs:1,is:1,js:1,hC:1,NE:1,iC:1,PE:1,jC:1,kC:1,lC:1,tC:1,WE:1,br:1,qs:1,rs:1,ss:1,dB:1,DB:1,rC:1,eB:1,Mq:1,Hq:1,dr:1,Yq:1,NB:1,aC:1,fB:1,sB:1,eE:1,wB:1,kE:1,gB:1,rq:1,uq:1,tq:1,hB:1,bC:1,OB:1,iB:1,fC:1,jB:1,gC:1,LB:1,LE:1,ME:1,cC:1,IE:1,KE:1,JE:1});var fC=void 0;function Qb(){fC||(fC=(new eC).a());return fC}\n(function(){var a=sc();ka(D(oa),[]);a=es(gs(fs(cs(lc(a),F(function(){return function(c){Qb();c=oc(sc(),c);zv||(zv=(new yv).a());var e=mc(),f=new mz;f.qf=e;if(c instanceof wc)c=f.xh(c.E);else if(c instanceof Fc)c=f.io(c.E);else throw(new J).j(c);return c}}(a)),mc()),F(function(){return function(c){return Tb(sc(),c)}}(a)),mc()),F(function(){return function(c){return Jb(sc(),c)}}(a))),F(function(){return function(c){throw T(S(),c);}}(a)));var b=Cc().Fl;mc();rl(vl(a.s,F(function(){return function(c){if(c instanceof\nwc||c instanceof Fc)return c.E;throw(new J).j(c);}}(a,b))))})();\n//# sourceMappingURL=abc142-opt.js.map\n", "language": "JavaScript", "metadata": {"date": 1570903816, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/JavaScript/s210784928.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s210784928", "user_id": "u103067756"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "'use strict';\n'use strict';var d,aa=\"object\"===typeof __ScalaJSEnv&&__ScalaJSEnv?__ScalaJSEnv:{},l=\"object\"===typeof aa.global&&aa.global?aa.global:\"object\"===typeof global&&global&&global.Object===Object?global:this;aa.global=l;aa.exportsNamespace=exports;l.Object.freeze(aa);var ba={envInfo:aa,semantics:{asInstanceOfs:2,arrayIndexOutOfBounds:2,moduleInit:2,strictFloats:!1,productionMode:!0},assumingES6:!1,linkerVersion:\"0.6.29\",globalThis:this};l.Object.freeze(ba);l.Object.freeze(ba.semantics);\nvar n=l.Math.imul||function(a,b){var c=a&65535,e=b&65535;return c*e+((a>>>16&65535)*e+c*(b>>>16&65535)<<16>>>0)|0},ca=l.Math.fround||function(a){return+a},da=l.Math.clz32||function(a){if(0===a)return 32;var b=1;0===(a&4294901760)&&(a<<=16,b+=16);0===(a&4278190080)&&(a<<=8,b+=8);0===(a&4026531840)&&(a<<=4,b+=4);0===(a&3221225472)&&(a<<=2,b+=2);return b+(a>>31)},fa=0,ha=l.WeakMap?new l.WeakMap:null;\nfunction ia(a){return function(b,c){return!(!b||!b.$classData||b.$classData.ih!==c||b.$classData.hh!==a)}}function ja(a){for(var b in a)return b}function ka(a,b){return new a.Ik(b)}function r(a,b){return la(a,b,0)}function la(a,b,c){var e=new a.Ik(b[c]);if(ca?-2147483648:a|0}function Ka(a,b,c,e,f){a=a.b;c=c.b;if(a!==c||e>24===a&&1/a!==1/-0}\nfunction sa(a){return\"number\"===typeof a&&a<<16>>16===a&&1/a!==1/-0}function La(a){return\"number\"===typeof a&&(a|0)===a&&1/a!==1/-0}function wa(a){return\"number\"===typeof a}function Ma(a){return null===a?y().mg:a}function Na(){this.Ij=this.Ik=void 0;this.hh=this.Xh=this.qa=null;this.ih=0;this.Ol=null;this.bj=\"\";this.Od=this.$i=this.aj=void 0;this.name=\"\";this.isRawJSType=this.isArrayClass=this.isInterface=this.isPrimitive=!1;this.isInstance=void 0}\nfunction Oa(a,b,c){var e=new Na;e.qa={};e.Xh=null;e.Ol=a;e.bj=b;e.Od=function(){return!1};e.name=c;e.isPrimitive=!0;e.isInstance=function(){return!1};return e}function z(a,b,c,e,f,g,h,k){var m=new Na,p=ja(a);h=h||function(q){return!!(q&&q.$classData&&q.$classData.qa[p])};k=k||function(q,t){return!!(q&&q.$classData&&q.$classData.ih===t&&q.$classData.hh.qa[p])};m.Ij=g;m.qa=e;m.bj=\"L\"+c+\";\";m.Od=k;m.name=c;m.isInterface=b;m.isRawJSType=!!f;m.isInstance=h;return m}\nfunction Pa(a){function b(k){if(\"number\"===typeof k){this.b=Array(k);for(var m=0;ma.Kd?0:b):0:0f)&&G(H(),c.Dd.b[1+f|0],e.Qa());break a;e=void 0}return e}}(a))):!1}function qb(a,b,c,e){for(a=a.Dd;;){var f=a.b[c];if(f===b)return c;if(null===f)return~c;c=2+c|0;c=c>>0)).toString(16);return a+\"@\"+b};rb.prototype.z=function(){return Ia(this)};rb.prototype.toString=function(){return this.n()};function ub(a,b){if(a=a&&a.$classData){var c=a.ih||0;return!(cb||!a.hh.isPrimitive)}return!1}\nvar C=z({c:0},!1,\"java.lang.Object\",{c:1},void 0,void 0,function(a){return null!==a},ub);rb.prototype.$classData=C;function vb(a,b){if(b instanceof wb)return b=null===b?0:b.s,a.yj()&&a.Xc()===b;if(pa(b))return b|=0,a.xj()&&a.Th()===b;if(sa(b))return b|=0,a.Aj()&&a.zi()===b;if(La(b))return b|=0,a.hi()&&a.Xc()===b;if(b instanceof x){var c=Ma(b);b=c.f;c=c.i;a=a.Yc();var e=a.i;return a.f===b&&e===c}return wa(b)?(b=+b,a.Kf()===b):\"number\"===typeof b?(b=+b,a.ee()===b):!1}\nfunction xb(a,b){a=yb(a);if(!a.r())return!b.r();for(var c=zb(a);b.r();)for(var e=b.u();;){var f=e|0,g=c|0;f=f===g?0:ff||!a.r())return!1;f=!0}else f=!1;if(f)c=zb(a);else break}return!0}function I(a){var b=r(D(C),[a.b.length]);Ka(a,0,b,0,a.b.length);return b}\nfunction Ab(a,b,c){if(32>c)return a.mb().b[31&b];if(1024>c)return a.L().b[31&(b>>>5|0)].b[31&b];if(32768>c)return a.X().b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];if(1048576>c)return a.ta().b[31&(b>>>15|0)].b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];if(33554432>c)return a.gb().b[31&(b>>>20|0)].b[31&(b>>>15|0)].b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];if(1073741824>c)return a.Rc().b[31&(b>>>25|0)].b[31&(b>>>20|0)].b[31&(b>>>15|0)].b[31&(b>>>10|0)].b[31&(b>>>5|0)].b[31&b];throw(new Bb).a();}\nfunction Cb(a,b,c){if(!(32>c))if(1024>c)a.La(a.L().b[31&(b>>>5|0)]);else if(32768>c)a.xa(a.X().b[31&(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else if(1048576>c)a.ab(a.ta().b[31&(b>>>15|0)]),a.xa(a.X().b[31&(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else if(33554432>c)a.Ib(a.gb().b[31&(b>>>20|0)]),a.ab(a.ta().b[31&(b>>>15|0)]),a.xa(a.X().b[31&(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else if(1073741824>c)a.Qc(a.Rc().b[31&(b>>>25|0)]),a.Ib(a.gb().b[31&(b>>>20|0)]),a.ab(a.ta().b[31&(b>>>15|0)]),a.xa(a.X().b[31&\n(b>>>10|0)]),a.La(a.L().b[31&(b>>>5|0)]);else throw(new Bb).a();}function Db(a,b){var c=a.b[b];a.b[b]=null;return I(c)}\nfunction Eb(a,b,c){a.Ef(c);c=-1+c|0;switch(c){case -1:break;case 0:a.La(b.mb());break;case 1:a.xa(b.L());a.La(b.mb());break;case 2:a.ab(b.X());a.xa(b.L());a.La(b.mb());break;case 3:a.Ib(b.ta());a.ab(b.X());a.xa(b.L());a.La(b.mb());break;case 4:a.Qc(b.gb());a.Ib(b.ta());a.ab(b.X());a.xa(b.L());a.La(b.mb());break;case 5:a.tg(b.Rc());a.Qc(b.gb());a.Ib(b.ta());a.ab(b.X());a.xa(b.L());a.La(b.mb());break;default:throw(new J).j(c);}}function Fb(a){return null===a?Gb():a}\nfunction Hb(a){return a===Gb()?null:a}function Ib(){}Ib.prototype=new A;Ib.prototype.constructor=Ib;Ib.prototype.a=function(){return this};function Jb(a,b){Kb||(Kb=(new Lb).a());var c=Kb.Io;Mb();return(new Nb).ge(Ob(function(e,f,g){return function(){var h=Pb().Xn;Qb();var k=new Rb;k.la=f;k.Po=g;k=k.Po.Jo(k.la);Sb(h,null===k?\"null\":k);Sb(h,\"\\n\")}}(a,b,c)))}\nfunction Tb(a,b){b.w();b.w();var c=b.cb();b=function(){return function(h){if(null!==h)return(new Ub).af((new K).Q(h.bk(),h.dk()));throw(new J).j(h);}}(a);var e=L().G;if(e===L().G)if(c===M())b=M();else{e=c.w();var f=e=Vb(new N,b(e),M());for(c=c.cb();c!==M();){var g=c.w();g=Vb(new N,b(g),M());f=f.uc=g;c=c.cb()}b=e}else{for(e=Wb(c,e);!c.m();)f=c.w(),e.Ta(b(f)),c=c.cb();b=e.Ca()}c=Xb();e=Yb();mb||(mb=(new Zb).a());b=lb(b,c,e);b=$b(b);a=ac(b,F(function(){return function(h){Qb();var k=new bc;k.Hl=h.ac;\nh=k.na();k=Qb().dj;return cc(dc(h,k),0)}}(a)));a:{for(;a.r();){b=a.u();c=ec(b.ac.Za);for(e=!0;e&&c.r();)e=c.u(),Qb(),f=fc(e),g=L().G,f=O(f,g),f=gc(f),g=Qb().dj,cc(dc(f,g),1)?(Qb(),e=hc(e),f=L().G,e=O(e,f),e=gc(e),f=Qb().dj,e=cc(dc(e,f),1)):e=!1;if(e){a=(new Q).j(b);break a}}a=R()}if(a.m())a=R();else{a=a.Nb().ac;b=ic();b=jc(b);b=Wb(a,b);for(a=ec(a.Za);a.r();)c=a.u(),b.Ta(c.E|0);a=(new Q).j(b.Ca().lb())}return kc(a)}\nfunction lc(a){r(D(oa),[0]);Mb();a=(new Nb).ge(Ob(function(){return function(){return ib.readFileSync(\"/dev/stdin\",\"utf8\")}}(a)));var b=mc();return nc().Oh(a,b)}function oc(a,b){var c=pc();return(new qc).ge(Ob(function(e,f){return function(){return f}}(a,c))).lf().Xe(b)}Ib.prototype.$classData=z({Yo:0},!1,\"atcoder.ABC142F$\",{Yo:1,c:1});var rc=void 0;function sc(){rc||(rc=(new Ib).a());return rc}function tc(){}tc.prototype=new A;tc.prototype.constructor=tc;tc.prototype.a=function(){return this};\nfunction uc(a,b,c){if(M().t(b))return Qb(),c=M(),vc(),(new wc).j(c);if(b instanceof N)return a=b.uc,b=c.Xe(b.th),b instanceof wc?(b=b.E,c=uc(xc(),a,c),c instanceof wc?(new wc).j(Vb(new N,b,c.E)):c):b;throw(new J).j(b);}\nfunction yc(){var a=xc();return(new zc).j(function(){return function(b){if(\"\"===b){Qb();var c=Ac();vc();return(new wc).j(c)}Qb();c=(new Bc).h(\"Cannot convert '\");b=(new Bc).h(b);var e=Cc().Nh;c=Dc(c,b,e);c=(new Bc).h(c);b=(new Bc).h(\"' to HNil\");e=Cc().Nh;c=(new Ec).h(Dc(c,b,e));vc();return(new Fc).j(c)}}(a))}function Gc(a,b){return(new Hc).j(function(c,e){return function(f){xc();f=Ic(Fa(),f,\"\\n\");for(var g=-1+f.b.length|0,h=M();0<=g;)h=Vb(new N,f.b[g],h),g=-1+g|0;return uc(0,h,e)}}(a,b))}\nfunction Jc(a,b,c){return(new Kc).j(function(e,f){return function(g){g=f.Xe(g);return g instanceof wc?(new wc).j(Lc(g.E)):g}}(a,c,b))}\nfunction Mc(a,b,c){return(new Nc).j(function(e,f,g){return function(h){for(var k=(new Bc).h(h),m=k.ob.length|0,p=0;;){if(p>24;vc();(new wc).j(void 0);this.ma=(2|this.ma)<<24>>24;(new od).j(void 0);this.ma=(4|this.ma)<<24>>24;this.ma=(8|this.ma)<<24>>24;return this};ld.prototype.$classData=z({Xp:0},!1,\"cats.effect.internals.Callback$\",{Xp:1,c:1});var md=void 0;function pd(){md||(md=(new ld).a());return md}function qd(){}\nqd.prototype=new A;qd.prototype.constructor=qd;qd.prototype.a=function(){return this};function rd(a,b){if(!b.r())return sd();Mb();return(new td).ge(Ob(function(c,e){return function(){return ud((new vd).bl(e))}}(a,b)))}qd.prototype.$classData=z({Zp:0},!1,\"cats.effect.internals.CancelUtils$\",{Zp:1,c:1});var wd=void 0;function xd(){}xd.prototype=new A;xd.prototype.constructor=xd;function yd(){}yd.prototype=xd.prototype;function zd(){this.Qo=null;this.ma=!1}zd.prototype=new A;\nzd.prototype.constructor=zd;zd.prototype.a=function(){Ad=this;this.Qo=(new Cd).a();this.ma=!0;return this};zd.prototype.$classData=z({bq:0},!1,\"cats.effect.internals.IOConnection$\",{bq:1,c:1});var Ad=void 0;function Dd(){Ad||(Ad=(new zd).a());return Ad}function Ed(){}Ed.prototype=new A;Ed.prototype.constructor=Ed;Ed.prototype.a=function(){return this};Ed.prototype.$classData=z({fq:0},!1,\"cats.effect.internals.IOPlatform$\",{fq:1,c:1});var Fd=void 0;function Gd(){this.Pn=0;this.ma=!1}Gd.prototype=new A;\nGd.prototype.constructor=Gd;function Hd(a,b){if(null!==a)return a;if(null===b)return null;for(;;)return a=Id(b),null===a?null:a}Gd.prototype.a=function(){this.Pn=512;this.ma=!0;return this};function Jd(a,b){if(a instanceof Kd)return a;if(null===b)return null;for(;;){a=Id(b);if(null===a)return null;if(a instanceof Kd)return a}}function Ld(a,b,c,e){return null!==c||null!==e&&!e.m()?Md(new Nd,Od(function(f,g,h,k){return function(m,p){Pd(Qd(),g,m,p,null,h,k)}}(a,b,c,e))):b}\nfunction Rd(a){try{return Sd(a)}catch(c){a=Yc(S(),c);if(null!==a){var b=Td(Ud(),a);if(!b.m())return a=b.Nb(),Vd(a);throw T(S(),a);}throw c;}}\nfunction Pd(a,b,c,e,f,g,h){var k=b;b=g;var m=!1,p=null;for(g=0;;){var q=k;if(q instanceof Wd)k=q.Xb,q=q.Jb,null!==b&&(null===h&&(h=(new Xd).a()),Yd(h,b)),b=q;else if(q instanceof Zd)p=q.yf,m=!0;else if(q instanceof Nb){q=q.Ed;try{p=Sd(q),m=!0,k=null}catch(ea){if(k=Yc(S(),ea),null!==k){q=Td(Ud(),k);if(q.m())throw T(S(),k);k=q.Nb();k=Vd(k)}else throw ea;}}else if(q instanceof td)a:try{k=Sd(q.Ed)}catch(ea){k=Yc(S(),ea);if(null!==k){q=Td(Ud(),k);if(!q.m()){k=q.Nb();k=Vd(k);break a}throw T(S(),k);}throw ea;\n}else if(q instanceof $d){k=q.Gf;b=Jd(b,h);if(null===b){e.l((vc(),(new Fc).j(k)));break}try{var t=b.ml(k)}catch(ea){if(t=Yc(S(),ea),null!==t){b=Td(Ud(),t);if(b.m())throw T(S(),t);t=b.Nb();t=Vd(t)}else throw ea;}b=null;k=t}else if(q instanceof ae)k=q,q=k.Xb,null!==b&&(null===h&&(h=(new Xd).a()),Yd(h,b)),b=k,k=q;else{if(q instanceof Nd){a=q;null===c&&(Dd(),c=(new be).a());null===f&&(f=(new ce).Yk(c,e));e=f;c=b;e.pg=!0;e.Ek=c;e.Fk=h;e.Ml=a.Dh;de(a.vh,e.xe,e);break}if(q instanceof ee){var u=q.Xb;k=q.qi;\nvar v=q.Hg;q=null!==c?c:(Dd(),(new be).a());c=k.l(q);k=u;if(c!==q&&(null!==f&&(f.xe=c),null!==v)){k=new Wd;var B=new fe;B.ll=q;B.Hg=v;k=ge(k,u,B)}}else throw(new J).j(q);}if(m){b=Hd(b,h);if(null===b){vc();e.l((new wc).j(p));break}try{var P=b.l(p)}catch(ea){if(P=Yc(S(),ea),null!==P){b=Td(Ud(),P);if(b.m())throw T(S(),P);P=b.Nb();P=Vd(P)}else throw ea;}m=!1;b=p=null;k=P}g=1+g|0;if(g===a.Pn){if(c.el())break;g=0}}}\nfunction he(a,b){b=(new ie).j(b);var c=(new ie).j(null),e=(new ie).j(null),f=!1,g=null;for(g=null;;){var h=b.o;if(h instanceof Wd){var k=h;h=k.Xb;k=k.Jb;null!==c.o&&(null===e.o&&(e.o=(new Xd).a()),Yd(e.o,c.o));c.o=k;b.o=h}else if(h instanceof Zd)g=h.yf,f=!0;else if(h instanceof Nb){h=h.Ed;try{g=Sd(h),f=!0,b.o=null}catch(q){if(h=Yc(S(),q),null!==h){k=Td(Ud(),h);if(k.m())throw T(S(),h);h=k.Nb();b.o=Vd(h)}else throw q;}}else if(h instanceof td)b.o=Rd(h.Ed);else if(h instanceof $d){h=h.Gf;k=Jd(c.o,e.o);\nif(null===k)return b.o;try{var m=k.ml(h)}catch(q){if(m=Yc(S(),q),null!==m){h=Td(Ud(),m);if(h.m())throw T(S(),m);m=h.Nb();m=Vd(m)}else throw q;}c.o=null;b.o=m}else if(h instanceof ae)k=h.Xb,null!==c.o&&(null===e.o&&(e.o=(new Xd).a()),Yd(e.o,c.o)),c.o=h,b.o=k;else return h instanceof Nd?Ld(a,b.o,c.o,e.o):Md(new Nd,Od(function(q,t,u,v){return function(B,P){Pd(Qd(),t.o,B,P,null,u.o,v.o)}}(a,b,c,e)));if(f){f=Hd(c.o,e.o);if(null===f)return null!==b.o?b.o:(new Zd).j(g);try{var p=f.l(g)}catch(q){if(p=Yc(S(),\nq),null!==p){g=Td(Ud(),p);if(g.m())throw T(S(),p);p=g.Nb();p=Vd(p)}else throw q;}b.o=p;f=!1;g=null;c.o=null}}}Gd.prototype.$classData=z({hq:0},!1,\"cats.effect.internals.IORunLoop$\",{hq:1,c:1});var je=void 0;function Qd(){je||(je=(new Gd).a());return je}function ke(){this.Nn=null;this.q=!1}ke.prototype=new A;ke.prototype.constructor=ke;ke.prototype.a=function(){return this};function nd(){le||(le=(new ke).a());var a=le;a.q||a.q||(a.Nn=me(),a.q=!0);return a.Nn}\nke.prototype.$classData=z({kq:0},!1,\"cats.effect.internals.Logger$\",{kq:1,c:1});var le=void 0;function ne(){this.qg=this.Eh=null;this.Zj=!1;this.ma=0}ne.prototype=new A;ne.prototype.constructor=ne;function oe(a,b){a:for(;;){try{b.Lj()}catch(g){if(b=Yc(S(),g),null!==b){var c=a,e=Id(c.qg);if(null!==e){var f=c.qg;c.qg=(new Xd).a();c.Eh.oh(pe(c,e,f))}Ud();if(b&&b.$classData&&b.$classData.qa.rl)throw T(S(),b);a.Eh.ol(b)}else throw g;}b=Id(a.qg);if(null!==b)continue a;break}}\nne.prototype.al=function(a){this.Eh=a;this.qg=(new Xd).a();this.ma=(1|this.ma)<<24>>24;this.Zj=!1;this.ma=(2|this.ma)<<24>>24;return this};ne.prototype.oh=function(a){if(this.Zj)Yd(this.qg,a);else{this.Zj=!0;try{oe(this,a)}finally{this.Zj=!1}}};ne.prototype.$classData=z({lq:0},!1,\"cats.effect.internals.Trampoline\",{lq:1,c:1});function qe(){this.ln=null;this.ma=!1}qe.prototype=new A;qe.prototype.constructor=qe;qe.prototype.a=function(){re=this;this.ln=(new se).al((new te).a());this.ma=!0;return this};\nfunction ue(){re||(re=(new qe).a());var a=re;if(!a.ma)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/js/src/main/scala/cats/effect/internals/TrampolineEC.scala: 47\");return a.ln}qe.prototype.$classData=z({oq:0},!1,\"cats.effect.internals.TrampolineEC$\",{oq:1,c:1});var re=void 0;function we(){}we.prototype=new A;we.prototype.constructor=we;function xe(){}xe.prototype=we.prototype;function ye(){}ye.prototype=new A;ye.prototype.constructor=ye;function ze(){}\nze.prototype=ye.prototype;function Ae(){this.Bm=null}Ae.prototype=new A;Ae.prototype.constructor=Ae;Ae.prototype.a=function(){Be=this;this.Bm=(new Ce).a();(new De).a();(new Ee).a();(new Ee).a();Fe||(Fe=(new Ge).a());He||(He=(new Ie).a());Je||(Je=(new Ke).a());Le||(Le=(new Ne).a());Oe||(Oe=(new Pe).a());Qe||(Qe=(new Re).a());Se||(Se=(new Te).a());Ue||(Ue=(new Ve).a());return this};Ae.prototype.$classData=z({ts:0},!1,\"cats.package$\",{ts:1,c:1});var Be=void 0;\nfunction We(){Be||(Be=(new Ae).a());return Be}function Xe(){}Xe.prototype=new A;Xe.prototype.constructor=Xe;Xe.prototype.a=function(){return this};Xe.prototype.$classData=z({ws:0},!1,\"cats.syntax.EitherOps$\",{ws:1,c:1});var Ye=void 0;function Ze(){this.gn=this.Mn=null}Ze.prototype=new A;Ze.prototype.constructor=Ze;function dc(a,b){var c=new Ze;c.Mn=a;c.gn=b;return c}function cc(a,b){We();return a.gn.Bc(a.Mn,b)}Ze.prototype.$classData=z({xs:0},!1,\"cats.syntax.EqOps\",{xs:1,c:1});\nfunction $e(){this.Kj=this.Jj=null}$e.prototype=new A;$e.prototype.constructor=$e;function af(a){return ka(D(bf),[a.Jj,a.Kj])}function cf(a,b,c){a.Jj=b;a.Kj=c;return a}$e.prototype.$classData=z({Ds:0},!1,\"java.math.BigInteger$QuotAndRem\",{Ds:1,c:1});function df(){}df.prototype=new A;df.prototype.constructor=df;df.prototype.a=function(){return this};function ef(a,b,c,e){for(var f=a=0;f>>31|0;f=1+f|0}0!==a&&(b.b[e]=a)}\nfunction ff(a,b,c){a=c>>5;c&=31;var e=(b.ga+a|0)+(0===c?0:1)|0,f=r(D(E),[e]);gf(0,f,b.H,a,c);b=hf(b.N,e,f);jf(b);return b}function kf(a,b,c){a=c>>5;var e=31&c;if(a>=b.ga)return 0>b.N?lf().Si:lf().be;c=b.ga-a|0;var f=r(D(E),[1+c|0]);mf(0,f,c,b.H,a,e);if(0>b.N){for(var g=0;gb.N&&of(b)===(-1+b.ga|0)&&(c=-1+c|0);return a=a-da(c)|0}function mf(a,b,c,e,f,g){for(a=0;a>>g|0|e.b[1+(a+f|0)|0]<>>g|0}}\nfunction gf(a,b,c,e,f){if(0===f)Ka(c,0,b,e,b.b.length-e|0);else{a=32-f|0;b.b[-1+b.b.length|0]=0;for(var g=-1+b.b.length|0;g>e;){var h=g;b.b[h]=b.b[h]|c.b[-1+(g-e|0)|0]>>>a|0;b.b[-1+g|0]=c.b[-1+(g-e|0)|0]<c?\"0E+\":\"0E\")+(-2147483648===c?\"2147483648\":\"\"+(-c|0))}else{a=0>b.i;var e=\"\";var f=18;if(a){var g=b.f;b=b.i;b=(new x).g(-g|0,0!==g?~b:-b|0)}g=b.f;for(var h=b.i;;){b=g;var k=h;h=y();g=uf(h,g,k,10,0);h=h.M;f=-1+f|0;k=h;var m=g,p=m>>>16|0;m=n(10,65535&m);p=n(10,p);p=m+(p<<16)|0;n(10,k);e=\"\"+\n(b-p|0)+e;b=h;if(0===g&&0===b)break}b=-1+((18-f|0)-c|0)|0;if(0>>0)).toString(10),0>a?\"-\"+b:b;b=\"\";var f=r(D(E),[c]);Ka(e,0,f,0,c);do{var g=0;for(e=-1+c|0;0<=e;){var h=g;g=f.b[e];var k=wf(y(),g,h,1E9,0);f.b[e]=k;h=k>>31;var m=65535&k;k=k>>>16|0;var p=n(51712,m);m=n(15258,m);var q=n(51712,k);p=p+((m+q|0)<<16)|0;n(1E9,h);n(15258,k);g=g-p|0;e=-1+e|0}e=\"\"+g;for(b=\"000000000\".substring(e.length|0)+e+b;0!==c&&0===f.b[-1+c|0];)c=-1+c|0}while(0!==c);f=0;for(c=b.length|0;;)if(fa?\"-\"+b:b}rf.prototype.$classData=z({Fs:0},!1,\"java.math.Conversion$\",{Fs:1,c:1});var sf=void 0;function xf(){sf||(sf=(new rf).a());return sf}function yf(){}yf.prototype=new A;yf.prototype.constructor=yf;yf.prototype.a=function(){return this};\nfunction zf(a,b,c,e,f,g,h){a=r(D(E),[1+f|0]);var k=r(D(E),[1+h|0]),m=da(g.b[-1+h|0]);0!==m?(gf(qf(),k,g,0,m),gf(qf(),a,e,0,m)):(Ka(e,0,a,0,f),Ka(g,0,k,0,h));e=k.b[-1+h|0];for(c=-1+c|0;0<=c;){if(a.b[f]===e)g=-1;else{var p=a.b[f],q=a.b[-1+f|0];g=y();var t=wf(g,q,p,e,0);p=g.M;g=t;var u=65535&t;t=t>>>16|0;var v=65535&e,B=e>>>16|0,P=n(u,v);v=n(t,v);u=n(u,B);u=P+((v+u|0)<<16)|0;n(p,e);n(t,B);q=q-u|0;if(0!==g)a:for(g=1+g|0;;){t=g=-1+g|0;B=k.b[-2+h|0];p=65535&t;t=t>>>16|0;P=65535&B;B=B>>>16|0;u=n(p,P);P=\nn(t,P);v=n(p,B);p=u+((P+v|0)<<16)|0;u=(u>>>16|0)+v|0;u=(n(t,B)+(u>>>16|0)|0)+(((65535&u)+P|0)>>>16|0)|0;B=q;t=a.b[-2+f|0];P=q+e|0;if(0===((-2147483648^P)<(-2147483648^q)?1:0)&&(q=P,u^=-2147483648,B^=-2147483648,u===B?(-2147483648^p)>(-2147483648^t):u>B))continue a;break}}if(q=0!==g){Af();q=a;p=f-h|0;B=k;t=h;u=g;var ea=0;var Ta;for(P=Ta=0;P>>16|0;var Vf=65535&u,ab=u>>>16|0,Wf=n(qa,Vf);Vf=n(va,Vf);var tl=n(qa,ab);qa=Wf+((Vf+tl|0)<<16)|0;Wf=(Wf>>>16|0)+tl|\n0;ab=(n(va,ab)+(Wf>>>16|0)|0)+(((65535&Wf)+Vf|0)>>>16|0)|0;va=qa+ea|0;ea=(-2147483648^va)<(-2147483648^qa)?1+ab|0:ab;ab=q.b[p+v|0];va=ab-va|0;ab=(-2147483648^va)>(-2147483648^ab)?-1:0;qa=Ta;Ta=qa>>31;qa=va+qa|0;Ta=(-2147483648^qa)<(-2147483648^va)?1+(ab+Ta|0)|0:ab+Ta|0;q.b[p+v|0]=qa;P=1+P|0}u=q.b[p+t|0];B=u-ea|0;u=(-2147483648^B)>(-2147483648^u)?-1:0;v=Ta;P=v>>31;v=B+v|0;q.b[p+t|0]=v;q=0!==((-2147483648^v)<(-2147483648^B)?1+(u+P|0)|0:u+P|0)}if(q)for(g=-1+g|0,q=P=u=0;q>>16|0,p=65535&f,q=f>>>16|0,t=n(k,p);p=n(m,p);k=n(k,q);t=t+((p+k|0)<<16)|0;n(h,f);n(m,q);a=a-t|0;b.b[e]=g;e=-1+e|0}return a}\nyf.prototype.$classData=z({Gs:0},!1,\"java.math.Division$\",{Gs:1,c:1});var Df=void 0;function Af(){Df||(Df=(new yf).a());return Df}function Ef(){}Ef.prototype=new A;Ef.prototype.constructor=Ef;Ef.prototype.a=function(){return this};\nfunction Ff(a,b,c,e){for(var f=r(D(E),[b]),g=0,h=0;g(-2147483648^k)?-1:0;var p=h;h=p>>31;p=m+p|0;m=(-2147483648^p)<(-2147483648^m)?1+(k+h|0)|0:k+h|0;f.b[g]=p;h=m;g=1+g|0}for(;g>31,m=c+m|0,c=(-2147483648^m)<(-2147483648^c)?1+e|0:e,f.b[g]=m,h=c,g=1+g|0;return f}function Gf(a,b,c,e){for(a=-1+e|0;0<=a&&b.b[a]===c.b[a];)a=-1+a|0;return 0>a?0:(-2147483648^b.b[a])<(-2147483648^c.b[a])?-1:1}\nfunction Hf(a,b,c,e){var f=r(D(E),[1+b|0]),g=1,h=a.b[0],k=h+c.b[0]|0;f.b[0]=k;h=(-2147483648^k)<(-2147483648^h)?1:0;if(b>=e){for(;ga?(a=b=c-b|0,c=(-2147483648^b)>(-2147483648^c)?-1:0):(a=c=b-c|0,c=(-2147483648^c)>(-2147483648^b)?-1:0);return Kf(e,(new x).g(a,c))}if(a===e)e=f>=g?Hf(b.H,f,c.H,g):Hf(c.H,g,b.H,f);else{var h=f!==g?f>g?1:-1:Gf(0,b.H,c.H,f);if(0===h)return lf().be;1===h?e=Ff(b.H,f,\nc.H,g):(c=Ff(c.H,g,b.H,f),a=e,e=c)}a=hf(a|0,e.b.length,e);jf(a);return a}\nfunction Lf(a,b,c){var e=b.N;a=c.N;var f=b.ga,g=c.ga;if(0===a)return b;if(0===e)return Mf(c);if(2===(f+g|0))return b=b.H.b[0],f=0,c=c.H.b[0],g=0,0>e&&(e=b,b=-e|0,f=0!==e?~f:-f|0),0>a&&(a=c,e=g,c=-a|0,g=0!==a?~e:-e|0),a=lf(),e=b,b=f,f=g,c=e-c|0,Kf(a,(new x).g(c,(-2147483648^c)>(-2147483648^e)?-1+(b-f|0)|0:b-f|0));var h=f!==g?f>g?1:-1:Gf(Nf(),b.H,c.H,f);if(e===a&&0===h)return lf().be;-1===h?(c=e===a?Ff(c.H,g,b.H,f):Hf(c.H,g,b.H,f),a=-a|0):e===a?(c=Ff(b.H,f,c.H,g),a=e):(c=Hf(b.H,f,c.H,g),a=e);a=hf(a|\n0,c.b.length,c);jf(a);return a}Ef.prototype.$classData=z({Hs:0},!1,\"java.math.Elementary$\",{Hs:1,c:1});var Of=void 0;function Nf(){Of||(Of=(new Ef).a());return Of}function Pf(){this.Vf=0;this.Ig=null}Pf.prototype=new A;Pf.prototype.constructor=Pf;Pf.prototype.t=function(a){return a instanceof Pf?this.Vf===a.Vf?this.Ig===a.Ig:!1:!1};Pf.prototype.n=function(){return\"precision\\x3d\"+this.Vf+\" roundingMode\\x3d\"+this.Ig};Pf.prototype.z=function(){return this.Vf<<3|this.Ig.Tl};\nPf.prototype.$classData=z({Is:0},!1,\"java.math.MathContext\",{Is:1,c:1});function Qf(){this.$l=null}Qf.prototype=new A;Qf.prototype.constructor=Qf;Qf.prototype.a=function(){Rf=this;Sf();var a=Tf().Ji,b=new Pf;b.Vf=34;b.Ig=a;this.$l=b;Sf();Tf();Sf();Tf();Sf();Tf();return this};Qf.prototype.$classData=z({Js:0},!1,\"java.math.MathContext$\",{Js:1,c:1});var Rf=void 0;function Sf(){Rf||(Rf=(new Qf).a());return Rf}function Uf(){this.of=this.pf=null}Uf.prototype=new A;Uf.prototype.constructor=Uf;\nUf.prototype.a=function(){Xf=this;Yf(10,10);Yf(14,5);this.pf=r(D(bf),[32]);this.of=r(D(bf),[32]);var a;var b=1;for(var c=a=0;32>c;){var e=c;if(18>=e){Bf().of.b[e]=Kf(lf(),(new x).g(b,a));var f=Bf().pf,g=lf(),h=b,k=a;f.b[e]=Kf(g,(new x).g(0===(32&e)?h<>>1|0)>>>(31-e|0)|0|k<>>16|0;e=n(5,65535&e);f=n(5,b);b=e+(f<<16)|0;e=(e>>>16|0)+f|0;a=n(5,a)+(e>>>16|0)|0}else Bf().of.b[e]=Zf(Bf().of.b[-1+e|0],Bf().of.b[1]),Bf().pf.b[e]=Zf(Bf().pf.b[-1+e|0],lf().lg);c=1+c|0}return this};\nfunction $f(a,b,c){for(var e,f=0;f>>16|0;var u=65535&p;p=p>>>16|0;var v=n(t,u);u=n(m,u);var B=n(t,p);t=v+((u+B|0)<<16)|0;v=(v>>>16|0)+B|0;m=(n(m,p)+(v>>>16|0)|0)+(((65535&v)+u|0)>>>16|0)|0;q=t+q|0;m=(-2147483648^q)<(-2147483648^t)?1+m|0:m;e=q+e|0;q=(-2147483648^e)<(-2147483648^q)?1+m|0:m;c.b[g+k|0]=e;e=q;h=1+h|0}c.b[g+b|0]=e;f=1+f|0}ef(qf(),c,c,b<<1);for(g=f=e=0;f>>16|0,t=65535&q,q=q>>>16|0,p=n(m,t),t=n(e,t),v=n(m,q),m=p+((t+v|0)<<16)|0,p=(p>>>16|0)+v|0,e=(n(e,q)+(p>>>16|0)|0)+(((65535&p)+t|0)>>>16|0)|0,k=m+k|0,e=(-2147483648^k)<(-2147483648^m)?1+e|0:e,h=k+h|0,k=(-2147483648^h)<(-2147483648^k)?1+e|0:e,c.b[g]=h,g=1+g|0,h=k+c.b[g]|0,k=(-2147483648^h)<(-2147483648^k)?1:0,c.b[g]=h,e=k,f=1+f|0,g=1+g|0;return c}function Yf(a,b){var c=[];if(0b.ga)var e=c;else e=b,b=c;var f=e,g=b;if(63>g.ga){e=f.ga;b=g.ga;c=e+b|0;a=f.N!==g.N?-1:1;if(2===c){e=f.H.b[0];b=g.H.b[0];c=65535&e;e=e>>>16|0;g=65535&b;b=b>>>16|0;f=n(c,g);g=n(e,g);var h=n(c,b);c=f+((g+h|0)<<16)|0;f=(f>>>16|0)+h|0;e=(n(e,b)+(f>>>16|0)|0)+(((65535&f)+g|0)>>>16|0)|0;a=0===e?(new Jf).g(a,c):hf(a,2,ka(D(E),[c,e]))}else{f=f.H;g=g.H;h=r(D(E),[c]);if(0!==e&&0!==b)if(1===e)h.b[b]=bg(0,h,g,b,f.b[0]);else if(1===b)h.b[e]=bg(0,h,f,e,g.b[0]);else if(f===g&&e===b)$f(f,\ne,h);else for(var k=0;k>>16|0,Ta=65535&v;v=v>>>16|0;var va=n(P,Ta);Ta=n(ea,Ta);var qa=n(P,v);P=va+((Ta+qa|0)<<16)|0;va=(va>>>16|0)+qa|0;ea=(n(ea,v)+(va>>>16|0)|0)+(((65535&va)+Ta|0)>>>16|0)|0;B=P+B|0;ea=(-2147483648^B)<(-2147483648^P)?1+ea|0:ea;p=B+p|0;B=(-2147483648^p)<(-2147483648^B)?1+ea|0:ea;h.b[m+u|0]=p;p=B;t=1+t|0}h.b[m+b|0]=p;k=1+k|0}a=hf(a,c,h);jf(a)}return a}e=(-2&f.ga)<<4;c=cg(f,e);h=cg(g,\ne);b=dg(c,e);k=Lf(Nf(),f,b);b=dg(h,e);g=Lf(Nf(),g,b);f=ag(a,c,h);b=ag(a,k,g);a=ag(a,Lf(Nf(),c,k),Lf(Nf(),g,h));c=f;a=If(Nf(),a,c);a=If(Nf(),a,b);a=dg(a,e);e=f=dg(f,e<<1);a=If(Nf(),e,a);return If(Nf(),a,b)}\nfunction bg(a,b,c,e,f){var g;for(a=g=0;a>>16|0;var p=65535&f,q=f>>>16|0,t=n(m,p);p=n(k,p);var u=n(m,q);m=t+((p+u|0)<<16)|0;t=(t>>>16|0)+u|0;k=(n(k,q)+(t>>>16|0)|0)+(((65535&t)+p|0)>>>16|0)|0;g=m+g|0;k=(-2147483648^g)<(-2147483648^m)?1+k|0:k;b.b[h]=g;g=k;a=1+a|0}return g}\nfunction eg(a,b){var c=a.pf.b.length,e=c>>31,f=b.i;if(f===e?(-2147483648^b.f)<(-2147483648^c):f=(-2147483648^b.f):0>c)return fg(lf().lg,b.f);c=b.i;if(0===c?-1>=(-2147483648^b.f):0>c)return dg(fg(a.of.b[1],b.f),b.f);var g=fg(a.of.b[1],2147483647);c=g;f=b.i;var h=-2147483647+b.f|0;e=h;h=1>(-2147483648^h)?f:-1+f|0;for(f=gg(y(),b.f,b.i,2147483647,0);;){var k=e,m=h;if(0===m?-1<(-2147483648^k):0(-2147483648^e)?h:-1+h|0;\nelse break}c=Zf(c,fg(a.of.b[1],f));c=dg(c,2147483647);a=b.i;e=b=-2147483647+b.f|0;for(h=1>(-2147483648^b)?a:-1+a|0;;)if(b=e,a=h,0===a?-1<(-2147483648^b):0(-2147483648^a)?b:-1+b|0,e=a,h=b;else break;return dg(c,f)}Uf.prototype.$classData=z({Ks:0},!1,\"java.math.Multiplication$\",{Ks:1,c:1});var Xf=void 0;function Bf(){Xf||(Xf=(new Uf).a());return Xf}function hg(){this.Sn=this.Rn=this.kl=0}hg.prototype=new A;hg.prototype.constructor=hg;\nhg.prototype.a=function(){ig=this;this.kl=64;this.Rn=this.kl>>2;this.Sn=this.kl;jg(Cc(),this.Rn=b&&!0);a=b+32|0;return og(b,32,48>>1|0,g=b.b[f];if(ce.$a(g,a.b[-1+(b+f|0)|0])){for(var h=b,k=-1+(b+f|0)|0;1<(k-h|0);){var m=(h+k|0)>>>1|0;0>e.$a(g,a.b[m])?k=m:h=m}h=h+(0>e.$a(g,a.b[h])?0:1)|0;for(k=b+f|0;k>h;)a.b[k]=a.b[-1+k|0],k=-1+k|0;a.b[h]=g}f=1+f|0}}}function Fg(a,b,c){var e=new Gg;e.Vh=c;c=b.b.length;16=f||g.mi(b.b[m],b.b[p]))?(c.b[a]=b.b[m],m=1+m|0):(c.b[a]=b.b[p],p=1+p|0),a=1+a|0;Ka(c,e,b,e,h)}else Eg(b,e,f,g)}Cg.prototype.$classData=z({av:0},!1,\"java.util.Arrays$\",{av:1,c:1});var Ig=void 0;function Jg(){Ig||(Ig=(new Cg).a());return Ig}function Kg(){this.Cn=null}Kg.prototype=new A;Kg.prototype.constructor=Kg;\nKg.prototype.a=function(){Lg=this;this.Cn=new l.RegExp(\"(?:(\\\\d+)\\\\$)?([-#+ 0,\\\\(\\x3c]*)(\\\\d+)?(?:\\\\.(\\\\d+))?[%A-Za-z]\",\"g\");return this};Kg.prototype.$classData=z({fv:0},!1,\"java.util.Formatter$\",{fv:1,c:1});var Lg=void 0;function Mg(){}Mg.prototype=new A;Mg.prototype.constructor=Mg;function Ng(){}Ng.prototype=Mg.prototype;function Og(){}Og.prototype=new A;Og.prototype.constructor=Og;function Pg(){}Pg.prototype=Og.prototype;function Qg(){}Qg.prototype=new A;Qg.prototype.constructor=Qg;\nQg.prototype.a=function(){return this};Qg.prototype.$classData=z({Rv:0},!1,\"scala.Predef$any2stringadd$\",{Rv:1,c:1});var Sg=void 0;function Tg(){}Tg.prototype=new A;Tg.prototype.constructor=Tg;Tg.prototype.a=function(){return this};function me(){Ug||(Ug=(new Tg).a());return F(function(){return function(a){Vg(a)}}(Ug))}Tg.prototype.$classData=z({Yv:0},!1,\"scala.concurrent.ExecutionContext$\",{Yv:1,c:1});var Ug=void 0;function Wg(){}Wg.prototype=new A;Wg.prototype.constructor=Wg;Wg.prototype.a=function(){return this};\nWg.prototype.$classData=z({lw:0},!1,\"scala.math.Ordered$\",{lw:1,c:1});var Xg=void 0;function Yg(){this.jk=this.bm=this.Xl=this.Wl=null;this.q=0}Yg.prototype=new A;Yg.prototype.constructor=Yg;\nYg.prototype.a=function(){Zg=this;(new $g).a();ah();bh();ch();dh();this.bm=eh();L();M();fh||(fh=(new gh).a());hh||(hh=(new ih).a());jh||(jh=(new kh).a());lh();mh||(mh=(new nh).a());oh();ph||(ph=(new qh).a());rh();sh||(sh=(new th).a());uh||(uh=(new vh).a());wh||(wh=(new xh).a());yh||(yh=(new zh).a());Xg||(Xg=(new Wg).a());Ah||(Ah=(new Bh).a());Ch||(Ch=(new Dh).a());this.jk=Ch;Eh||(Eh=(new Fh).a());Gh||(Gh=(new Hh).a());return this};Yg.prototype.$classData=z({qw:0},!1,\"scala.package$\",{qw:1,c:1});\nvar Zg=void 0;function vc(){Zg||(Zg=(new Yg).a());return Zg}function Ih(){}Ih.prototype=new A;Ih.prototype.constructor=Ih;Ih.prototype.a=function(){Jh=this;Kh||(Kh=(new Lh).a());Mh||(Mh=(new Nh).a());Oh||(Oh=(new Ph).a());Qh||(Qh=(new Rh).a());Sh||(Sh=(new Th).a());Uh||(Uh=(new Vh).a());Wh||(Wh=(new Xh).a());Yh||(Yh=(new Zh).a());$h||($h=(new ai).a());bi||(bi=(new ci).a());di();ei||(ei=(new fi).a());gi||(gi=(new hi).a());ii||(ii=(new ji).a());return this};\nIh.prototype.$classData=z({sw:0},!1,\"scala.reflect.ClassManifestFactory$\",{sw:1,c:1});var Jh=void 0;function ki(){}ki.prototype=new A;ki.prototype.constructor=ki;ki.prototype.a=function(){return this};ki.prototype.$classData=z({uw:0},!1,\"scala.reflect.ManifestFactory$\",{uw:1,c:1});var li=void 0;function mi(){}mi.prototype=new A;mi.prototype.constructor=mi;mi.prototype.a=function(){ni=this;Jh||(Jh=(new Ih).a());li||(li=(new ki).a());return this};\nmi.prototype.$classData=z({Kw:0},!1,\"scala.reflect.package$\",{Kw:1,c:1});var ni=void 0;function oi(){}oi.prototype=new A;oi.prototype.constructor=oi;oi.prototype.a=function(){(new pi).a();return this};oi.prototype.$classData=z({Tw:0},!1,\"scala.util.control.Breaks\",{Tw:1,c:1});function qi(){}qi.prototype=new A;qi.prototype.constructor=qi;qi.prototype.a=function(){return this};function Td(a,b){return b&&b.$classData&&b.$classData.qa.rl?R():(new Q).j(b)}\nqi.prototype.$classData=z({Ww:0},!1,\"scala.util.control.NonFatal$\",{Ww:1,c:1});var ri=void 0;function Ud(){ri||(ri=(new qi).a());return ri}function si(){}si.prototype=new A;si.prototype.constructor=si;function ti(){}ti.prototype=si.prototype;si.prototype.pi=function(a,b){b=n(-862048943,b);b=n(461845907,b<<15|b>>>17|0);return a^b};si.prototype.Fc=function(a,b){a=this.pi(a,b);return-430675100+n(5,a<<13|a>>>19|0)|0};\nfunction ui(a){var b=vi(),c=a.za();if(0===c)return a=a.Ba(),Ea(Fa(),a);for(var e=-889275714,f=0;f>>16|0));a=n(-1028477387,a^(a>>>13|0));return a^(a>>>16|0)};function Ai(a,b,c){var e=(new zi).ua(0);c=(new zi).ua(c);b.K(F(function(f,g,h){return function(k){g.o=f.Fc(g.o,wi(xi(),k));h.o=1+h.o|0}}(a,c,e)));return a.We(c.o,e.o)}function Bi(){}Bi.prototype=new A;Bi.prototype.constructor=Bi;Bi.prototype.a=function(){return this};Bi.prototype.$classData=z({Yw:0},!1,\"scala.util.hashing.package$\",{Yw:1,c:1});var Ci=void 0;function kh(){}\nkh.prototype=new A;kh.prototype.constructor=kh;kh.prototype.a=function(){return this};kh.prototype.$classData=z({Zw:0},!1,\"scala.collection.$colon$plus$\",{Zw:1,c:1});var jh=void 0;function ih(){}ih.prototype=new A;ih.prototype.constructor=ih;ih.prototype.a=function(){return this};ih.prototype.$classData=z({$w:0},!1,\"scala.collection.$plus$colon$\",{$w:1,c:1});var hh=void 0;function Di(){this.nb=null}Di.prototype=new A;Di.prototype.constructor=Di;\nDi.prototype.a=function(){Ei=this;this.nb=(new Fi).a();return this};Di.prototype.$classData=z({hx:0},!1,\"scala.collection.Iterator$\",{hx:1,c:1});var Ei=void 0;function eh(){Ei||(Ei=(new Di).a());return Ei}function Gi(){this.xb=this.Uc=null}Gi.prototype=new A;Gi.prototype.constructor=Gi;Gi.prototype.$classData=z({mx:0},!1,\"scala.collection.Iterator$ConcatIteratorCell\",{mx:1,c:1});function Hi(a,b,c){a.tb(b,c,Ii(Ji(),b)-c|0)}function Ki(a,b){b=b.ng();b.Gb(a.pa());return b.Ca()}\nfunction U(a,b,c,e){return a.Hb((new Li).a(),b,c,e).vc.ub}function Mi(a){var b=(new zi).ua(0);a.K(F(function(c,e){return function(){e.o=1+e.o|0}}(a,b)));return b.o}function Ni(a,b,c,e,f){var g=(new Oi).$e(!0);Pi(b,c);a.K(F(function(h,k,m,p){return function(q){if(k.o)Qi(m,q),k.o=!1;else return Pi(m,p),Qi(m,q)}}(a,g,b,e)));Pi(b,f);return b}function Ri(a,b){return a.fc()?(b=b.$c(a.x()),a.Yb(b,0),b):a.ib().Kb(b)}function Si(){}Si.prototype=new A;Si.prototype.constructor=Si;Si.prototype.a=function(){return this};\nSi.prototype.Gj=function(a){return 1<<(-da(-1+a|0)|0)};Si.prototype.$classData=z({wx:0},!1,\"scala.collection.Util$\",{wx:1,c:1});var Ti=void 0;function Ui(){}Ui.prototype=new A;Ui.prototype.constructor=Ui;function Vi(){}Vi.prototype=Ui.prototype;function Wi(){}Wi.prototype=new A;Wi.prototype.constructor=Wi;function Xi(){}Xi.prototype=Wi.prototype;Wi.prototype.Jd=function(){return this.fa().Ca()};function Yi(a,b){a:for(;;){if(!b.m()){a.kc(b.w());b=b.Aa();continue a}break}}\nfunction Zi(a,b){b&&b.$classData&&b.$classData.qa.Jg?Yi(a,b):b.K(F(function(c){return function(e){return c.kc(e)}}(a)));return a}function $i(){}$i.prototype=new A;$i.prototype.constructor=$i;function aj(){}aj.prototype=$i.prototype;function nh(){}nh.prototype=new A;nh.prototype.constructor=nh;nh.prototype.a=function(){return this};nh.prototype.$classData=z({Ey:0},!1,\"scala.collection.immutable.Stream$$hash$colon$colon$\",{Ey:1,c:1});var mh=void 0;\nfunction bj(){this.Gl=this.To=null;this.q=!1;this.k=null}bj.prototype=new A;bj.prototype.constructor=bj;function cj(a,b,c){a.Gl=c;if(null===b)throw T(S(),null);a.k=b;return a}function dj(a){a.q||(a.q||(a.To=Sd(a.Gl),a.q=!0),a.Gl=null);return a.To}bj.prototype.$classData=z({Ky:0},!1,\"scala.collection.immutable.StreamIterator$LazyCell\",{Ky:1,c:1});function ej(){}ej.prototype=new A;ej.prototype.constructor=ej;ej.prototype.a=function(){return this};\nfunction fj(a,b,c,e){a=0>c?0:c;return e<=a||a>=(b.length|0)?\"\":b.substring(a,e>(b.length|0)?b.length|0:e)}ej.prototype.$classData=z({My:0},!1,\"scala.collection.immutable.StringOps$\",{My:1,c:1});var gj=void 0;function hj(){gj||(gj=(new ej).a());return gj}function ij(){}ij.prototype=new A;ij.prototype.constructor=ij;ij.prototype.a=function(){return this};ij.prototype.fa=function(){var a=(new Li).a();return jj(new kj,a,F(function(){return function(b){return(new lj).h(b)}}(this)))};\nij.prototype.$classData=z({Uy:0},!1,\"scala.collection.immutable.WrappedString$\",{Uy:1,c:1});var mj=void 0;function nj(a){return oj(Xc(),-1+a.Ya.b.length|0)}function pj(a,b){b=Fb(b);return qj(a,b)}\nfunction qj(a,b){var c=Da(b);c=rj(a,c);for(var e=a.Ya.b[c];null!==e;){if(G(H(),e,b))return!1;c=(1+c|0)%a.Ya.b.length|0;e=a.Ya.b[c]}a.Ya.b[c]=b;a.He=1+a.He|0;null!==a.Qg&&(b=c>>5,c=a.Qg,c.b[b]=1+c.b[b]|0);if(a.He>=a.Kl){b=a.Ya;a.Ya=r(D(C),[a.Ya.b.length<<1]);a.He=0;if(null!==a.Qg)if(c=1+(a.Ya.b.length>>5)|0,a.Qg.b.length!==c)a.Qg=r(D(E),[c]);else{Jg();c=a.Qg;e=c.b.length;for(var f=0;f!==e;)c.b[f]=0,f=1+f|0}a.Dl=nj(a);a.Kl=sj(tj(),a.gk,a.Ya.b.length);for(c=0;c>>8|0)|b>>>24|0);a=-1+a.Ya.b.length|0;return((b>>>c|0|b<<(-c|0))>>>(32-oj(Xc(),a)|0)|0)&a}function uj(a,b){b=Fb(b);var c=Da(b);c=rj(a,c);for(var e=a.Ya.b[c];null!==e&&!G(H(),e,b);)c=(1+c|0)%a.Ya.b.length|0,e=a.Ya.b[c];return e}function vj(){}vj.prototype=new A;vj.prototype.constructor=vj;vj.prototype.a=function(){return this};\nfunction sj(a,b,c){if(!(500>b))throw(new wj).j(\"assertion failed: loadFactor too large; must be \\x3c 0.5\");a=c>>31;var e=b>>31,f=65535&c,g=c>>>16|0,h=65535&b,k=b>>>16|0,m=n(f,h);h=n(g,h);var p=n(f,k);f=m+((h+p|0)<<16)|0;m=(m>>>16|0)+p|0;b=(((n(c,e)+n(a,b)|0)+n(g,k)|0)+(m>>>16|0)|0)+(((65535&m)+h|0)>>>16|0)|0;return uf(y(),f,b,1E3,0)}vj.prototype.$classData=z({Zy:0},!1,\"scala.collection.mutable.FlatHashTable$\",{Zy:1,c:1});var xj=void 0;function tj(){xj||(xj=(new vj).a());return xj}function yj(){}\nyj.prototype=new A;yj.prototype.constructor=yj;yj.prototype.a=function(){return this};yj.prototype.n=function(){return\"NullSentinel\"};yj.prototype.z=function(){return 0};yj.prototype.$classData=z({bz:0},!1,\"scala.collection.mutable.FlatHashTable$NullSentinel$\",{bz:1,c:1});var zj=void 0;function Gb(){zj||(zj=(new yj).a());return zj}function Aj(){}Aj.prototype=new A;Aj.prototype.constructor=Aj;Aj.prototype.a=function(){return this};Aj.prototype.Gj=function(a){return 1<<(-da(-1+a|0)|0)};\nAj.prototype.$classData=z({dz:0},!1,\"scala.collection.mutable.HashTable$\",{dz:1,c:1});var Bj=void 0;function Cj(){Bj||(Bj=(new Aj).a());return Bj}function Dj(){this.Sj=null}Dj.prototype=new A;Dj.prototype.constructor=Dj;Dj.prototype.a=function(){Ej=this;this.Sj=l.Object.prototype.hasOwnProperty;return this};Dj.prototype.$classData=z({tz:0},!1,\"scala.scalajs.js.WrappedDictionary$Cache$\",{tz:1,c:1});var Ej=void 0;function Fj(){Ej||(Ej=(new Dj).a());return Ej}\nfunction Gj(){this.$f=!1;this.Sk=this.uh=this.Qh=null;this.Dk=!1;this.hl=this.Vk=0}Gj.prototype=new A;Gj.prototype.constructor=Gj;\nGj.prototype.a=function(){Hj=this;this.Qh=(this.$f=!!(l.ArrayBuffer&&l.Int32Array&&l.Float32Array&&l.Float64Array))?new l.ArrayBuffer(8):null;this.uh=this.$f?new l.Int32Array(this.Qh,0,2):null;this.$f&&new l.Float32Array(this.Qh,0,2);this.Sk=this.$f?new l.Float64Array(this.Qh,0,1):null;if(this.$f)this.uh[0]=16909060,a=1===((new l.Int8Array(this.Qh,0,8))[0]|0);else var a=!0;this.Vk=(this.Dk=a)?0:1;this.hl=this.Dk?1:0;return this};\nfunction Ga(a,b){var c=b|0;if(c===b&&-Infinity!==1/b)return c;if(a.$f)a.Sk[0]=b,a=(new x).g(a.uh[a.hl]|0,a.uh[a.Vk]|0);else{if(b!==b)a=!1,b=2047,c=+l.Math.pow(2,51);else if(Infinity===b||-Infinity===b)a=0>b,b=2047,c=0;else if(0===b)a=-Infinity===1/b,c=b=0;else{var e=(a=0>b)?-b:b;if(e>=+l.Math.pow(2,-1022)){b=+l.Math.pow(2,52);c=+l.Math.log(e)/.6931471805599453;c=+l.Math.floor(c)|0;c=1023>c?c:1023;var f=+l.Math.pow(2,c);f>e&&(c=-1+c|0,f/=2);f=e/f*b;e=+l.Math.floor(f);f-=e;e=.5>f?e:.5e?c:.5b,e=2047&b>>20;a=4294967296*(1048575&b)+ +(a.f>>>0);return 2047===e?0!==a?NaN:c?-Infinity:Infinity:0f&&Oj(c);)0!==Pj(c)&&(g=Qj(c).index|0,e=b.substring(e,g),a.push(null===e?null:e),f=1+f|0),e=Pj(c);b=b.substring(e);a.push(null===b?null:b);b=ka(D(oa),a);for(c=b.b.length;0!==c&&\"\"===b.b[-1+c|0];)c=-1+c|0;c!==b.b.length&&(a=r(D(oa),[c]),Ka(b,0,a,0,c),b=a)}return b}function Rj(a,b){a=b.length|0;for(var c=r(D(Ua),[a]),e=0;ec||ab.b.length)throw(new Tj).a();for(e=\"\";c!==a;)e=\"\"+e+l.String.fromCharCode(b.b[c]),c=1+c|0;return e}function Ea(a,b){a=0;for(var c=1,e=-1+(b.length|0)|0;0<=e;)a=a+n(65535&(b.charCodeAt(e)|0),c)|0,c=n(31,c),e=-1+e|0;return a}\nfunction Uj(a,b){var c=(new Vj).a();if(c.ji)throw(new Wj).a();for(var e=0,f=0,g=a.length|0,h=0;h!==g;){var k=a.indexOf(\"%\",h)|0;if(0>k){Xj(c,a.substring(h));break}Xj(c,a.substring(h,k));h=1+k|0;Lg||(Lg=(new Kg).a());var m=Lg.Cn;m.lastIndex=h;k=m.exec(a);if(null===k||(k.index|0)!==h)throw c=h===g?\"%\":a.substring(h,1+h|0),(new Yj).h(c);h=m.lastIndex|0;m=65535&(a.charCodeAt(-1+h|0)|0);for(var p,q=k[2],t=90>=m?256:0,u=q.length|0,v=0;v!==u;){p=65535&(q.charCodeAt(v)|0);switch(p){case 45:var B=1;break;\ncase 35:B=2;break;case 43:B=4;break;case 32:B=8;break;case 48:B=16;break;case 44:B=32;break;case 40:B=64;break;case 60:B=128;break;default:throw(new J).j(Zj(p));}if(0!==(t&B))throw(new ak).h(l.String.fromCharCode(p));t|=B;v=1+v|0}p=t;u=ck(k[3],-1);t=ck(k[4],-1);if(37===m||110===m)k=null;else{if(0!==(1&p)&&0>u)throw(new dk).h(\"%\"+k[0]);0!==(128&p)?q=f:(q=ck(k[1],0),q=0===q?e=1+e|0:0>q?f:q);if(0>=q||q>b.b.length){c=l.String.fromCharCode(m);if(0>(\"bBhHsHcCdoxXeEgGfn%\".indexOf(c)|0))throw(new Yj).h(c);\nthrow(new ek).h(\"%\"+k[0]);}f=q;k=b.b[-1+q|0]}q=c;v=k;B=m;k=p;m=u;u=t;switch(B){case 98:case 66:0!==(126&k)&&fk(k,126,B);gk(q,k,m,u,!1===v||null===v?\"false\":\"true\");break;case 104:case 72:0!==(126&k)&&fk(k,126,B);t=null===v?\"null\":(+(Da(v)>>>0)).toString(16);gk(q,k,m,u,t);break;case 115:case 83:v&&v.$classData&&v.$classData.qa.zH?(0!==(124&k)&&fk(k,124,B),v.wH(q,(0!==(1&k)?1:0)|(0!==(2&k)?4:0)|(0!==(256&k)?2:0),m,u)):(0!==(126&k)&&fk(k,126,B),gk(q,k,m,u,\"\"+v));break;case 99:case 67:0!==(126&k)&&fk(k,\n126,B);if(0<=u)throw(new hk).ua(u);if(v instanceof wb)gk(q,k,m,-1,l.String.fromCharCode(null===v?0:v.s));else if(La(v)){t=v|0;if(!(0<=t&&1114111>=t))throw(new ik).ua(t);t=65536>t?l.String.fromCharCode(t):l.String.fromCharCode(-64+(t>>10)|55296,56320|1023&t);gk(q,k,m,-1,t)}else jk(q,v,k,m,u,B);break;case 100:0!==(2&k)&&fk(k,2,B);17!==(17&k)&&12!==(12&k)||kk(k);if(0<=u)throw(new hk).ua(u);La(v)?lk(q,k,m,\"\"+(v|0)):v instanceof x?(u=Ma(v),t=u.f,u=u.i,lk(q,k,m,mk(y(),t,u))):jk(q,v,k,m,u,B);break;case 111:0!==\n(108&k)&&fk(k,108,B);17===(17&k)&&kk(k);if(0<=u)throw(new hk).ua(u);t=0!==(2&k)?\"0\":\"\";La(v)?(u=(+((v|0)>>>0)).toString(8),nk(q,k,m,t,u)):v instanceof x?(u=Ma(v),v=u.f,p=u.i,ok(),u=1073741823&v,B=1073741823&((v>>>30|0)+(p<<2)|0),v=p>>>28|0,0!==v?(v=(+(v>>>0)).toString(8),p=(+(B>>>0)).toString(8),B=\"0000000000\".substring(p.length|0),u=(+(u>>>0)).toString(8),u=v+(\"\"+B+p)+(\"\"+\"0000000000\".substring(u.length|0)+u)):0!==B?(v=(+(B>>>0)).toString(8),u=(+(u>>>0)).toString(8),u=v+(\"\"+\"0000000000\".substring(u.length|\n0)+u)):u=(+(u>>>0)).toString(8),nk(q,k,m,t,u)):jk(q,v,k,m,u,B);break;case 120:case 88:0!==(108&k)&&fk(k,108,B);17===(17&k)&&kk(k);if(0<=u)throw(new hk).ua(u);t=0===(2&k)?\"\":0!==(256&k)?\"0X\":\"0x\";La(v)?(u=(+((v|0)>>>0)).toString(16),nk(q,k,m,t,pk(k,u))):v instanceof x?(u=Ma(v),v=u.f,p=u.i,ok(),u=k,0!==p?(p=(+(p>>>0)).toString(16),v=(+(v>>>0)).toString(16),v=p+(\"\"+\"00000000\".substring(v.length|0)+v)):v=(+(v>>>0)).toString(16),nk(q,u,m,t,pk(k,v))):jk(q,v,k,m,u,B);break;case 101:case 69:0!==(32&k)&&fk(k,\n32,B);17!==(17&k)&&12!==(12&k)||kk(k);\"number\"===typeof v?(t=+v,t!==t||Infinity===t||-Infinity===t?qk(q,k,m,t):lk(q,k,m,rk(t,0<=u?u:6,0!==(2&k)))):jk(q,v,k,m,u,B);break;case 103:case 71:0!==(2&k)&&fk(k,2,B);17!==(17&k)&&12!==(12&k)||kk(k);\"number\"===typeof v?(v=+v,v!==v||Infinity===v||-Infinity===v?qk(q,k,m,v):(t=k,p=0<=u?u:6,k=0!==(2&k),u=+l.Math.abs(v),p=0===p?1:p,1E-4<=u&&u<+l.Math.pow(10,p)?(B=void 0!==l.Math.log10?+l.Math.log10(u):+l.Math.log(u)/2.302585092994046,B=Ja(+l.Math.ceil(B)),u=+l.Math.pow(10,\nB)<=u?1+B|0:B,u=p-u|0,k=sk(v,0m)throw(new dk).h(\"%-%\");vk(q,k,m,\"%\");break;case 110:if(0!==(255&k))throw(new tk).h(uk(k));if(0<=u)throw(new hk).ua(u);if(0<=m)throw(new wk).ua(m);\nXj(q,\"\\n\");break;default:throw(new Yj).h(l.String.fromCharCode(B));}}a=c.n();c.ej();return a}Ij.prototype.$classData=z({Az:0},!1,\"scala.scalajs.runtime.RuntimeString$\",{Az:1,c:1});var xk=void 0;function Fa(){xk||(xk=(new Ij).a());return xk}function yk(){this.An=!1;this.Jm=this.Mm=this.Lm=null;this.q=0}yk.prototype=new A;yk.prototype.constructor=yk;yk.prototype.a=function(){return this};\nfunction zk(a){return(a.stack+\"\\n\").replace(Ak(\"^[\\\\s\\\\S]+?\\\\s+at\\\\s+\"),\" at \").replace(Bk(\"^\\\\s+(at eval )?at\\\\s+\",\"gm\"),\"\").replace(Bk(\"^([^\\\\(]+?)([\\\\n])\",\"gm\"),\"{anonymous}() ($1)$2\").replace(Bk(\"^Object.\\x3canonymous\\x3e\\\\s*\\\\(([^\\\\)]+)\\\\)\",\"gm\"),\"{anonymous}() ($1)\").replace(Bk(\"^([^\\\\(]+|\\\\{anonymous\\\\}\\\\(\\\\)) \\\\((.+)\\\\)$\",\"gm\"),\"$1@$2\").split(\"\\n\").slice(0,-1)}function Ck(a){0===(8&a.q)<<24>>24&&0===(8&a.q)<<24>>24&&(a.Jm=l.Object.keys(Dk(a)),a.q=(8|a.q)<<24>>24);return a.Jm}\nfunction Ek(a){if(0===(2&a.q)<<24>>24&&0===(2&a.q)<<24>>24){for(var b={O:\"java_lang_Object\",T:\"java_lang_String\",V:\"scala_Unit\",Z:\"scala_Boolean\",C:\"scala_Char\",B:\"scala_Byte\",S:\"scala_Short\",I:\"scala_Int\",J:\"scala_Long\",F:\"scala_Float\",D:\"scala_Double\"},c=0;22>=c;)2<=c&&(b[\"T\"+c]=\"scala_Tuple\"+c),b[\"F\"+c]=\"scala_Function\"+c,c=1+c|0;a.Lm=b;a.q=(2|a.q)<<24>>24}return a.Lm}\nfunction Fk(a,b){var c=Ak(\"^(?:Object\\\\.|\\\\[object Object\\\\]\\\\.)?(?:ScalaJS\\\\.c\\\\.|\\\\$c_)([^\\\\.]+)(?:\\\\.prototype)?\\\\.([^\\\\.]+)$\"),e=Ak(\"^(?:Object\\\\.|\\\\[object Object\\\\]\\\\.)?(?:ScalaJS\\\\.(?:s|f)\\\\.|\\\\$(?:s|f)_)((?:_[^_]|[^_])+)__([^\\\\.]+)$\"),f=Ak(\"^(?:Object\\\\.|\\\\[object Object\\\\]\\\\.)?(?:ScalaJS\\\\.m\\\\.|\\\\$m_)([^\\\\.]+)$\"),g=!1;c=c.exec(b);null===c&&(c=e.exec(b),null===c&&(c=f.exec(b),g=!0));if(null!==c){b=c[1];if(void 0===b)throw(new V).h(\"undefined.get\");b=36===(65535&(b.charCodeAt(0)|0))?b.substring(1):\nb;e=Ek(a);if(Fj().Sj.call(e,b)){a=Ek(a);if(!Fj().Sj.call(a,b))throw(new V).h(\"key not found: \"+b);a=a[b]}else a:for(f=0;;)if(f<(Ck(a).length|0)){e=Ck(a)[f];if(0<=(b.length|0)&&b.substring(0,e.length|0)===e){a=Dk(a);if(!Fj().Sj.call(a,e))throw(new V).h(\"key not found: \"+e);a=\"\"+a[e]+b.substring(e.length|0);break a}f=1+f|0}else{a=0<=(b.length|0)&&\"L\"===b.substring(0,1)?b.substring(1):b;break a}a=a.split(\"_\").join(\".\").split(\"$und\").join(\"_\");if(g)g=\"\\x3cclinit\\x3e\";else{g=c[2];if(void 0===g)throw(new V).h(\"undefined.get\");\n0<=(g.length|0)&&\"init___\"===g.substring(0,7)?g=\"\\x3cinit\\x3e\":(c=g.indexOf(\"__\")|0,g=0>c?g:g.substring(0,c))}return(new K).Q(a,g)}return(new K).Q(\"\\x3cjscode\\x3e\",b)}function Gk(a){var b=Bk(\"Line (\\\\d+).*script (?:in )?(\\\\S+)\",\"i\");a=a.message.split(\"\\n\");for(var c=[],e=2,f=a.length|0;e>24&&0===(4&a.q)<<24>>24&&(a.Mm={sjsr_:\"scala_scalajs_runtime_\",sjs_:\"scala_scalajs_\",sci_:\"scala_collection_immutable_\",scm_:\"scala_collection_mutable_\",scg_:\"scala_collection_generic_\",sc_:\"scala_collection_\",sr_:\"scala_runtime_\",s_:\"scala_\",jl_:\"java_lang_\",ju_:\"java_util_\"},a.q=(4|a.q)<<24>>24);return a.Mm}yk.prototype.$classData=z({Bz:0},!1,\"scala.scalajs.runtime.StackTrace$\",{Bz:1,c:1});var Hk=void 0;function Ik(){}Ik.prototype=new A;Ik.prototype.constructor=Ik;\nIk.prototype.a=function(){return this};function Bk(a,b){Jk||(Jk=(new Ik).a());return new l.RegExp(a,b)}function Ak(a){Jk||(Jk=(new Ik).a());return new l.RegExp(a)}Ik.prototype.$classData=z({Cz:0},!1,\"scala.scalajs.runtime.StackTrace$StringRE$\",{Cz:1,c:1});var Jk=void 0;function Kk(){}Kk.prototype=new A;Kk.prototype.constructor=Kk;Kk.prototype.a=function(){return this};function T(a,b){return b instanceof Lk?b.If:b}function Yc(a,b){return b instanceof W?b:(new Lk).j(b)}\nKk.prototype.$classData=z({Dz:0},!1,\"scala.scalajs.runtime.package$\",{Dz:1,c:1});var Mk=void 0;function S(){Mk||(Mk=(new Kk).a());return Mk}function Nk(){}Nk.prototype=new A;Nk.prototype.constructor=Nk;Nk.prototype.a=function(){return this};function Ok(a,b){if(b instanceof wb)return a.s===b.s;if(Pk(b)){if(\"number\"===typeof b)return+b===a.s;if(b instanceof x){b=Ma(b);var c=b.i;a=a.s;return b.f===a&&c===a>>31}return null===b?null===a:Ca(b,a)}return null===a&&null===b}\nfunction G(a,b,c){if(b===c)c=!0;else if(Pk(b))a:if(Pk(c))c=Qk(0,b,c);else{if(c instanceof wb){if(\"number\"===typeof b){c=+b===c.s;break a}if(b instanceof x){a=Ma(b);b=a.i;c=c.s;c=a.f===c&&b===c>>31;break a}}c=null===b?null===c:Ca(b,c)}else c=b instanceof wb?Ok(b,c):null===b?null===c:Ca(b,c);return c}\nfunction Qk(a,b,c){if(\"number\"===typeof b)return a=+b,\"number\"===typeof c?a===+c:c instanceof x?(b=Ma(c),c=b.f,b=b.i,a===Rk(y(),c,b)):c instanceof Sk?c.t(a):!1;if(b instanceof x){b=Ma(b);a=b.f;b=b.i;if(c instanceof x){c=Ma(c);var e=c.i;return a===c.f&&b===e}return\"number\"===typeof c?(c=+c,Rk(y(),a,b)===c):c instanceof Sk?c.t((new x).g(a,b)):!1}return null===b?null===c:Ca(b,c)}Nk.prototype.$classData=z({Fz:0},!1,\"scala.runtime.BoxesRunTime$\",{Fz:1,c:1});var Tk=void 0;\nfunction H(){Tk||(Tk=(new Nk).a());return Tk}var Uk=z({Jz:0},!1,\"scala.runtime.Null$\",{Jz:1,c:1});function Vk(){}Vk.prototype=new A;Vk.prototype.constructor=Vk;Vk.prototype.a=function(){return this};Vk.prototype.$classData=z({Oz:0},!1,\"scala.runtime.RichDouble$\",{Oz:1,c:1});var Wk=void 0;function Xk(){Wk||(Wk=(new Vk).a())}function Yk(){}Yk.prototype=new A;Yk.prototype.constructor=Yk;Yk.prototype.a=function(){return this};function Zk(a,b){return Rk(y(),b.f,b.i)}\nYk.prototype.$classData=z({Qz:0},!1,\"scala.runtime.RichLong$\",{Qz:1,c:1});var $k=void 0;function al(){$k||($k=(new Yk).a());return $k}function bl(){}bl.prototype=new A;bl.prototype.constructor=bl;bl.prototype.a=function(){return this};function Ii(a,b){if(ub(b,1)||eb(b,1)||hb(b,1)||fb(b,1)||gb(b,1)||bb(b,1)||cb(b,1)||db(b,1)||$a(b,1)||cl(b))return b.b.length;if(null===b)throw(new Oc).a();throw(new J).j(b);}\nfunction dl(a,b,c,e){if(ub(b,1))b.b[c]=e;else if(eb(b,1))b.b[c]=e|0;else if(hb(b,1))b.b[c]=+e;else if(fb(b,1))b.b[c]=Ma(e);else if(gb(b,1))b.b[c]=+e;else if(bb(b,1))b.b[c]=null===e?0:e.s;else if(cb(b,1))b.b[c]=e|0;else if(db(b,1))b.b[c]=e|0;else if($a(b,1))b.b[c]=!!e;else if(cl(b))b.b[c]=void 0;else{if(null===b)throw(new Oc).a();throw(new J).j(b);}}function el(a){Ji();var b=(new fl).af(a);return U(b,a.Ba()+\"(\",\",\",\")\")}\nfunction gl(a,b,c){if(ub(b,1)||eb(b,1)||hb(b,1)||fb(b,1)||gb(b,1))return b.b[c];if(bb(b,1))return Zj(b.b[c]);if(cb(b,1)||db(b,1)||$a(b,1)||cl(b))return b.b[c];if(null===b)throw(new Oc).a();throw(new J).j(b);}bl.prototype.$classData=z({Sz:0},!1,\"scala.runtime.ScalaRunTime$\",{Sz:1,c:1});var hl=void 0;function Ji(){hl||(hl=(new bl).a());return hl}function il(){}il.prototype=new A;il.prototype.constructor=il;d=il.prototype;d.a=function(){return this};\nd.pi=function(a,b){b=n(-862048943,b);b=n(461845907,b<<15|b>>>17|0);return a^b};function jl(a,b){a=Ja(b);if(a===b)return a;var c=y();a=kl(c,b);c=c.M;return Rk(y(),a,c)===b?a^c:Ga(Ha(),b)}function wi(a,b){return null===b?0:\"number\"===typeof b?jl(0,+b):b instanceof x?(a=Ma(b),ll(0,(new x).g(a.f,a.i))):Da(b)}d.Fc=function(a,b){a=this.pi(a,b);return-430675100+n(5,a<<13|a>>>19|0)|0};function ll(a,b){a=b.f;b=b.i;return b===a>>31?a:a^b}\nd.We=function(a,b){a^=b;a=n(-2048144789,a^(a>>>16|0));a=n(-1028477387,a^(a>>>13|0));return a^(a>>>16|0)};d.$classData=z({Uz:0},!1,\"scala.runtime.Statics$\",{Uz:1,c:1});var ml=void 0;function xi(){ml||(ml=(new il).a());return ml}function Tc(){this.Cc=null}Tc.prototype=new A;Tc.prototype.constructor=Tc;Tc.prototype.j=function(a){this.Cc=a;return this};Tc.prototype.Xe=function(a){return(0,this.Cc)(a)};Tc.prototype.$classData=z({ep:0},!1,\"atcoder.StdInConverter$$$Lambda$1\",{ep:1,c:1,Mi:1});\nfunction Hc(){this.Cc=null}Hc.prototype=new A;Hc.prototype.constructor=Hc;Hc.prototype.j=function(a){this.Cc=a;return this};Hc.prototype.Xe=function(a){return(0,this.Cc)(a)};Hc.prototype.$classData=z({fp:0},!1,\"atcoder.StdInConverter$$$Lambda$2\",{fp:1,c:1,Mi:1});function zc(){this.Cc=null}zc.prototype=new A;zc.prototype.constructor=zc;zc.prototype.j=function(a){this.Cc=a;return this};zc.prototype.Xe=function(a){return(0,this.Cc)(a)};\nzc.prototype.$classData=z({gp:0},!1,\"atcoder.StdInConverter$$$Lambda$3\",{gp:1,c:1,Mi:1});function Nc(){this.Cc=null}Nc.prototype=new A;Nc.prototype.constructor=Nc;Nc.prototype.j=function(a){this.Cc=a;return this};Nc.prototype.Xe=function(a){return(0,this.Cc)(a)};Nc.prototype.$classData=z({hp:0},!1,\"atcoder.StdInConverter$$$Lambda$4\",{hp:1,c:1,Mi:1});function Kc(){this.Cc=null}Kc.prototype=new A;Kc.prototype.constructor=Kc;Kc.prototype.j=function(a){this.Cc=a;return this};\nKc.prototype.Xe=function(a){return(0,this.Cc)(a)};Kc.prototype.$classData=z({ip:0},!1,\"atcoder.StdInConverter$$$Lambda$5\",{ip:1,c:1,Mi:1});function bd(){}bd.prototype=new A;bd.prototype.constructor=bd;bd.prototype.a=function(){return this};bd.prototype.$classData=z({up:0},!1,\"cats.NotNull$$anon$1\",{up:1,c:1,lA:1});function Rb(){this.Po=this.la=null}Rb.prototype=new A;Rb.prototype.constructor=Rb;Rb.prototype.$classData=z({Bp:0},!1,\"cats.Show$ToShowOps$$anon$1\",{Bp:1,c:1,rA:1});function nl(){}\nnl.prototype=new kd;nl.prototype.constructor=nl;function ol(){}ol.prototype=nl.prototype;function pl(){}pl.prototype=new A;pl.prototype.constructor=pl;function ql(){}ql.prototype=pl.prototype;\nfunction rl(a){sl();a=he(Qd(),a);if(a instanceof Zd)a=(new Q).j(a.yf);else{if(a instanceof $d)throw a=a.Gf,T(S(),a);if(a instanceof Nd){Fd||(Fd=(new Ed).a());var b=(new ul).a();Dd();var c=(new be).a();Pd(Qd(),a,c,b,null,null,null);if(0===(2&c.ue)<<24>>24)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/internals/IOConnection.scala: 109\");a=c.Am;c=b.s;if(c instanceof wc)a=(new Q).j(c.E);else{if(c instanceof Fc)throw a=c.E,T(S(),\na);if(null===c){b.wj=!1;b.ma=!0;b=pd();if(0===(1&b.ma)<<24>>24)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/internals/Callback.scala: 37\");b=b.lo;c=Qd();var e=Dd();if(!e.ma)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/internals/IOConnection.scala: 94\");Pd(c,a,e.Qo,b,null,null,null);throw(new Pc).h(\"cannot synchronously await result on JavaScript; use runAsync or unsafeRunAsync\");\n}throw(new J).j(c);}}else throw(new wj).j(\"unreachable\");}a.Nb()}pl.prototype.n=function(){return this instanceof Zd?\"IO(\"+this.yf+\")\":this instanceof $d?\"IO(throw \"+this.Gf+\")\":\"IO$\"+Ia(this)};function vl(a,b){if(a instanceof ae){var c=a.Xb,e=a.Jb,f=a.wd;return 31!==f?wl(new ae,c,e.Rb(b),1+f|0):wl(new ae,a,b,0)}return wl(new ae,a,b,0)}function be(){this.Am=this.Ai=null;this.ue=0}be.prototype=new yd;be.prototype.constructor=be;\nbe.prototype.a=function(){this.Ai=(new xl).j((L(),M()));this.ue=(1|this.ue)<<24>>24;Mb();this.Am=(new td).ge(Ob(function(a){return function(){var b=a.Ai,c=b.s;b.s=null;null===c||M().t(c)?b=sd():(wd||(wd=(new qd).a()),b=rd(wd,yl(c)));return b}}(this)));this.ue=(2|this.ue)<<24>>24;return this};be.prototype.el=function(){return null===this.Ai.s};\nbe.prototype.fo=function(){for(;;){var a=this.Ai.s;if(null===a||M().t(a)){sd();break}if(a instanceof N){var b=this.Ai;a===b.s?(b.s=a.uc,a=!0):a=!1;if(a)break}else throw(new J).j(a);}};be.prototype.$classData=z({cq:0},!1,\"cats.effect.internals.IOConnection$Impl\",{cq:1,aq:1,c:1});function Cd(){}Cd.prototype=new yd;Cd.prototype.constructor=Cd;Cd.prototype.a=function(){return this};Cd.prototype.el=function(){return!1};Cd.prototype.fo=function(){sd()};\nCd.prototype.$classData=z({dq:0},!1,\"cats.effect.internals.IOConnection$Uncancelable\",{dq:1,aq:1,c:1});function Kd(){}Kd.prototype=new A;Kd.prototype.constructor=Kd;function zl(){}zl.prototype=Kd.prototype;Kd.prototype.n=function(){return\"\\x3cfunction1\\x3e\"};Kd.prototype.Rb=function(a){return jb(this,a)};function ul(){this.wj=!1;this.s=null;this.ma=!1}ul.prototype=new A;ul.prototype.constructor=ul;d=ul.prototype;d.a=function(){this.ma=this.wj=!0;return this};d.l=function(a){this.gh(a)};d.n=function(){return\"\\x3cfunction1\\x3e\"};\nd.gh=function(a){if(!this.ma)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/js/src/main/scala/cats/effect/internals/IOPlatform.scala: 66\");this.wj?(this.wj=!1,this.ma=!0,this.s=a):a instanceof Fc&&(a=a.E,nd().l(a))};d.Rb=function(a){return jb(this,a)};d.$classData=z({gq:0},!1,\"cats.effect.internals.IOPlatform$ResyncCallback\",{gq:1,c:1,P:1});function Al(){this.k=this.mo=this.Uc=null}Al.prototype=new A;Al.prototype.constructor=Al;\nAl.prototype.Lj=function(){var a=this.k.qg,b=this.mo,c=new Bl;if(null===b)throw T(S(),null);c.k=b;c.Ph=b.ce;c.ma=(1|c.ma)<<24>>24;c.Wc=b.hd;for(c.ma=(2|c.ma)<<24>>24;c.r();)Yd(a,c.u());oe(this.k,this.Uc)};function pe(a,b,c){var e=new Al;e.Uc=b;e.mo=c;if(null===a)throw T(S(),null);e.k=a;return e}Al.prototype.$classData=z({mq:0},!1,\"cats.effect.internals.Trampoline$ResumeRun$1\",{mq:1,c:1,Jn:1});function se(){this.Oo=this.Eh=null;this.ma=!1}se.prototype=new A;se.prototype.constructor=se;\nse.prototype.ol=function(a){this.Eh.ol(a)};se.prototype.al=function(a){this.Eh=a;this.Oo=(new ne).al(a);this.ma=!0;return this};se.prototype.oh=function(a){this.Oo.oh(a)};se.prototype.$classData=z({nq:0},!1,\"cats.effect.internals.TrampolineEC\",{nq:1,c:1,Xv:1});function te(){}te.prototype=new A;te.prototype.constructor=te;te.prototype.a=function(){return this};te.prototype.ol=function(a){nd().l(a)};te.prototype.oh=function(a){a.Lj()};\nte.prototype.$classData=z({pq:0},!1,\"cats.effect.internals.TrampolineEC$$anon$1\",{pq:1,c:1,Xv:1});function Cl(){}Cl.prototype=new xe;Cl.prototype.constructor=Cl;function Dl(){}Dl.prototype=Cl.prototype;function El(){}El.prototype=new ze;El.prototype.constructor=El;function Fl(){}Fl.prototype=El.prototype;function Gl(){}Gl.prototype=new xe;Gl.prototype.constructor=Gl;function Hl(){}Hl.prototype=Gl.prototype;\nfunction Il(a){var b=Jl(a);return Kl(new Ll,b,Od(function(c){return function(e,f){return Ml(c).$a(e.E,f.E)}}(a)))}function Nl(a){var b=Ol(a);return Pl(new Ql,b,Od(function(c){return function(e,f){var g=e.ra,h=f.ra,k=bh().G;g=Rl(g,h,k).Mb(F(function(){return function(m){return!G(H(),m.Ga(),m.Qa())}}(c)));g.m()?g=R():(g=g.Nb(),g=(new Q).j(Ml(c).$a(g.Ga().E,g.Qa().E)));g.m()?(Sl(c),e=Tl(e.ra),Sl(c),f=Tl(f.ra),f=e===f?0:e>24&&0===(1&b.q)<<24>>24){a:try{l.Packages.org.mozilla.javascript.JavaScriptException;var e=!0}catch(u){e=Yc(S(),u);if(null!==e){if(e instanceof Lk){e=!1;break a}throw T(S(),e);}throw u;}b.An=e;b.q=(1|b.q)<<24>>24}if(b.An)e=c.stack,e=(void 0===e?\"\":e).replace(Bk(\"^\\\\s+at\\\\s+\",\"gm\"),\"\").replace(Bk(\"^(.+?)(?: \\\\((.+)\\\\))?$\",\"gm\"),\"$2@$1\").replace(Bk(\"\\\\r\\\\n?\",\"gm\"),\"\\n\").split(\"\\n\");else if(c.arguments&&\nc.stack)e=zk(c);else if(c.stack&&c.sourceURL)e=c.stack.replace(Bk(\"\\\\[native code\\\\]\\\\n\",\"m\"),\"\").replace(Bk(\"^(?\\x3d\\\\w+Error\\\\:).*$\\\\n\",\"m\"),\"\").replace(Bk(\"^@\",\"gm\"),\"{anonymous}()@\").split(\"\\n\");else if(c.stack&&c.number)e=c.stack.replace(Bk(\"^\\\\s*at\\\\s+(.*)$\",\"gm\"),\"$1\").replace(Bk(\"^Anonymous function\\\\s+\",\"gm\"),\"{anonymous}() \").replace(Bk(\"^([^\\\\(]+|\\\\{anonymous\\\\}\\\\(\\\\))\\\\s+\\\\((.+)\\\\)$\",\"gm\"),\"$1@$2\").split(\"\\n\").slice(1);else if(c.stack&&c.fileName)e=c.stack.replace(Bk(\"(?:\\\\n@:0)?\\\\s+$\",\n\"m\"),\"\").replace(Bk(\"^(?:\\\\((\\\\S*)\\\\))?@\",\"gm\"),\"{anonymous}($1)@\").split(\"\\n\");else if(c.message&&c[\"opera#sourceloc\"])if(c.stacktrace)if(-1c.stacktrace.split(\"\\n\").length)e=Gk(c);else{e=Bk(\"Line (\\\\d+).*script (?:in )?(\\\\S+)(?:: In function (\\\\S+))?$\",\"i\");c=c.stacktrace.split(\"\\n\");var f=[];for(var g=0,h=c.length|0;gc.stacktrace.indexOf(\"called from line\")){e=Ak(\"^(.*)@(.+):(\\\\d+)$\");c=c.stacktrace.split(\"\\n\");f=[];g=0;for(h=c.length|0;g>24&&(a.dl=Mc(xc(),(new qc).ge(Ob(function(b){return function(){return bn(b)}}(a))),(new qc).ge(Ob(function(b){return function(){0===(2&b.q)<<24>>24&&0===(2&b.q)<<24>>24&&(b.vn=yc(),b.q=(2|b.q)<<24>>24);return b.vn}}(a)))),a.q=(4|a.q)<<24>>24);return a.dl}function bn(a){0===(1&a.q)<<24>>24&&0===(1&a.q)<<24>>24&&(a.un=Sc(),a.q=(1|a.q)<<24>>24);return a.un}function pc(){var a=(new $m).a();return 0===(8&a.q)<<24>>24?cn(a):a.cl}\nfunction cn(a){if(0===(8&a.q)<<24>>24){var b=xc(),c=xc(),e=new dn,f=xc();a.cl=Gc(b,Jc(c,e,Mc(f,(new qc).ge(Ob(function(g){return function(){return bn(g)}}(a))),(new qc).ge(Ob(function(g){return function(){return 0===(4&g.q)<<24>>24?an(g):g.dl}}(a))))));a.q=(8|a.q)<<24>>24}return a.cl}$m.prototype.$classData=z({bp:0},!1,\"atcoder.ABC142F$anon$lazy$macro$9$1\",{bp:1,c:1,e:1,d:1});function en(){}en.prototype=new A;en.prototype.constructor=en;en.prototype.a=function(){fn=this;(new gn).a();return this};\nen.prototype.$classData=z({xp:0},!1,\"cats.Show$\",{xp:1,c:1,e:1,d:1});var fn=void 0;function hn(){fn||(fn=(new en).a())}function jn(){}jn.prototype=new ol;jn.prototype.constructor=jn;function kn(){}kn.prototype=jn.prototype;function ln(){this.ma=!1}ln.prototype=new A;ln.prototype.constructor=ln;function mn(){}mn.prototype=ln.prototype;function Xd(){this.cj=this.Dm=0;this.ce=null;this.ma=this.hd=0}Xd.prototype=new A;Xd.prototype.constructor=Xd;d=Xd.prototype;\nd.a=function(){Xd.prototype.ua.call(this,8);return this};d.m=function(){return 0===this.hd&&null===this.ce.b[0]};d.qu=function(a,b){this.Dm=b;this.cj=-1+b|0;this.ma=(1|this.ma)<<24>>24;this.ce=a;this.ma=(2|this.ma)<<24>>24;this.hd=0;this.ma=(4|this.ma)<<24>>24};function Id(a){if(0===a.hd)if(null!==a.ce.b[0])a.ce=a.ce.b[0],a.hd=a.cj;else return null;var b=a.ce.b[a.hd];a.ce.b[a.hd]=null;a.hd=-1+a.hd|0;return b}d.ua=function(a){Xd.prototype.qu.call(this,r(D(C),[a]),a);return this};\nfunction Yd(a,b){if(a.hd===a.cj){var c=r(D(C),[a.Dm]);c.b[0]=a.ce;a.ce=c;a.hd=1}else a.hd=1+a.hd|0;a.ce.b[a.hd]=b}d.$classData=z({Vp:0},!1,\"cats.effect.internals.ArrayStack\",{Vp:1,c:1,e:1,d:1});function nn(){this.s=this.pg=this.jh=this.xe=null;this.ma=!1}nn.prototype=new A;nn.prototype.constructor=nn;d=nn.prototype;d.l=function(a){this.gh(a)};d.Yk=function(a,b){this.xe=a;this.jh=b;this.pg=(new on).$e(!0);this.ma=!0;return this};d.Lj=function(){this.jh.l(this.s)};d.n=function(){return\"\\x3cfunction1\\x3e\"};\nd.gh=function(a){var b=this.pg,c=b.s;b.s=!1;if(c)null!==this.xe&&this.xe.fo(),this.s=a,ue().oh(this);else if(!(a instanceof wc))if(a instanceof Fc)a=a.E,nd().l(a);else throw(new J).j(a);};d.Rb=function(a){return jb(this,a)};d.$classData=z({Yp:0},!1,\"cats.effect.internals.Callback$AsyncIdempotentCallback\",{Yp:1,c:1,P:1,Jn:1});function vd(){this.Pk=this.Se=null;this.ue=!1}vd.prototype=new zl;vd.prototype.constructor=vd;vd.prototype.l=function(){return ud(this)};\nfunction ud(a){if(a.Se.r()){var b=a.Se.u();return ge(new Wd,b,a)}b=a.Pk.Sa();if(M().t(b))return sd();if(b instanceof N){a=b.th;for(b=b.uc;!b.m();){var c=b.w();nd().l(c);b=b.cb()}Mb();return Vd(a)}throw(new J).j(b);}vd.prototype.ml=function(a){pn(this.Pk,a);return ud(this)};vd.prototype.bl=function(a){this.Se=a;qn();this.Pk=(new rn).Bg((new sn).a()).Lb;this.ue=!0;return this};vd.prototype.$classData=z({$p:0},!1,\"cats.effect.internals.CancelUtils$CancelAllFrame\",{$p:1,eq:1,c:1,P:1});\nfunction ce(){this.xe=this.jh=null;this.Ml=this.pg=!1;this.s=this.Fk=this.Ek=null;this.ma=0}ce.prototype=new A;ce.prototype.constructor=ce;d=ce.prototype;d.l=function(a){this.gh(a)};d.Yk=function(a,b){this.jh=b;this.xe=a;this.ma=(1|this.ma)<<24>>24;this.pg=!1;this.ma=(2|this.ma)<<24>>24;this.Ml=!1;this.ma=(4|this.ma)<<24>>24;return this};\nfunction tn(a,b){var c=a.Ek,e=a.Fk;a.Ek=null;a.Fk=null;if(!a.xe.el())if(b instanceof wc)b=b.E,Pd(Qd(),(new Zd).j(b),a.xe,a.jh,a,c,e);else if(b instanceof Fc)b=b.E,Pd(Qd(),Vd(b),a.xe,a.jh,a,c,e);else throw(new J).j(b);}d.Lj=function(){var a=this.s;this.s=null;tn(this,a)};d.n=function(){return\"\\x3cfunction1\\x3e\"};d.gh=function(a){this.pg&&(this.pg=!1,this.Ml?(this.s=a,ue().oh(this)):tn(this,a))};d.Rb=function(a){return jb(this,a)};\nd.$classData=z({iq:0},!1,\"cats.effect.internals.IORunLoop$RestartCallback\",{iq:1,c:1,P:1,Jn:1});function fe(){this.Hg=this.ll=null}fe.prototype=new zl;fe.prototype.constructor=fe;fe.prototype.l=function(a){return this.Ck(a)};fe.prototype.ml=function(a){return un(new ee,Vd(a),F(function(b,c){return function(e){return og(0,c|0,b.ll|0,e|0)}}(this,a)))};fe.prototype.Ck=function(a){return un(new ee,(new Zd).j(a),F(function(b,c){return function(e){return og(c|0,0,b.ll|0,e|0)}}(this,a)))};\nfe.prototype.$classData=z({jq:0},!1,\"cats.effect.internals.IORunLoop$RestoreContext\",{jq:1,eq:1,c:1,P:1});function Ne(){}Ne.prototype=new A;Ne.prototype.constructor=Ne;Ne.prototype.a=function(){Le=this;(new Q).j(vn());(new Q).j(wn());(new Q).j(xn());(new yn).a();return this};Ne.prototype.$classData=z({lr:0},!1,\"cats.kernel.Comparison$\",{lr:1,c:1,e:1,d:1});var Le=void 0;function zn(){}zn.prototype=new Fl;zn.prototype.constructor=zn;function An(){}An.prototype=zn.prototype;function Bn(){}\nBn.prototype=new Hl;Bn.prototype.constructor=Bn;function Cn(){}Cn.prototype=Bn.prototype;function Dn(){this.Bn=this.Bk=this.Yl=this.Mh=this.fl=this.lg=this.xf=this.be=null}Dn.prototype=new A;Dn.prototype.constructor=Dn;function En(a,b,c){return 0===c?Fn(a,b):0===b.f&&0===b.i&&0<=c&&cb;)c=b,c=(new Gn).g(c,0),a.push(c),b=1+b|0;this.Yl=ka(D(Kn),a);a=[];for(b=0;11>b;)c=b,c=(new Gn).g(0,c),a.push(c),b=1+b|0;this.Bk=ka(D(Kn),a);\nthis.Bn=\"0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000\";return this};function Ln(a,b,c,e){a=0>c?-c|0:c;var f=0===c?0:0>c?-1:1;if(Tf().Ak===e)return f;if(Tf().ik===e)return 0;if(Tf().hk===e)return 0f?f:0;if(Tf().mk===e)return 5<=a?f:0;if(Tf().lk===e)return 5(-2147483648^b.f):-1>a)?a=!0:(a=b.i,a=0===a?-1<(-2147483648^b.f):0(-2147483648^b.f):0>c}else c=!1;return c?a.Yl.b[b.f]:(new Gn).Xk(b,0)}function Jn(a,b){b=0>b.i?(new x).g(~b.f,~b.i):b;a=b.f;b=b.i;return 64-(0!==b?da(b):32+da(a)|0)|0}\nfunction In(a,b){var c=[];if(0>31,k=65535&e,m=e>>>16|0,p=65535&b,q=b>>>16|0,t=n(k,p);p=n(m,p);var u=n(k,q);k=t+((p+u|0)<<16)|0;t=(t>>>16|0)+u|0;e=(((n(e,h)+n(g,b)|0)+n(m,q)|0)+(t>>>16|0)|0)+(((65535&t)+p|0)>>>16|0)|0;e=(new x).g(k,e);f=1+f|0;g=e;c.push(null===g?null:g)}}return ka(D(Xa),c)}Dn.prototype.$classData=z({As:0},!1,\"java.math.BigDecimal$\",{As:1,c:1,e:1,d:1});var Hn=void 0;\nfunction Y(){Hn||(Hn=(new Dn).a());return Hn}function On(){this.yk=this.sm=this.Si=this.be=this.lg=this.xf=null}On.prototype=new A;On.prototype.constructor=On;\nOn.prototype.a=function(){Pn=this;this.xf=(new Jf).g(1,1);this.lg=(new Jf).g(1,10);this.be=(new Jf).g(0,0);this.Si=(new Jf).g(-1,1);this.sm=ka(D(bf),[this.be,this.xf,(new Jf).g(1,2),(new Jf).g(1,3),(new Jf).g(1,4),(new Jf).g(1,5),(new Jf).g(1,6),(new Jf).g(1,7),(new Jf).g(1,8),(new Jf).g(1,9),this.lg]);var a=[];for(var b=0;32>b;){var c=b;c=Kf(lf(),(new x).g(0===(32&c)?1<b.i)return-1!==b.f||-1!==b.i?(a=b.f,b=b.i,Qn(new Jf,-1,(new x).g(-a|0,0!==a?~b:-b|0))):a.Si;var c=b.i;return(0===c?-2147483638>=(-2147483648^b.f):0>c)?a.sm.b[b.f]:Qn(new Jf,1,b)}On.prototype.$classData=z({Cs:0},!1,\"java.math.BigInteger$\",{Cs:1,c:1,e:1,d:1});var Pn=void 0;function lf(){Pn||(Pn=(new On).a());return Pn}function Rn(){this.zk=this.Ji=this.lk=this.mk=this.kk=this.hk=this.ik=this.Ak=null}Rn.prototype=new A;Rn.prototype.constructor=Rn;\nRn.prototype.a=function(){Sn=this;this.Ak=(new Tn).ec(\"UP\",0);this.ik=(new Tn).ec(\"DOWN\",1);this.hk=(new Tn).ec(\"CEILING\",2);this.kk=(new Tn).ec(\"FLOOR\",3);this.mk=(new Tn).ec(\"HALF_UP\",4);this.lk=(new Tn).ec(\"HALF_DOWN\",5);this.Ji=(new Tn).ec(\"HALF_EVEN\",6);this.zk=(new Tn).ec(\"UNNECESSARY\",7);ka(D(Un),[this.Ak,this.ik,this.hk,this.kk,this.mk,this.lk,this.Ji,this.zk]);return this};Rn.prototype.$classData=z({Ms:0},!1,\"java.math.RoundingMode$\",{Ms:1,c:1,e:1,d:1});var Sn=void 0;\nfunction Tf(){Sn||(Sn=(new Rn).a());return Sn}function Vn(){this.gj=null}Vn.prototype=new A;Vn.prototype.constructor=Vn;Vn.prototype.a=function(){this.gj=\", \";return this};Vn.prototype.$classData=z({Ps:0},!1,\"scalax.collection.GraphBase$\",{Ps:1,c:1,e:1,d:1});var Wn=void 0;function Xn(){Wn||(Wn=(new Vn).a());return Wn}function Yn(){this.k=this.mj=null}Yn.prototype=new A;Yn.prototype.constructor=Yn;Yn.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};\nfunction Zn(a,b){var c=$n(a.k.ac,b);return null===c?a.mj.sh(b,Ob(function(e,f){return function(){var g=e.k,h=g.rg.Pe;g=ao(new bo,g,f,h);e.mj=e.mj.Ke((new K).Q(f,g));return g}}(a,b))):c}\nfunction co(a,b){a.mj=eo();switch(Tl(b)){case 2:a=(new K).Q(Zn(a,b.Xa.U(0)),Zn(a,fo(b)));break;case 3:a=(new go).uj(Zn(a,b.Xa.U(0)),Zn(a,fo(b)),Zn(a,ho(b,2)));break;case 4:a=(new io).Nf(Zn(a,b.Xa.U(0)),Zn(a,fo(b)),Zn(a,ho(b,2)),Zn(a,ho(b,3)));break;case 5:var c=new jo,e=Zn(a,b.Xa.U(0)),f=Zn(a,fo(b)),g=Zn(a,ho(b,2)),h=Zn(a,ho(b,3));a=Zn(a,ho(b,4));c.lc=e;c.nc=f;c.pc=g;c.Fd=h;c.ah=a;a=c;break;default:c=bh().G;c=Wb(b,c);for(b=ko(b);b.r();)e=b.u(),c.Ta(Zn(a,e));a=c.Ca().Sa()}return(new Ub).af(a)}\nYn.prototype.$classData=z({Rs:0},!1,\"scalax.collection.GraphBase$Edge$\",{Rs:1,c:1,e:1,d:1});function lo(){this.k=null}lo.prototype=new A;lo.prototype.constructor=lo;lo.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};lo.prototype.$classData=z({Ss:0},!1,\"scalax.collection.GraphBase$EdgeOrdering$\",{Ss:1,c:1,e:1,d:1});function mo(){this.k=null}mo.prototype=new A;mo.prototype.constructor=mo;function no(a,b){a=a.k;var c=a.rg.Pe;return ao(new bo,a,b,c)}\nmo.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};mo.prototype.$classData=z({Ws:0},!1,\"scalax.collection.GraphBase$Node$\",{Ws:1,c:1,e:1,d:1});function oo(){this.k=null}oo.prototype=new A;oo.prototype.constructor=oo;oo.prototype.Ze=function(a){if(null===a)throw T(S(),null);this.k=a;return this};oo.prototype.$classData=z({Xs:0},!1,\"scalax.collection.GraphBase$NodeOrdering$\",{Xs:1,c:1,e:1,d:1});function po(){this.Tn=null}po.prototype=new A;po.prototype.constructor=po;\npo.prototype.a=function(){this.Tn=\"~\\x3e\";return this};po.prototype.$classData=z({$s:0},!1,\"scalax.collection.GraphEdge$DiEdgeLike$\",{$s:1,c:1,e:1,d:1});var qo=void 0;function ro(a){return!!(a&&a.$classData&&a.$classData.qa.mm)}function so(a){return!!(a&&a.$classData&&a.$classData.qa.jt)}function to(a){return!!(a&&a.$classData&&a.$classData.qa.nm)}function uo(){}uo.prototype=new A;uo.prototype.constructor=uo;uo.prototype.$classData=z({lt:0},!1,\"scalax.collection.State$$anon$1\",{lt:1,c:1,e:1,d:1});\nfunction vo(){y()}vo.prototype=new A;vo.prototype.constructor=vo;function wo(){var a=new vo;ig||(ig=(new hg).a());(new xo).ua(yo().mn);return a}vo.prototype.$classData=z({mt:0},!1,\"scalax.collection.State$FlagStore\",{mt:1,c:1,e:1,d:1});function zo(a){if(a.r())return a.Wn(R()),a.Ih;throw(new V).a();}function Ao(){this.k=this.ek=this.Fi=null}Ao.prototype=new A;Ao.prototype.constructor=Ao;\nfunction Bo(a){if(null===a.k.Ve)return(new Co).ua(32);if(null===a.ek){var b=(new Co).ua(a.k.Ve.x());a.Fi=R();var c=a.k.Ve,e=function(k,m){return function(p){Sl(k.k.k);var q=p.ra,t=k.k,u=k.k;if(q=q.Xa.U(0)===t&&fo(q)===u)null===k.Fi&&Bo(k),q=k.Fi.m();q&&(k.Fi=(new Q).j((new K).Q(k.k,p)));q=k.k;Sl(q.k);Sl(q.k);t=fo(p.ra);t!==q&&Do(m,t,p)}}(a,b);if(null===c.pb){c=c.vd;for(var f=0,g=c.Ya.b.length;fb)a=48<=b&&57>=b?-48+b|0:65<=b&&90>=b?-55+b|0:97<=b&&122>=b?-87+b|0:-1;else if(65313<=b&&65338>=b)a=-65303+b|0;else if(65345<=b&&65370>=b)a=-65335+b|0;else{var e=Dg(Jg(),Ko(a),b);e=0>e?-2-e|0:e;0>e?a=-1:(a=b-Ko(a).b[e]|0,a=9>24&&0===(16&a.q)<<24>>24&&(a.Un=ka(D(E),[1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43600,44016,65296,66720,69734,69872,69942,70096,71360,120782,120792,120802,120812,120822]),a.q=(16|a.q)<<24>>24);return a.Un}Io.prototype.$classData=z({Fu:0},!1,\"java.lang.Character$\",{Fu:1,c:1,e:1,d:1});var Lo=void 0;function Mo(){Lo||(Lo=(new Io).a());return Lo}\nfunction No(){this.$m=this.an=null;this.q=0}No.prototype=new A;No.prototype.constructor=No;No.prototype.a=function(){return this};No.prototype.ph=function(a){throw(new Oo).h('For input string: \"'+a+'\"');};function Po(a,b,c){return b!==b?c!==c?0:1:c!==c?-1:b===c?0===b?(a=1/b,a===1/c?0:0>a?-1:1):0:b>24&&0===(1&a.q)<<24>>24&&(a.an=new l.RegExp(\"^[\\\\x00-\\\\x20]*([+-]?(?:NaN|Infinity|(?:\\\\d+\\\\.?\\\\d*|\\\\.\\\\d+)(?:[eE][+-]?\\\\d+)?)[fFdD]?)[\\\\x00-\\\\x20]*$\"),a.q=(1|a.q)<<24>>24);var c=a.an.exec(b);if(null!==c)return c=c[1],+l.parseFloat(void 0===c?void 0:c);0===(2&a.q)<<24>>24&&0===(2&a.q)<<24>>24&&(a.$m=new l.RegExp(\"^[\\\\x00-\\\\x20]*([+-]?)0[xX]([0-9A-Fa-f]*)\\\\.?([0-9A-Fa-f]*)[pP]([+-]?\\\\d+)[fFdD]?[\\\\x00-\\\\x20]*$\"),a.q=(2|a.q)<<24>>24);var e=a.$m.exec(b);if(null!==e){c=\ne[1];var f=e[2],g=e[3];e=e[4];\"\"===f&&\"\"===g&&a.ph(b);b=\"\"+f+g;a=-((g.length|0)<<2)|0;for(g=0;;)if(g!==(b.length|0)&&48===(65535&(b.charCodeAt(g)|0)))g=1+g|0;else break;g=b.substring(g);\"\"===g?c=\"-\"===c?-0:0:(b=(f=15<(g.length|0))?g.substring(0,15):g,g=a+(f?(-15+(g.length|0)|0)<<2:0)|0,a=+l.parseInt(b,16),e=+l.parseInt(e,10),b=Ja(e)+g|0,g=b/3|0,e=+l.Math.pow(2,g),b=+l.Math.pow(2,b-(g<<1)|0),e=a*e*e*b,c=\"-\"===c?-e:e)}else c=a.ph(b);return c}\nNo.prototype.$classData=z({Iu:0},!1,\"java.lang.Double$\",{Iu:1,c:1,e:1,d:1});var Ro=void 0;function So(){Ro||(Ro=(new No).a());return Ro}function To(){this.Rl=null;this.Tl=0}To.prototype=new A;To.prototype.constructor=To;function Uo(){}Uo.prototype=To.prototype;To.prototype.t=function(a){return this===a};To.prototype.n=function(){return this.Rl};To.prototype.ec=function(a,b){this.Rl=a;this.Tl=b;return this};To.prototype.z=function(){return Ia(this)};function Vo(){W.call(this)}Vo.prototype=new Zl;\nVo.prototype.constructor=Vo;function Wo(){}Wo.prototype=Vo.prototype;function Xo(){W.call(this)}Xo.prototype=new Zl;Xo.prototype.constructor=Xo;function Yo(){}Yo.prototype=Xo.prototype;function Zo(){}Zo.prototype=new A;Zo.prototype.constructor=Zo;Zo.prototype.a=function(){return this};Zo.prototype.ph=function(a){throw(new Oo).h('For input string: \"'+a+'\"');};\nfunction Wc(a,b,c){var e=null===b?0:b.length|0;(0===e||2>c||36=(b.length|0)&&a.ph(b);for(var k=0;f!==e;){var m=Jo(Mo(),65535&(b.charCodeAt(f)|0),c);k=k*c+m;(-1===m||k>h)&&a.ph(b);f=1+f|0}return g?-k|0:k|0}function oj(a,b){a=b-(1431655765&b>>1)|0;a=(858993459&a)+(858993459&a>>2)|0;return n(16843009,252645135&(a+(a>>4)|0))>>24}Zo.prototype.$classData=z({Lu:0},!1,\"java.lang.Integer$\",{Lu:1,c:1,e:1,d:1});\nvar $o=void 0;function Xc(){$o||($o=(new Zo).a());return $o}function ap(){this.tm=null;this.q=!1}ap.prototype=new A;ap.prototype.constructor=ap;ap.prototype.a=function(){return this};function bp(a){throw(new Oo).h('For input string: \"'+a+'\"');}function cp(a,b,c){for(var e=0;a!==b;){var f=Jo(Mo(),65535&(c.charCodeAt(a)|0),10);-1===f&&bp(c);e=n(e,10)+f|0;a=1+a|0}return e}ap.prototype.$classData=z({Pu:0},!1,\"java.lang.Long$\",{Pu:1,c:1,e:1,d:1});var dp=void 0;\nfunction ok(){dp||(dp=(new ap).a());return dp}function ep(){this.bh=this.Ki=this.Ti=this.Zi=this.Ri=this.Qi=this.Ui=null}ep.prototype=new A;ep.prototype.constructor=ep;ep.prototype.a=function(){fp=this;this.Ui=(new gp).a();this.Qi=(new hp).a();this.Ri=(new ip).a();this.Zi=(new jp).a();this.Ti=(new kp).a();this.Ki=(new lp).a();this.bh=(new mp).a();ka(D(np),[this.Ui,this.Qi,this.Ri,this.Zi,this.Ti,this.Ki,this.bh]);return this};\nfunction op(a,b,c,e){a=b.i;var f=e.i;if(a===f?(-2147483648^b.f)>(-2147483648^e.f):a>f)return(new x).g(-1,2147483647);a=e.f;e=e.i;e=0!==a?~e:-e|0;f=b.i;if(f===e?(-2147483648^b.f)<(-2147483648^(-a|0)):f>>16|0;var h=65535&a,k=a>>>16|0,m=n(g,h);h=n(f,h);var p=n(g,k);g=m+((h+p|0)<<16)|0;m=(m>>>16|0)+p|0;b=(((n(e,c.i)+n(b.i,a)|0)+n(f,k)|0)+(m>>>16|0)|0)+(((65535&m)+h|0)>>>16|0)|0;return(new x).g(g,b)}\nep.prototype.$classData=z({qv:0},!1,\"java.util.concurrent.TimeUnit$\",{qv:1,c:1,e:1,d:1});var fp=void 0;function Z(){fp||(fp=(new ep).a());return fp}function on(){this.s=!1}on.prototype=new A;on.prototype.constructor=on;on.prototype.n=function(){return\"\"+this.s};on.prototype.$e=function(a){this.s=a;return this};on.prototype.$classData=z({yv:0},!1,\"java.util.concurrent.atomic.AtomicBoolean\",{yv:1,c:1,e:1,d:1});function xl(){this.s=null}xl.prototype=new A;xl.prototype.constructor=xl;\nxl.prototype.n=function(){return\"\"+this.s};xl.prototype.j=function(a){this.s=a;return this};xl.prototype.$classData=z({zv:0},!1,\"java.util.concurrent.atomic.AtomicReference\",{zv:1,c:1,e:1,d:1});function Mj(){this.Ul=this.Dg=null}Mj.prototype=new A;Mj.prototype.constructor=Mj;Mj.prototype.n=function(){return this.Ul};Mj.prototype.$classData=z({Bv:0},!1,\"java.util.regex.Pattern\",{Bv:1,c:1,e:1,d:1});function pp(){this.Dn=this.En=null}pp.prototype=new A;pp.prototype.constructor=pp;\npp.prototype.a=function(){qp=this;this.En=new l.RegExp(\"^\\\\\\\\Q(.|\\\\n|\\\\r)\\\\\\\\E$\");this.Dn=new l.RegExp(\"^\\\\(\\\\?([idmsuxU]*)(?:-([idmsuxU]*))?\\\\)\");return this};function Kj(a){for(var b=\"\",c=0;c<(a.length|0);){var e=65535&(a.charCodeAt(c)|0);switch(e){case 92:case 46:case 40:case 41:case 91:case 93:case 123:case 125:case 124:case 63:case 42:case 43:case 94:case 36:e=\"\\\\\"+Zj(e);break;default:e=Zj(e)}b=\"\"+b+e;c=1+c|0}return b}\nfunction Lj(a,b){switch(b){case 105:return 2;case 100:return 1;case 109:return 8;case 115:return 32;case 117:return 64;case 120:return 4;case 85:return 256;default:throw(new Bb).h(\"bad in-pattern flag\");}}pp.prototype.$classData=z({Cv:0},!1,\"java.util.regex.Pattern$\",{Cv:1,c:1,e:1,d:1});var qp=void 0;function Jj(){qp||(qp=(new pp).a());return qp}function rp(){}rp.prototype=new A;rp.prototype.constructor=rp;rp.prototype.a=function(){return this};function sp(a,b){return null===b?R():(new Q).j(b)}\nrp.prototype.$classData=z({Lv:0},!1,\"scala.Option$\",{Lv:1,c:1,e:1,d:1});var tp=void 0;function up(){tp||(tp=(new rp).a());return tp}function vp(){this.Fl=this.Nh=null}vp.prototype=new Pg;vp.prototype.constructor=vp;vp.prototype.a=function(){Cp=this;vc();L();Dp||(Dp=(new Ep).a());Fp();ni||(ni=(new mi).a());ni||(ni=(new mi).a());Gp||(Gp=(new Hp).a());this.Nh=(new em).a();this.Fl=(new Ip).a();(new Jp).a();return this};function jg(a,b){if(!b)throw(new Bb).h(\"requirement failed\");}\nvp.prototype.$classData=z({Nv:0},!1,\"scala.Predef$\",{Nv:1,DH:1,c:1,BH:1});var Cp=void 0;function Cc(){Cp||(Cp=(new vp).a());return Cp}function Kp(){this.vm=this.mg=this.Mo=this.Ll=null}Kp.prototype=new A;Kp.prototype.constructor=Kp;\nKp.prototype.a=function(){Lp=this;L();var a=Z().bh;a=(new K).Q(a,\"d day\");var b=Z().Ki;b=(new K).Q(b,\"h hour\");var c=Z().Ti;c=(new K).Q(c,\"min minute\");var e=Z().Zi;e=(new K).Q(e,\"s sec second\");var f=Z().Ri;f=(new K).Q(f,\"ms milli millisecond\");var g=Z().Qi;g=(new K).Q(g,\"\\u00b5s micro microsecond\");var h=Z().Ui;a=[a,b,c,e,f,g,(new K).Q(h,\"ns nano nanosecond\")];b=-1+(a.length|0)|0;for(c=M();0<=b;)c=Vb(new N,a[b],c),b=-1+b|0;b=this.Ll=c;for(a=Mp(new Np,eo());!b.m();)c=b.w(),Op(a,c),b=b.cb();this.Mo=\nPp(new Qp,a.Lb,F(function(){return function(k){k=Rp(sl(),k);return Sp(k)}}(this)));b=this.Ll;a=function(k){return function(m){if(null!==m){var p=m.Ga();m=m.Qa();m=Tp(sl(),m);p=function(v,B){return function(P){return(new K).Q(P,B)}}(k,p);var q=L().G;if(q===L().G){if(m===M())return M();q=m.w();var t=q=Vb(new N,p(q),M());for(m=m.cb();m!==M();){var u=m.w();u=Vb(new N,p(u),M());t=t.uc=u;m=m.cb()}return q}for(q=Wb(m,q);!m.m();)t=m.w(),q.Ta(p(t)),m=m.cb();return q.Ca()}throw(new J).j(m);}}(this);if(L().G===\nL().G)if(b===M())a=M();else{c=b;e=(new Oi).$e(!1);f=(new ie).j(null);for(g=(new ie).j(null);c!==M();)h=c.w(),a(h).pa().K(F(function(k,m,p,q){return function(t){m.o?(t=Vb(new N,t,M()),q.o.uc=t,q.o=t):(p.o=Vb(new N,t,M()),q.o=p.o,m.o=!0)}}(b,e,f,g))),c=c.cb();a=e.o?f.o:M()}else{L();for(c=(new sn).a();!b.m();)e=b.w(),e=a(e).pa(),Up(c,e),b=b.cb();a=c.Sa()}a.Qb(Cc().Fl);this.mg=Vp();this.vm=(new Wp).a();(new Xp).a();(new Yp).a();return this};\nfunction Rp(a,b){a=b.trim();a=Ic(Fa(),a,\"\\\\s+\");b=-1+a.b.length|0;for(var c=M();0<=b;)c=Vb(new N,a.b[b],c),b=-1+b|0;return c}\nfunction Tp(a,b){var c=Rp(0,b);if(!(c instanceof N))throw(new J).j(c);b=c.th;c=c.uc;a=function(){return function(m){L();m=[m,m+\"s\"];for(var p=-1+(m.length|0)|0,q=M();0<=p;)q=Vb(new N,m[p],q),p=-1+p|0;return q}}(a);if(L().G===L().G)if(c===M())a=M();else{for(var e=c,f=(new Oi).$e(!1),g=(new ie).j(null),h=(new ie).j(null);e!==M();){var k=e.w();a(k).pa().K(F(function(m,p,q,t){return function(u){p.o?(u=Vb(new N,u,M()),t.o.uc=u,t.o=u):(q.o=Vb(new N,u,M()),t.o=q.o,p.o=!0)}}(c,f,g,h)));e=e.cb()}a=f.o?g.o:\nM()}else{L();for(e=(new sn).a();!c.m();)f=c.w(),f=a(f).pa(),Up(e,f),c=c.cb();a=e.Sa()}return Vb(new N,b,a)}Kp.prototype.$classData=z({Zv:0},!1,\"scala.concurrent.duration.Duration$\",{Zv:1,c:1,e:1,d:1});var Lp=void 0;function sl(){Lp||(Lp=(new Kp).a());return Lp}function Zp(){this.Cf=null;this.Sf=this.Fe=0;this.mh=null;this.q=!1}Zp.prototype=new A;Zp.prototype.constructor=Zp;Zp.prototype.a=function(){$p=this;this.Fe=-512;this.Sf=512;this.mh=Sf().$l;return this};\nfunction aq(a){a.q||(a.Cf=r(D(bq),[1+(a.Sf-a.Fe|0)|0]),a.q=!0);return a.Cf}function cq(a,b){var c=new dq,e=new Gn;a=\"\"+a;Gn.prototype.pu.call(e,Rj(Fa(),a),a.length|0);eq(e,b);return fq(c,e,b)}Zp.prototype.$classData=z({ew:0},!1,\"scala.math.BigDecimal$\",{ew:1,c:1,e:1,d:1});var $p=void 0;function gq(){$p||($p=(new Zp).a());return $p}function hq(){this.Sf=this.Fe=0;this.ro=this.Cf=null}hq.prototype=new A;hq.prototype.constructor=hq;\nhq.prototype.a=function(){iq=this;this.Fe=-1024;this.Sf=1024;this.Cf=r(D(jq),[1+(this.Sf-this.Fe|0)|0]);this.ro=Kf(lf(),(new x).g(-1,-1));return this};function kq(a,b){if(a.Fe<=b&&b<=a.Sf){var c=b-a.Fe|0,e=a.Cf.b[c];null===e&&(e=lf(),e=(new lq).Ag(Kf(e,(new x).g(b,b>>31))),a.Cf.b[c]=e);return e}a=lf();return(new lq).Ag(Kf(a,(new x).g(b,b>>31)))}\nfunction mq(a,b){var c=a.Fe,e=c>>31,f=b.i;(e===f?(-2147483648^c)<=(-2147483648^b.f):e>31,f=b.i,c=f===e?(-2147483648^b.f)<=(-2147483648^c):f>>0)):Gq(a,b,c,1E9,0,2)}function uf(a,b,c,e,f){if(0===(e|f))throw(new Mn).h(\"/ by zero\");if(c===b>>31){if(f===e>>31){if(-2147483648===b&&-1===e)return a.M=0,-2147483648;var g=b/e|0;a.M=g>>31;return g}return-2147483648===b&&-2147483648===e&&0===f?a.M=-1:a.M=0}if(g=0>c){var h=-b|0;c=0!==b?~c:-c|0}else h=b;if(b=0>f){var k=-e|0;e=0!==e?~f:-f|0}else k=e,e=f;h=Hq(a,h,c,k,e);if(g===b)return h;g=a.M;a.M=0!==h?~g:-g|0;return-h|0}\nfunction Rk(a,b,c){return 0>c?-(4294967296*+((0!==b?~c:-c|0)>>>0)+ +((-b|0)>>>0)):4294967296*c+ +(b>>>0)}function kl(a,b){if(-9223372036854775808>b)return a.M=-2147483648,0;if(0x7fffffffffffffff<=b)return a.M=2147483647,-1;var c=b|0,e=b/4294967296|0;a.M=0>b&&0!==c?-1+e|0:e;return c}\nfunction Hq(a,b,c,e,f){return 0===(-2097152&c)?0===(-2097152&f)?(c=(4294967296*c+ +(b>>>0))/(4294967296*f+ +(e>>>0)),a.M=c/4294967296|0,c|0):a.M=0:0===f&&0===(e&(-1+e|0))?(e=31-da(e)|0,a.M=c>>>e|0,b>>>e|0|c<<1<<(31-e|0)):0===e&&0===(f&(-1+f|0))?(b=31-da(f)|0,a.M=0,c>>>b|0):Gq(a,b,c,e,f,0)|0}function wf(a,b,c,e,f){if(0===(e|f))throw(new Mn).h(\"/ by zero\");return 0===c?0===f?(a.M=0,+(b>>>0)/+(e>>>0)|0):a.M=0:Hq(a,b,c,e,f)}\nfunction mk(a,b,c){return c===b>>31?\"\"+b:0>c?\"-\"+Fq(a,-b|0,0!==b?~c:-c|0):Fq(a,b,c)}function Iq(a,b,c,e,f){return c===f?b===e?0:(-2147483648^b)<(-2147483648^e)?-1:1:c>>1|0)>>>(31-k|0)|0|f<=(-2147483648^v):(-2147483648^u)>=(-2147483648^B))t=q,u=p,q=k-m|0,t=(-2147483648^q)>(-2147483648^k)?-1+(t-u|0)|0:t-u|0,k=q,q=t,32>h?c|=1<>>1|0;m=m>>>1|0|p<<31;p=t}h=q;if(h===f?(-2147483648^k)>=(-2147483648^e):(-2147483648^h)>=(-2147483648^\nf))h=4294967296*q+ +(k>>>0),e=4294967296*f+ +(e>>>0),1!==g&&(p=h/e,f=p/4294967296|0,m=c,c=p=m+(p|0)|0,b=(-2147483648^p)<(-2147483648^m)?1+(b+f|0)|0:b+f|0),0!==g&&(e=h%e,k=e|0,q=e/4294967296|0);if(0===g)return a.M=b,c;if(1===g)return a.M=q,k;a=\"\"+k;return\"\"+(4294967296*b+ +(c>>>0))+\"000000000\".substring(a.length|0)+a}\nfunction gg(a,b,c,e,f){if(0===(e|f))throw(new Mn).h(\"/ by zero\");if(c===b>>31){if(f===e>>31){if(-1!==e){var g=b%e|0;a.M=g>>31;return g}return a.M=0}if(-2147483648===b&&-2147483648===e&&0===f)return a.M=0;a.M=c;return b}if(g=0>c){var h=-b|0;c=0!==b?~c:-c|0}else h=b;0>f?(b=-e|0,e=0!==e?~f:-f|0):(b=e,e=f);f=c;0===(-2097152&f)?0===(-2097152&e)?(h=(4294967296*f+ +(h>>>0))%(4294967296*e+ +(b>>>0)),a.M=h/4294967296|0,h|=0):a.M=f:0===e&&0===(b&(-1+b|0))?(a.M=0,h&=-1+b|0):0===b&&0===(e&(-1+e|0))?a.M=f&(-1+\ne|0):h=Gq(a,h,f,b,e,1)|0;return g?(g=a.M,a.M=0!==h?~g:-g|0,-h|0):h}Dq.prototype.$classData=z({zz:0},!1,\"scala.scalajs.runtime.RuntimeLong$\",{zz:1,c:1,e:1,d:1});var Eq=void 0;function y(){Eq||(Eq=(new Dq).a());return Eq}var Jq=z({Iz:0},!1,\"scala.runtime.Nothing$\",{Iz:1,hb:1,c:1,d:1});function dn(){}dn.prototype=new A;dn.prototype.constructor=dn;function Lc(a){if(null!==a){var b=a.Uc|0,c=a.xb;if(null!==c){var e=c.Uc|0;c=c.xb;if(Ac()===c)return(new Kq).g(b,e)}}throw(new J).j(a);}\ndn.prototype.$classData=z({cp:0},!1,\"atcoder.ABC142F$anon$lazy$macro$9$1$anon$macro$5$1\",{cp:1,c:1,tH:1,e:1,d:1});function Ee(){}Ee.prototype=new A;Ee.prototype.constructor=Ee;Ee.prototype.a=function(){return this};Ee.prototype.$classData=z({Dp:0},!1,\"cats.arrow.FunctionK$$anon$4\",{Dp:1,c:1,HA:1,e:1,d:1});function Lq(){}Lq.prototype=new kn;Lq.prototype.constructor=Lq;function Mq(){}Mq.prototype=Lq.prototype;z({Tp:0},!1,\"cats.effect.IOInstances$$anon$7\",{Tp:1,c:1,wf:1,e:1,d:1});\nfunction Nq(){this.ma=!1;this.wn=null;this.ue=!1}Nq.prototype=new mn;Nq.prototype.constructor=Nq;function Oq(){}Oq.prototype=Nq.prototype;Nq.prototype.a=function(){var a=new Pq;if(null===this)throw T(S(),null);a.k=this;this.wn=a;this.ue=!0;return this};function mc(){var a=Mb();if(!a.ue)throw(new ve).h(\"Uninitialized field: /Users/daniel/Development/Scala/cats-effect/core/shared/src/main/scala/cats/effect/IO.scala: 765\");return a.wn}function Bl(){this.Ph=null;this.ma=this.Wc=0;this.k=null}\nBl.prototype=new A;Bl.prototype.constructor=Bl;d=Bl.prototype;d.pa=function(){return this};d.u=function(){0===this.Wc&&(this.Ph=this.Ph.b[0],this.Wc=this.k.cj);var a=this.Ph.b[this.Wc];this.Wc=-1+this.Wc|0;return a};d.Yb=function(a,b){Hi(this,a,b)};d.ic=function(){return this};d.m=function(){return!this.r()};d.Sa=function(){var a=L().G;return Ki(this,a)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};\nd.x=function(){return Mi(this)};d.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){return 0=this.R||this.R>Wq(this)?wg():Xq(this).Yc()};d.a=function(){this.gg=null;this.Ob=this.xc=0;this.zb=wg();this.nf=this.R=0;return this};\nfunction Yq(a,b){var c=a.R,e=c>>31,f=-c|0;c=0!==c?~e:-e|0;var g=Wq(a);e=g>>31;g=f+g|0;f=(-2147483648^g)<(-2147483648^f)?1+(c+e|0)|0:c+e|0;if(0===f?-2147483629<(-2147483648^g):0this.Ob){a=a.zb;var b=a.i,c=this.zb;return a.f===c.f&&b===c.i}return Qk(H(),this.mf,a.mf)}return!1};\nfunction $q(a){if(0===a.Ob){a=a.zb;var b=a.i;return!(-1===a.f&&-1===b)}return!1}\nfunction ar(a){if($q(a))return a;var b=-1+Bf().pf.b.length|0,c=1,e=br(a),f=a=a.R;a>>=31;a:for(;;){if(cr(e,0))c=f,b=e,c=(new x).g(c,a);else{var g=dr(e,Bf().pf.b[c]);if(0===g.Kj.N){e=g.Jj;var h=c;g=h>>31;var k=a;a=f-h|0;f=(-2147483648^a)>(-2147483648^f)?-1+(k-g|0)|0:k-g|0;c=c=e))if(64>a.Ob){c=Y().Mh.b[e];var f=c.f,g=c.i,h=a.R,k=h>>31,m=e>>31;c=h-e|0;h=(-2147483648^c)>(-2147483648^h)?-1+(k-m|0)|0:k-m|0;e=a.zb;m=e.f;var p=e.i;k=y();e=uf(k,m,p,f,g);k=k.M;var q=y();m=gg(q,m,p,f,g);p=q.M;if(0!==m||0!==p){Y();if(0>p){q=-m|0;var t=0!==m?~p:-p|0}else q=m,t=p;q=(new x).g(q<<1,q>>>31|0|t<<1);f=(new x).g(f,g);g=q.i;t=f.i;(g===t?(-2147483648^q.f)>(-2147483648^f.f):g>t)?f=1:(g=q.i,t=f.i,f=(g===t?(-2147483648^q.f)<(-2147483648^\nf.f):gp?-1:0===p&&0===m?0:1,5+f|0);f=Ln(Y(),1&e,f,b.Ig);g=f>>31;f=e+f|0;e=(-2147483648^f)<(-2147483648^e)?1+(k+g|0)|0:k+g|0;0>e?(k=-f|0,g=0!==f?~e:-e|0):(k=f,g=e);k=Rk(y(),k,g);(void 0!==l.Math.log10?+l.Math.log10(k):+l.Math.log(k)/2.302585092994046)>=b.Vf?(c=-1+c|0,h=-1!==c?h:-1+h|0,k=y(),e=uf(k,f,e,10,0),k=k.M,c=(new x).g(c,h),e=(new x).g(e,k)):(c=(new x).g(c,h),e=(new x).g(f,e))}else c=(new x).g(c,h),e=(new x).g(e,k);h=c;c=h.f;h=h.i;k=e;e=k.f;k=k.i;a.R=Nn(Y(),(new x).g(c,h));a.nf=\nb.Vf;a.zb=(new x).g(e,k);a.Ob=Jn(Y(),(new x).g(e,k));a.mf=null}else f=eg(Bf(),(new x).g(e,e>>31)),h=br(a),h=af(dr(h,f)),k=a.R,g=k>>31,m=e>>31,e=k-e|0,k=(-2147483648^e)>(-2147483648^k)?-1+(g-m|0)|0:g-m|0,0!==h.b[1].N?(g=fr(gr(hr(h.b[1])),f),f=cr(h.b[0],0)?1:0,g=n(h.b[1].N,5+g|0),b=Ln(Y(),f,g,b.Ig),0!==b&&(b=Kf(lf(),(new x).g(b,b>>31)),f=h.b[0],h.b[0]=If(Nf(),f,b)),er((new Gn).Ag(h.b[0]))>c?(h.b[0]=ir(h.b[0],lf().lg),b=e=-1+e|0,e=-1!==e?k:-1+k|0):(b=e,e=k)):(b=e,e=k),a.R=Nn(Y(),(new x).g(b,e)),a.nf=\nc,jr(a,h.b[0])}d.Zk=function(a,b){Gn.prototype.a.call(this);if(null===a)throw(new Oc).h(\"unscaledVal \\x3d\\x3d null\");this.R=b;jr(this,a);return this};\nd.n=function(){if(null!==this.gg)return this.gg;if(32>this.Ob)return this.gg=tf(xf(),this.zb,this.R);var a=br(this);a=vf(xf(),a);if(0===this.R)return a;var b=0>br(this).N?2:1,c=a.length|0,e=this.R,f=e>>31,g=-e|0;f=0!==e?~f:-f|0;var h=c>>31;e=g+c|0;f=(-2147483648^e)<(-2147483648^g)?1+(f+h|0)|0:f+h|0;h=b>>31;g=e-b|0;e=(-2147483648^g)>(-2147483648^e)?-1+(f-h|0)|0:f-h|0;0a.Ob){if(0>a.zb.i)return-1;var b=a.zb;a=b.f;b=b.i;return(0===b?0!==a:0>31);this.R=b;Y();this.Ob=32-da(0>a?~a:a)|0;return this};\nfunction Xq(a){if(0===a.R||$q(a))return br(a);if(0>a.R){var b=br(a),c=Bf();a=a.R;var e=a>>31;return Zf(b,eg(c,(new x).g(-a|0,0!==a?~e:-e|0)))}b=br(a);c=Bf();a=a.R;return ir(b,eg(c,(new x).g(a,a>>31)))}\nfunction lr(a,b){var c=a.R,e=c>>31,f=b>>31;b=c-b|0;c=(-2147483648^b)>(-2147483648^c)?-1+(e-f|0)|0:e-f|0;return 64>a.Ob?(e=a.zb,f=e.i,0===e.f&&0===f?(a=Y(),b=(new x).g(b,c),c=b.f,a=b.f===c&&b.i===c>>31?En(a,wg(),b.f):0<=b.i?(new Gn).g(0,2147483647):(new Gn).g(0,-2147483648)):a=En(Y(),a.zb,Nn(Y(),(new x).g(b,c))),a):(new Gn).Zk(br(a),Nn(Y(),(new x).g(b,c)))}\nfunction er(a){if(0===a.nf){if(0===a.Ob)var b=1;else if(64>a.Ob){var c=a.zb;if(0===c.f&&-2147483648===c.i)b=19;else{Jg();b=Y().Mh;if(0>c.i){var e=c.f;c=c.i;e=(new x).g(-e|0,0!==e?~c:-c|0)}else e=c;b:{c=0;var f=b.b.length;for(;;){if(c===f){b=-1-c|0;break b}var g=(c+f|0)>>>1|0,h=b.b[g],k=Ma(h),m=k.f;k=k.i;var p=e.i;if(p===k?(-2147483648^e.f)<(-2147483648^m):pb?-1-b|0:1+b|0}}else b=1+Ja(.3010299956639812*(-1+a.Ob|0))|0,e=br(a),c=Bf(),b=0!==ir(e,eg(c,\n(new x).g(b,b>>31))).N?1+b|0:b;a.nf=b}return a.nf}function Zq(a){if(0===a.R||$q(a))return br(a);if(0>a.R){var b=br(a),c=Bf();a=a.R;var e=a>>31;return Zf(b,eg(c,(new x).g(-a|0,0!==a?~e:-e|0)))}if(a.R>Wq(a)||a.R>mr(br(a)))throw(new Mn).h(\"Rounding necessary\");b=br(a);c=Bf();a=a.R;a=eg(c,(new x).g(a,a>>31));a=af(dr(b,a));if(0!==a.b[1].N)throw(new Mn).h(\"Rounding necessary\");return a.b[0]}function jr(a,b){a.mf=b;a.Ob=nf(qf(),b);64>a.Ob&&(a.zb=b.Yc())}\nfunction Wq(a){return 0>31,e=y(),f=kl(e,this.R/.3010299956639812);e=e.M;f=b-f|0;b=(-2147483648^f)>(-2147483648^b)?-1+(c-e|0)|0:c-e|0;if((-1===b?2147482574>(-2147483648^f):-1>b)||0===a)return 0*a;if(0===b?-2147482623<(-2147483648^f):0=this.R)f=Bf(),e=-this.R|0,e=Zf(c,eg(f,(new x).g(e,e>>31)));else{e=Bf();var g=this.R;e=eg(e,(new x).g(g,g>>31));f=100-f|0;0>31));e=If(Nf(),f,c)}f=mr(e);c=-54+nf(qf(),e)|0;if(0(-2147483648^m)?1+h|0:h}}else e=e.Yc(),g=e.f,k=e.i,h=-c|0,e=0===(32&h)?g<>>1|0)>>>(31-h|0)|0|k<(-2147483648^m)?1+h|0:h);0===(4194304&h)?(e=e>>>1|0|h<<31,h>>=1,b=b+c|0):(e=e>>>2|0|h<<30,h>>=2,b=b+(1+c|0)|0);if(2046<\nb)return Infinity*a;if(-53>b)return 0*a;if(0>=b){e=g>>>1|0|k<<31;h=k>>1;k=63+b|0;g=e&(0===(32&k)?-1>>>k|0|-2<<(31-k|0):-1>>>k|0);k=h&(0===(32&k)?-1>>>k|0:0);b=-b|0;e=0===(32&b)?e>>>b|0|h<<1<<(31-b|0):h>>b;h=0===(32&b)?h>>b:h>>31;if(3===(3&e)||(1!==(1&e)||0===g&&0===k?0:f>>1|0|f<<31;h=f>>1}f=e;b=-2147483648&a>>31|b<<20|1048575&h;a=Ha();b=(new x).g(f,b);a.$f?(a.uh[a.Vk]=b.i,a.uh[a.hl]=b.f,a=+a.Sk[0]):a=a.Dv(b);return a};\nd.Xk=function(a,b){Gn.prototype.a.call(this);this.zb=a;this.R=b;this.Ob=Jn(Y(),a);return this};d.z=function(){if(0===this.xc)if(64>this.Ob){this.xc=this.zb.f;var a=this.zb.i;this.xc=n(33,this.xc)+a|0;this.xc=n(17,this.xc)+this.R|0}else this.xc=n(17,this.mf.z())+this.R|0;return this.xc};d.Xc=function(){return-32>=this.R||this.R>Wq(this)?0:Xq(this).Xc()};d.Ag=function(a){Gn.prototype.Zk.call(this,a,0);return this};\nd.Kf=function(){var a=this.Ob,b=a>>31,c=y(),e=kl(c,this.R/.3010299956639812);c=c.M;e=a-e|0;a=(-2147483648^e)>(-2147483648^a)?-1+(b-c|0)|0:b-c|0;b=ca(kr(this));return(-1===a?2147483499>(-2147483648^e):-1>a)||0===b?ca(0*b):(0===a?-2147483519<(-2147483648^e):0=a.b.length||0>=b||0>c)throw(new Oo).h(\"Bad offset/length: offset\\x3d0 len\\x3d\"+b+\" in.length\\x3d\"+a.b.length);var e=0;if(0<=c&&43===a.b[0]){e=1+e|0;if(e>31,fy=Wc(Xc(),BB,10),gy=fy>>31,Zs=Ys-fy|0,hy=this.R=Zs;if(Zs!==hy||((-2147483648^Zs)>(-2147483648^Ys)?-1+(ey-gy|0)|0:ey-gy|0)!==hy>>31)throw(new Oo).h(\"Scale out of range\");}if(19>xB){var um=ok();\"\"===tb&&bp(tb);var $s=0,iy=\n!1;switch(65535&(tb.charCodeAt(0)|0)){case 43:$s=1;break;case 45:$s=1,iy=!0}var jy=$s,Rg=tb.length|0;if(jy>=Rg){bp(tb);var vm=void 0}else{if(!um.q&&!um.q){for(var at=[],Bd=0;2>Bd;)at.push(null),Bd=1+Bd|0;for(;36>=Bd;){for(var CB=2147483647/Bd|0,wp=Bd,bt=1;wp<=CB;)wp=n(wp,Bd),bt=1+bt|0;var ct=wp,ky=ct>>31,ly=y(),DB=wf(ly,-1,-1,ct,ky),EB=ly.M,xp=new vg,FB=(new x).g(ct,ky),GB=(new x).g(DB,EB);xp.Cm=bt;xp.ho=FB;xp.Zn=GB;at.push(xp);Bd=1+Bd|0}um.tm=at;um.q=!0}for(var dt=um.tm[10],et=dt.Cm,Me=jy;;){var ft;\nif(ft=Megt?48===gt:0<=Dg(Jg(),Ko(HB),gt)}if(ft)Me=1+Me|0;else break}(Rg-Me|0)>n(3,et)&&bp(tb);var yp=Me+(1+((-1+(Rg-Me|0)|0)%et|0)|0)|0,zp=cp(Me,yp,tb);if(yp===Rg)vm=(new x).g(zp,0);else{var my=dt.ho,wm=my.f,ny=my.i,ht=yp+et|0,oy=65535&zp,py=zp>>>16|0,qy=65535&wm,ry=wm>>>16|0,sy=n(oy,qy),ty=n(py,qy),uy=n(oy,ry),vy=sy+((ty+uy|0)<<16)|0,wy=(sy>>>16|0)+uy|0,xy=((n(zp,ny)+n(py,ry)|0)+(wy>>>16|0)|0)+(((65535&wy)+ty|0)>>>16|0)|0,IB=cp(yp,ht,tb),bk=\nvy+IB|0,Ap=(-2147483648^bk)<(-2147483648^vy)?1+xy|0:xy;if(ht===Rg)vm=(new x).g(bk,Ap);else{var yy=dt.Zn,JB=yy.f,zy=yy.i,Ay=cp(ht,Rg,tb);(Ap===zy?(-2147483648^bk)>(-2147483648^JB):Ap>zy)&&bp(tb);var By=65535&bk,Cy=bk>>>16|0,Dy=65535&wm,Ey=wm>>>16|0,Fy=n(By,Dy),Gy=n(Cy,Dy),Hy=n(By,Ey),Iy=Fy+((Gy+Hy|0)<<16)|0,Jy=(Fy>>>16|0)+Hy|0,Ky=(((n(bk,ny)+n(Ap,wm)|0)+n(Cy,Ey)|0)+(Jy>>>16|0)|0)+(((65535&Jy)+Gy|0)>>>16|0)|0,it=Iy+Ay|0,Ly=(-2147483648^it)<(-2147483648^Iy)?1+Ky|0:Ky;-2147483648===(-2147483648^Ly)&&\n(-2147483648^it)<(-2147483648^Ay)&&bp(tb);vm=(new x).g(it,Ly)}}}var jt=vm.f,Bp=vm.i;if(iy){var My=-jt|0,kt=0!==jt?~Bp:-Bp|0;(0===kt?0!==My:0Bp&&bp(tb),Ny=(new x).g(jt,Bp);this.zb=Ny;this.Ob=Jn(Y(),this.zb)}else jr(this,(new Jf).h(tb))};function br(a){null===a.mf&&(a.mf=Kf(lf(),a.zb));return a.mf}\nfunction nr(a,b){var c=kr(a),e=kr(b);if(c===e){if(a.R===b.R&&64>a.Ob&&64>b.Ob){c=a.zb;e=c.f;c=c.i;var f=b.zb,g=f.i;if(c===g?(-2147483648^e)<(-2147483648^f.f):c(-2147483648^b.f):e>c)?1:0}f=a.R;g=f>>31;e=b.R;var h=e>>31;e=f-e|0;f=(-2147483648^e)>(-2147483648^f)?-1+(g-h|0)|0:g-h|0;g=Wq(a)-Wq(b)|0;h=g>>31;var k=1+e|0,m=0===k?1+f|0:f;if(h===m?(-2147483648^g)>(-2147483648^k):h>m)return c;h=g>>31;k=-1+e|0;m=-1!==k?f:-1+f|0;if(h===m?\n(-2147483648^g)<(-2147483648^k):hf)c=Bf(),a=Zf(a,eg(c,(new x).g(-e|0,0!==e?~f:-f|0)));else if(0===f?0!==e:0b)throw(new Mn).h(\"Negative exponent\");if(0===b)return lf().xf;if(1===b||a.t(lf().xf)||a.t(lf().be))return a;if(cr(a,0)){a:{Bf();var c=lf().xf,e=a;for(;;)if(1>=1,c=a;else{a=Zf(c,e);break a}}return a}for(c=1;!cr(a,c);)c=1+c|0;e=lf();var f=n(c,b);if(f>5;f&=31;var g=r(D(E),[1+e|0]);g.b[e]=1<>31,f=65535&c,g=c>>>16|0,h=65535&a,k=a>>>16|0,m=n(f,h);h=n(g,h);var p=n(f,k);f=m+((h+p|0)<<16)|0;m=(m>>>16|0)+p|0;b=(((n(c,b)+n(e,a)|0)+n(g,k)|0)+(m>>>16|0)|0)+(((65535&m)+h|0)>>>16|0)|0;return(new x).g(f,b)};d.a=function(){this.Bj=-2;this.xc=0;return this};\nfunction ir(a,b){if(0===b.N)throw(new Mn).h(\"BigInteger divide by zero\");var c=b.N;if(1===b.ga&&1===b.H.b[0])return 0g?1:-1:Gf(Nf(),a.H,b.H,f);if(0===h)return e===c?lf().xf:lf().Si;if(-1===h)return lf().be;h=1+(f-g|0)|0;var k=r(D(E),[h]);c=e===c?1:-1;1===g?Cf(Af(),k,a.H,f,b.H.b[0]):zf(Af(),k,h,a.H,f,b.H,g);c=hf(c,\nh,k);jf(c);return c}d.t=function(a){if(a instanceof Jf){var b;if(b=this.N===a.N&&this.ga===a.ga)a:{for(b=0;b!==this.ga;){if(this.H.b[b]!==a.H.b[b]){b=!1;break a}b=1+b|0}b=!0}a=b}else a=!1;return a};d.n=function(){return vf(xf(),this)};d.g=function(a,b){Jf.prototype.a.call(this);this.N=a;this.ga=1;this.H=ka(D(E),[b]);return this};function of(a){if(-2===a.Bj){if(0===a.N)var b=-1;else for(b=0;0===a.H.b[b];)b=1+b|0;a.Bj=b}return a.Bj}function hr(a){return 0>a.N?hf(1,a.ga,a.H):a}\nfunction dr(a,b){var c=b.N;if(0===c)throw(new Mn).h(\"BigInteger divide by zero\");var e=b.ga;b=b.H;if(1===e){Af();b=b.b[0];var f=a.H,g=a.ga;e=a.N;1===g?(f=f.b[0],a=+(f>>>0)/+(b>>>0)|0,g=0,b=+(f>>>0)%+(b>>>0)|0,f=0,e!==c&&(c=a,a=-c|0,g=0!==c?~g:-g|0),0>e&&(c=b,e=f,b=-c|0,f=0!==c?~e:-e|0),c=cf(new $e,Kf(lf(),(new x).g(a,g)),Kf(lf(),(new x).g(b,f)))):(c=e===c?1:-1,a=r(D(E),[g]),b=Cf(0,a,f,g,b),b=ka(D(E),[b]),c=hf(c,g,a),e=hf(e,1,b),jf(c),jf(e),c=cf(new $e,c,e));return c}g=a.H;f=a.ga;if(0>(f!==e?f>e?1:\n-1:Gf(Nf(),g,b,f)))return cf(new $e,lf().be,a);a=a.N;var h=1+(f-e|0)|0;c=a===c?1:-1;var k=r(D(E),[h]);b=zf(Af(),k,h,g,f,b,e);c=hf(c,h,k);e=hf(a,e,b);jf(c);jf(e);return cf(new $e,c,e)}function jf(a){a:for(;;){if(0>5;if(0===b)return 0!==(1&a.H.b[0]);if(0>b)throw(new Mn).h(\"Negative bit address\");if(c>=a.ga)return 0>a.N;if(0>a.N&&ca.N&&(e=of(a)===c?-e|0:~e);return 0!==(e&1<<(31&b))}function mr(a){if(0===a.N)return-1;var b=of(a);a=a.H.b[b];return(b<<5)+(0===a?32:31-da(a&(-a|0))|0)|0}function Mf(a){return 0===a.N?a:hf(-a.N|0,a.ga,a.H)}function hf(a,b,c){var e=new Jf;Jf.prototype.a.call(e);e.N=a;e.ga=b;e.H=c;return e}\nfunction gr(a){if(0!==a.N){qf();var b=a.ga,c=1+b|0,e=r(D(E),[c]);ef(0,e,a.H,b);a=hf(a.N,c,e);jf(a)}return a}\nd.ec=function(a,b){Jf.prototype.a.call(this);lf();if(null===a)throw(new Oc).a();if(2>b||36b.N?1:a.Nb.ga?a.N:a.gaa)throw(new Gr).a();return this};d.na=function(){return this.ub.length|0};d.$classData=z({Wu:0},!1,\"java.lang.StringBuilder\",{Wu:1,c:1,Gn:1,zu:1,d:1});function Vj(){this.eg=this.Te=null;this.ji=!1}Vj.prototype=new A;Vj.prototype.constructor=Vj;d=Vj.prototype;\nd.a=function(){Vj.prototype.uu.call(this);return this};function Hr(a,b,c){null===a.Te?a.eg=\"\"+a.eg+b+c:Ir(a,[b,c])}function fk(a,b,c){a=uk(a&b);b=new Jr;b.Jf=a;b.Bf=c;W.prototype.Ua.call(b,null,null);if(null===a)throw(new Oc).a();throw b;}\nfunction rk(a,b,c){b=a.toExponential(b);a=0===a&&0>1/a?\"-\"+b:b;b=a.length|0;a=101!==(65535&(a.charCodeAt(-3+b|0)|0))?a:a.substring(0,-1+b|0)+\"0\"+a.substring(-1+b|0);if(!c||0<=(a.indexOf(\".\")|0))return a;c=a.indexOf(\"e\")|0;return a.substring(0,c)+\".\"+a.substring(c)}function Kr(a,b){for(var c=\"\",e=0;e!==b;)c=\"\"+c+a,e=1+e|0;return c}function vk(a,b,c,e){var f=e.length|0;f>=c?Xj(a,e):0!==(1&b)?Hr(a,e,Kr(\" \",c-f|0)):Hr(a,Kr(\" \",c-f|0),e)}function pk(a,b){return 0!==(256&a)?b.toUpperCase():b}\nd.n=function(){if(this.ji)throw(new Wj).a();return null===this.Te?this.eg:this.Te.n()};function uk(a){return(0!==(1&a)?\"-\":\"\")+(0!==(2&a)?\"#\":\"\")+(0!==(4&a)?\"+\":\"\")+(0!==(8&a)?\" \":\"\")+(0!==(16&a)?\"0\":\"\")+(0!==(32&a)?\",\":\"\")+(0!==(64&a)?\"(\":\"\")+(0!==(128&a)?\"\\x3c\":\"\")}d.uu=function(){this.Te=null;this.eg=\"\";this.ji=!1};function ck(a,b){if(void 0===a)return b;a=+l.parseInt(a,10);return 2147483647>=a?Ja(a):-1}function Lr(a,b,c,e){null===a.Te?a.eg=a.eg+(\"\"+b+c)+e:Ir(a,[b,c,e])}\nfunction nk(a,b,c,e,f){var g=(e.length|0)+(f.length|0)|0;g>=c?Hr(a,e,f):0!==(16&b)?Lr(a,e,Kr(\"0\",c-g|0),f):0!==(1&b)?Lr(a,e,f,Kr(\" \",c-g|0)):Lr(a,Kr(\" \",c-g|0),e,f)}function qk(a,b,c,e){vk(a,b,c,pk(b,e!==e?\"NaN\":01/a?\"-\"+b:b;return c&&0>(a.indexOf(\".\")|0)?a+\".\":a}function gk(a,b,c,e,f){e=0>e?f:f.substring(0,e);vk(a,b,c,pk(b,e))}function kk(a){throw(new tk).h(uk(a));}function Xj(a,b){null===a.Te?a.eg=\"\"+a.eg+b:Ir(a,[b])}\nfunction lk(a,b,c,e){if((e.length|0)>=c&&0===(108&b))Xj(a,pk(b,e));else if(0===(124&b))gk(a,b,c,-1,e);else{if(45!==(65535&(e.charCodeAt(0)|0)))var f=0!==(4&b)?\"+\":0!==(8&b)?\" \":\"\";else 0!==(64&b)?(e=e.substring(1)+\")\",f=\"(\"):(e=e.substring(1),f=\"-\");if(0!==(32&b)){for(var g=e.length|0,h=0;;){if(h!==g){var k=65535&(e.charCodeAt(h)|0);k=48<=k&&57>=k}else k=!1;if(k)h=1+h|0;else break}h=-3+h|0;if(!(0>=h)){for(g=e.substring(h);3>24};\nd.t=function(a){return a instanceof x?this.f===a.f&&this.i===a.i:!1};d.Mf=function(a,b,c){x.prototype.g.call(this,a|b<<22,b>>10|c<<12);return this};d.n=function(){return mk(y(),this.f,this.i)};d.g=function(a,b){this.f=a;this.i=b;return this};d.ua=function(a){x.prototype.g.call(this,a,a>>31);return this};d.zi=function(){return this.f<<16>>16};d.ee=function(){return Rk(y(),this.f,this.i)};d.z=function(){return this.f^this.i};d.Xc=function(){return this.f};d.Kf=function(){return ca(Rk(y(),this.f,this.i))};\nd.$classData=z({yz:0},!1,\"scala.scalajs.runtime.RuntimeLong\",{yz:1,Be:1,c:1,d:1,bb:1});function bs(){this.s=null}bs.prototype=new A;bs.prototype.constructor=bs;d=bs.prototype;d.Ba=function(){return\"Answer\"};d.za=function(){return 1};d.t=function(a){if(this===a)return!0;if(a instanceof bs){var b=this.s;a=a.s;return null===b?null===a:b.t(a)}return!1};d.U=function(a){switch(a){case 0:return this.s;default:throw(new X).h(\"\"+a);}};d.n=function(){return el(this)};d.oa=function(a){return a instanceof bs};\nd.z=function(){return ui(this)};function kc(a){var b=new bs;b.s=a;return b}d.$classData=z({Zo:0},!1,\"atcoder.ABC142F$Answer\",{Zo:1,c:1,Ia:1,p:1,e:1,d:1});function Zm(){this.Cc=null}Zm.prototype=new A;Zm.prototype.constructor=Zm;Zm.prototype.Jo=function(a){return(0,this.Cc)(a)};Zm.prototype.j=function(a){this.Cc=a;return this};Zm.prototype.$classData=z({ap:0},!1,\"atcoder.ABC142F$Answer$$$Lambda$1\",{ap:1,c:1,wp:1,Ap:1,e:1,d:1});z({vp:0},!1,\"cats.Parallel$$anon$2\",{vp:1,c:1,mA:1,iA:1,e:1,d:1});\nfunction Tq(){}Tq.prototype=new A;Tq.prototype.constructor=Tq;Tq.prototype.a=function(){return this};Tq.prototype.Jo=function(a){return ma(a)};Tq.prototype.$classData=z({yp:0},!1,\"cats.Show$$anon$3\",{yp:1,c:1,wp:1,Ap:1,e:1,d:1});function gn(){}gn.prototype=new A;gn.prototype.constructor=gn;gn.prototype.a=function(){return this};gn.prototype.$classData=z({zp:0},!1,\"cats.Show$$anon$4\",{zp:1,c:1,hg:1,dc:1,e:1,d:1});function dd(){this.s=null}dd.prototype=new A;dd.prototype.constructor=dd;\nfunction cs(a,b,c){return(new dd).j(c.Rk(a.s,F(function(e,f,g){return function(h){if(h instanceof Fc)return f.xh(h);if(h instanceof wc)return g.l(h.E).s;throw(new J).j(h);}}(a,c,b))))}d=dd.prototype;d.Ba=function(){return\"EitherT\"};function ds(a,b,c,e){return(new dd).j(e.ni(a.s,F(function(f,g,h){return function(k){Ye||(Ye=(new Xe).a());if(k instanceof Fc)k=k.E,vc(),k=g.l(k),k=(new Fc).j(k);else if(k instanceof wc)k=k.E,vc(),k=h.l(k),k=(new wc).j(k);else throw(new J).j(k);return k}}(a,b,c))))}\nd.za=function(){return 1};function es(a,b){var c=mc();return ds(a,b,F(function(){return function(e){return e}}(a)),c)}d.t=function(a){return this===a?!0:a instanceof dd?G(H(),this.s,a.s):!1};d.U=function(a){switch(a){case 0:return this.s;default:throw(new X).h(\"\"+a);}};d.n=function(){return el(this)};d.j=function(a){this.s=a;return this};d.oa=function(a){return a instanceof dd};function fs(a,b,c){return ds(a,F(function(){return function(e){return e}}(a)),b,c)}d.z=function(){return ui(this)};\nfunction gs(a,b){var c=mc();return cs(a,F(function(e,f,g){return function(h){return nc().Oh(f.l(h),g)}}(a,b,c)),c)}d.$classData=z({Ep:0},!1,\"cats.data.EitherT\",{Ep:1,c:1,Ia:1,p:1,e:1,d:1});function hs(){Nq.call(this)}hs.prototype=new Oq;hs.prototype.constructor=hs;function is(){}is.prototype=hs.prototype;hs.prototype.a=function(){Nq.prototype.a.call(this);if(null===this)throw T(S(),null);return this};z({Aq:0},!1,\"cats.instances.Function1Instances$$anon$9\",{Aq:1,c:1,eh:1,wf:1,e:1,d:1});\nz({Cq:0},!1,\"cats.instances.HashInstances$$anon$1\",{Cq:1,c:1,hg:1,dc:1,e:1,d:1});z({Iq:0},!1,\"cats.instances.ListInstancesBinCompat0$$anon$3\",{Iq:1,c:1,ok:1,nk:1,e:1,d:1});z({Nq:0},!1,\"cats.instances.OptionInstancesBinCompat0$$anon$3\",{Nq:1,c:1,ok:1,nk:1,e:1,d:1});z({Zq:0},!1,\"cats.instances.StreamInstancesBinCompat0$$anon$4\",{Zq:1,c:1,ok:1,nk:1,e:1,d:1});z({ar:0},!1,\"cats.instances.Tuple2InstancesBinCompat0$$anon$2\",{ar:1,c:1,Ne:1,dc:1,e:1,d:1});\nz({er:0},!1,\"cats.instances.VectorInstancesBinCompat0$$anon$3\",{er:1,c:1,ok:1,nk:1,e:1,d:1});function js(){}js.prototype=new A;js.prototype.constructor=js;function ks(){}ks.prototype=js.prototype;function Ge(){}Ge.prototype=new xe;Ge.prototype.constructor=Ge;Ge.prototype.a=function(){return this};Ge.prototype.$classData=z({pr:0},!1,\"cats.kernel.Eq$\",{pr:1,pk:1,c:1,rr:1,e:1,d:1});var Fe=void 0;function Pe(){}Pe.prototype=new Dl;Pe.prototype.constructor=Pe;Pe.prototype.a=function(){return this};\nPe.prototype.$classData=z({tr:0},!1,\"cats.kernel.Hash$\",{tr:1,dD:1,pk:1,c:1,e:1,d:1});var Oe=void 0;function Te(){}Te.prototype=new Fl;Te.prototype.constructor=Te;Te.prototype.a=function(){return this};Te.prototype.$classData=z({ur:0},!1,\"cats.kernel.Monoid$\",{ur:1,vr:1,fm:1,c:1,e:1,d:1});var Se=void 0;function ls(){}ls.prototype=new A;ls.prototype.constructor=ls;ls.prototype.a=function(){return this};\nls.prototype.$classData=z({ks:0},!1,\"cats.kernel.instances.StringMonoid\",{ks:1,c:1,Gd:1,Hd:1,e:1,d:1});function ms(){}ms.prototype=new Vq;ms.prototype.constructor=ms;function ns(){}ns.prototype=ms.prototype;function Zb(){}Zb.prototype=new A;Zb.prototype.constructor=Zb;Zb.prototype.a=function(){return this};Zb.prototype.Tk=function(a,b,c,e){return os(a,b,c,e)};Zb.prototype.il=function(a,b){ps||(ps=(new qs).a());return rs(ps,a,b)};\nZb.prototype.$classData=z({Os:0},!1,\"scalax.collection.Graph$\",{Os:1,c:1,pm:1,om:1,e:1,d:1});var mb=void 0;function ss(){this.Yh=0;this.Fa=null}ss.prototype=new Cr;ss.prototype.constructor=ss;ss.prototype.u=function(){this.Yh=1+this.Yh|0;switch(this.Yh){case 1:return this.Fa.Xa.U(0);case 2:return fo(this.Fa);default:return vc().bm.nb.u()}};function ko(a){var b=new ss;if(null===a)throw T(S(),null);b.Fa=a;b.Yh=0;return b}ss.prototype.r=function(){return 2>this.Yh};\nss.prototype.$classData=z({ht:0},!1,\"scalax.collection.GraphEdge$UnDiEdge$$anon$7\",{ht:1,sH:1,c:1,Bb:1,y:1,A:1});function ts(a){var b=(new rb).a();try{var c=a.Ge;if(c.m()){for(;;){var e=us(a);if(vs(e)){var f=a.Cg.r();a.Ge=(new Q).j(f);if(f){var g=a.Cg.u();a.Ih=g;a=b;var h=new ws;h.Uo=!0;xs.prototype.Q.call(h,a,null);throw h;}var k=us(a);zo(k)}else break}var m=!1}else m=c.Nb();return!!m}catch(p){if(p instanceof xs){h=p;if(h.Ln===b)return h.Uo;throw h;}throw p;}}\nfunction vs(a){var b=a.Ge;b.m()?(b=a.Cg.r(),a.Ge=(new Q).j(b),b?(b=a.Cg.u(),a.Ih=b,a.q||a.q||(a.rn=ys(a.k),a.q=!0),a=a.rn,b=us(a).Ih,zs(a,b),a.Ge=R(),a=!0):a=!1):a=b.Nb();return!!a}function As(){this.k=this.Li=this.Yi=null}As.prototype=new A;As.prototype.constructor=As;d=As.prototype;d.u=function(){var a=ys(this);return zo(a)};d.pa=function(){return this};d.Yb=function(a,b){Hi(this,a,b)};function ys(a){null===a.Li&&null===a.Li&&(a.Li=(new Bs).$k(a));return a.Li}d.ic=function(){return this};d.m=function(){return!this.r()};\nd.Sa=function(){var a=L().G;return Ki(this,a)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};d.x=function(){return Mi(this)};d.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){var a=ys(this);return ts(a)};d.Ka=function(){return rm(this)};d.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};function Cs(a){var b=new As;if(null===a)throw T(S(),null);b.k=a;return b}\nd.lb=function(){var a=Fp();a=jc(a);return Ki(this,a)};d.fc=function(){return!1};d.tb=function(a,b,c){Am(this,a,b,c)};d.Qb=function(){for(var a=Mp(new Np,eo());;){var b=ys(this);if(ts(b))b=ys(this),b=zo(b),Op(a,b);else break}};d.Kb=function(a){return Ri(this,a)};d.$classData=z({wt:0},!1,\"scalax.collection.immutable.AdjacencyListBase$$anon$1\",{wt:1,c:1,eH:1,Bb:1,y:1,A:1});function Ds(){yr.call(this)}Ds.prototype=new zr;Ds.prototype.constructor=Ds;Ds.prototype.u=function(){return Ar(this)};\nDs.prototype.ei=function(a){yr.prototype.ei.call(this,a);return this};Ds.prototype.$classData=z({Ot:0},!1,\"scalax.collection.mutable.EqHash$KeyIndexIterator\",{Ot:1,rm:1,c:1,Bb:1,y:1,A:1});function Es(){yr.call(this)}Es.prototype=new zr;Es.prototype.constructor=Es;Es.prototype.u=function(){return Fs(this)};function Fs(a){var b=Ar(a);a.k;a.k;var c=a.Ch.b[b];c=c===pb().Ee?pb().Ee:c;a.k;return(new K).Q(c,a.Ch.b[1+b|0])}Es.prototype.Dc=function(a){yr.prototype.ei.call(this,a);return this};\nEs.prototype.$classData=z({Qt:0},!1,\"scalax.collection.mutable.EqHashMap$EntryIterator\",{Qt:1,rm:1,c:1,Bb:1,y:1,A:1});function Gs(){yr.call(this)}Gs.prototype=new zr;Gs.prototype.constructor=Gs;Gs.prototype.u=function(){this.k;this.k;var a=this.Ch.b[Ar(this)];return a===pb().Ee?pb().Ee:a};Gs.prototype.Dc=function(a){yr.prototype.ei.call(this,a);return this};Gs.prototype.$classData=z({Rt:0},!1,\"scalax.collection.mutable.EqHashMap$KeyIterator\",{Rt:1,rm:1,c:1,Bb:1,y:1,A:1});\nfunction Hs(){qr.call(this);this.Km=this.cn=this.Im=null}Hs.prototype=new rr;Hs.prototype.constructor=Hs;function rs(a,b,c){var e=new Hs;e.Im=a;e.cn=b;e.Km=c;qr.prototype.wu.call(e,c);return e}Hs.prototype.Ca=function(){return this.Im.Tk(this.Xa,this.ij,this.cn,this.Km)};Hs.prototype.$classData=z({Wt:0},!1,\"scalax.collection.mutable.GraphBuilder\",{Wt:1,rH:1,c:1,tc:1,sc:1,rc:1});function Is(){this.Vc=0;this.Fa=this.go=null}Is.prototype=new Yr;Is.prototype.constructor=Is;\nIs.prototype.u=function(){this.go=gl(Ji(),this.Fa.pb,this.Vc);this.Vc=1+this.Vc|0;return this.go};Is.prototype.r=function(){return this.Vcthis.vg.x())eh().nb.u();else{var a=this.Fa,b=this.vg,c=this.he,e=new Lt;e.vg=b;e.he=c;if(null===a)throw T(S(),null);e.Fa=a;Sr();a=1+c|0;var f=[];rh();if(0!==a&&0>31,h=a-0|0;g=(-2147483648^h)>(-2147483648^a)?-1+(g-0|0)|0:g-0|0;var k=y();uf(k,h,g,1,0);k=y();gg(k,h,g,1,0)}for(h=0;hb)this.Le=!1;else if(c=b,this.Ye.b[c]=1+this.Ye.b[c]|0,c=1+b|0,e=this.he,b=-1+e|0,!(c>=e))for(;;){e=c;this.Ye.b[e]=1+this.Ye.b[-1+e|\n0]|0;if(c===b)break;c=1+c|0}return a};Lt.prototype.$classData=z({sx:0},!1,\"scala.collection.SetLike$SubsetsItr\",{sx:1,cd:1,c:1,Bb:1,y:1,A:1});function Mt(){this.G=null}Mt.prototype=new Hm;Mt.prototype.constructor=Mt;Mt.prototype.a=function(){Gm.prototype.a.call(this);Nt=this;(new oi).a();return this};Mt.prototype.fa=function(){Ot||(Ot=(new Pt).a());return(new sn).a()};Mt.prototype.$classData=z({ux:0},!1,\"scala.collection.Traversable$\",{ux:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Nt=void 0;\nfunction ah(){Nt||(Nt=(new Mt).a());return Nt}function Qt(){}Qt.prototype=new $r;Qt.prototype.constructor=Qt;function Rt(){}Rt.prototype=Qt.prototype;Qt.prototype.Jd=function(){return this.jj()};Qt.prototype.fa=function(){return Ht(new It,this.jj())};function St(){}St.prototype=new $r;St.prototype.constructor=St;function Tt(){}Tt.prototype=St.prototype;St.prototype.fa=function(){return(new rn).Bg(this.Jd())};function Ut(){this.G=null}Ut.prototype=new Hm;Ut.prototype.constructor=Ut;\nUt.prototype.a=function(){Gm.prototype.a.call(this);return this};Ut.prototype.fa=function(){return(new sn).a()};Ut.prototype.$classData=z({Zx:0},!1,\"scala.collection.immutable.Iterable$\",{Zx:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Vt=void 0;function Bt(){Vt||(Vt=(new Ut).a());return Vt}function Wt(){this.fd=null}Wt.prototype=new Yr;Wt.prototype.constructor=Wt;d=Wt.prototype;\nd.u=function(){if(!this.r())return eh().nb.u();var a=dj(this.fd),b=a.w();this.fd=cj(new bj,this,Ob(function(c,e){return function(){return e.Aa()}}(this,a)));return b};d.Sa=function(){var a=this.Ka(),b=L().G;return O(a,b)};function Xt(a){var b=new Wt;b.fd=cj(new bj,b,Ob(function(c,e){return function(){return e}}(b,a)));return b}d.r=function(){return!dj(this.fd).m()};d.Ka=function(){var a=dj(this.fd);this.fd=cj(new bj,this,Ob(function(){return function(){lh();return zm()}}(this)));return a};\nd.$classData=z({Jy:0},!1,\"scala.collection.immutable.StreamIterator\",{Jy:1,cd:1,c:1,Bb:1,y:1,A:1});function Pt(){this.G=null}Pt.prototype=new Hm;Pt.prototype.constructor=Pt;Pt.prototype.a=function(){Gm.prototype.a.call(this);return this};Pt.prototype.fa=function(){return(new sn).a()};Pt.prototype.$classData=z({Ny:0},!1,\"scala.collection.immutable.Traversable$\",{Ny:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Ot=void 0;function Yt(){this.en=null;this.Cd=0;this.zh=this.ul=this.Uj=null;this.Zf=0;this.Mg=null}\nYt.prototype=new Yr;Yt.prototype.constructor=Yt;function Zt(){}Zt.prototype=Yt.prototype;\nYt.prototype.u=function(){if(null!==this.Mg){var a=this.Mg.u();this.Mg.r()||(this.Mg=null);return a}a:{a=this.zh;var b=this.Zf;for(;;){b===(-1+a.b.length|0)?(this.Cd=-1+this.Cd|0,0<=this.Cd?(this.zh=this.Uj.b[this.Cd],this.Zf=this.ul.b[this.Cd],this.Uj.b[this.Cd]=null):(this.zh=null,this.Zf=0)):this.Zf=1+this.Zf|0;a=a.b[b];if(a instanceof $t||a instanceof au){a=this.kn(a);break a}if(a instanceof bu||a instanceof cu)0<=this.Cd&&(this.Uj.b[this.Cd]=this.zh,this.ul.b[this.Cd]=this.Zf),this.Cd=1+this.Cd|\n0,this.zh=du(a),this.Zf=0,a=du(a),b=0;else{this.Mg=a.v();a=this.u();break a}}}return a};Yt.prototype.r=function(){return null!==this.Mg||0<=this.Cd};function du(a){if(a instanceof bu)return a.Sc;if(!(a instanceof cu))throw(new J).j(a);return a.fb}Yt.prototype.nn=function(a){this.en=a;this.Cd=0;this.Uj=r(D(D(eu)),[6]);this.ul=r(D(E),[6]);this.zh=this.en;this.Zf=0;this.Mg=null};function kj(){this.hn=this.la=null}kj.prototype=new A;kj.prototype.constructor=kj;\nfunction jj(a,b,c){a.hn=c;a.la=b;return a}d=kj.prototype;d.t=function(a){return null!==a&&(a===this||a===this.la||Ca(a,this.la))};d.kc=function(a){this.la.Ta(a);return this};d.n=function(){return\"\"+this.la};d.Ca=function(){return this.hn.l(this.la.Ca())};d.ed=function(a,b){this.la.ed(a,b)};d.Ta=function(a){this.la.Ta(a);return this};d.z=function(){return this.la.z()};d.hc=function(a){this.la.hc(a)};d.Gb=function(a){this.la.Gb(a);return this};\nd.$classData=z({Xy:0},!1,\"scala.collection.mutable.Builder$$anon$1\",{Xy:1,c:1,tc:1,sc:1,rc:1,oo:1});function fu(){this.Vc=0;this.Fa=null}fu.prototype=new Yr;fu.prototype.constructor=fu;fu.prototype.u=function(){return this.r()?(this.Vc=1+this.Vc|0,Hb(this.Fa.Ya.b[-1+this.Vc|0])):eh().nb.u()};function ec(a){var b=new fu;if(null===a)throw T(S(),null);b.Fa=a;b.Vc=0;return b}fu.prototype.r=function(){for(;this.Vc=(-2147483648^b):0>c));if(!b)throw(new Bb).h(\"requirement failed: Duration is limited to +-(2^63-1)ns (ca. 292 years)\");\nreturn a}d.Sb=function(a){return this.we(a)};d.we=function(a){if(a instanceof bv){var b=this.Zg.Yd(this.De),c=b.f;b=b.i;c=Hu(new Iu,(new x).g(c,b));b=a.Zg.Yd(a.De);a=b.f;b=b.i;c=c.la;var e=Ma((new x).g(c.f,c.i));c=e.f;e=e.i;b=Ma((new x).g(a,b));a=b.f;b=b.i;return Iq(y(),c,e,a,b)}return-a.we(this)|0};function cv(a,b){var c=b.f,e=b.i;e=0!==c?~e:-e|0;var f=a.De,g=f.i;return(e===g?(-2147483648^(-c|0))<=(-2147483648^f.f):e=(65535&(a.charCodeAt(b)|0))&&48<=(65535&(a.charCodeAt(b)|0)))b=-1+b|0;else break;for(var f=b;;)if(-1!==b&&36!==(65535&(a.charCodeAt(b)|0))&&46!==(65535&(a.charCodeAt(b)|0)))b=-1+b|0;else break;var g=1+b|0;if(b===f&&e!==(a.length|0))return c;for(;;)if(-1!==b&&36===(65535&(a.charCodeAt(b)|\n0)))b=-1+b|0;else break;f=-1===b?!0:46===(65535&(a.charCodeAt(b)|0));var h;(h=f)||(h=65535&(a.charCodeAt(g)|0),h=!(90h||65>h));if(h){e=a.substring(g,e);g=c;if(null===g)throw(new Oc).a();c=\"\"===g?e:\"\"+e+Zj(46)+c;if(f)return c}}}function jv(){this.G=null}jv.prototype=new tq;jv.prototype.constructor=jv;function kv(){}kv.prototype=jv.prototype;function lv(){Yt.call(this)}lv.prototype=new Zt;lv.prototype.constructor=lv;lv.prototype.kn=function(a){return mv(a)};\nlv.prototype.$classData=z({Px:0},!1,\"scala.collection.immutable.HashMap$HashTrieMap$$anon$3\",{Px:1,Oy:1,cd:1,c:1,Bb:1,y:1,A:1});function nv(){Yt.call(this)}nv.prototype=new Zt;nv.prototype.constructor=nv;nv.prototype.kn=function(a){return a.Ec};nv.prototype.$classData=z({Wx:0},!1,\"scala.collection.immutable.HashSet$HashTrieSet$$anon$1\",{Wx:1,Oy:1,cd:1,c:1,Bb:1,y:1,A:1});function ov(){}ov.prototype=new Rt;ov.prototype.constructor=ov;ov.prototype.a=function(){return this};ov.prototype.jj=function(){return Gt()};\nov.prototype.$classData=z({wy:0},!1,\"scala.collection.immutable.Set$\",{wy:1,uo:1,Og:1,Ng:1,Cb:1,c:1,Db:1});var pv=void 0;function Fp(){pv||(pv=(new ov).a());return pv}function qv(){this.si=null}qv.prototype=new ju;qv.prototype.constructor=qv;qv.prototype.a=function(){iu.prototype.a.call(this);return this};qv.prototype.Ca=function(){return rv(this)};function rv(a){return a.si.sb.Ka().Qk(F(function(){return function(b){return b.Ka()}}(a)),(lh(),(new zq).a()))}\nqv.prototype.$classData=z({Hy:0},!1,\"scala.collection.immutable.Stream$StreamBuilder\",{Hy:1,ZH:1,c:1,yi:1,tc:1,sc:1,rc:1});function dm(){this.Zh=this.Gg=this.Rh=0;this.Ym=this.Wm=this.Um=this.Sm=this.Qm=this.ai=null}dm.prototype=new A;dm.prototype.constructor=dm;d=dm.prototype;d.ta=function(){return this.Um};d.a=function(){this.ai=r(D(C),[32]);this.Zh=1;this.Gg=this.Rh=0;return this};d.kd=function(){return this.Zh};d.kc=function(a){return sv(this,a)};d.tg=function(a){this.Ym=a};d.mb=function(){return this.ai};\nd.ab=function(a){this.Sm=a};d.gb=function(){return this.Wm};\nfunction sv(a,b){if(a.Gg>=a.ai.b.length){var c=32+a.Rh|0,e=a.Rh^c;if(1024>e)1===a.kd()&&(a.xa(r(D(C),[32])),a.L().b[0]=a.mb(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb();else if(32768>e)2===a.kd()&&(a.ab(r(D(C),[32])),a.X().b[0]=a.L(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L();else if(1048576>e)3===a.kd()&&(a.Ib(r(D(C),[32])),a.ta().b[0]=a.X(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),a.ab(r(D(C),\n[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L(),a.ta().b[31&(c>>>15|0)]=a.X();else if(33554432>e)4===a.kd()&&(a.Qc(r(D(C),[32])),a.gb().b[0]=a.ta(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),a.ab(r(D(C),[32])),a.Ib(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L(),a.ta().b[31&(c>>>15|0)]=a.X(),a.gb().b[31&(c>>>20|0)]=a.ta();else if(1073741824>e)5===a.kd()&&(a.tg(r(D(C),[32])),a.Rc().b[0]=a.gb(),a.Ef(1+a.kd()|0)),a.La(r(D(C),[32])),a.xa(r(D(C),[32])),\na.ab(r(D(C),[32])),a.Ib(r(D(C),[32])),a.Qc(r(D(C),[32])),a.L().b[31&(c>>>5|0)]=a.mb(),a.X().b[31&(c>>>10|0)]=a.L(),a.ta().b[31&(c>>>15|0)]=a.X(),a.gb().b[31&(c>>>20|0)]=a.ta(),a.Rc().b[31&(c>>>25|0)]=a.gb();else throw(new Bb).a();a.Rh=c;a.Gg=0}a.ai.b[a.Gg]=b;a.Gg=1+a.Gg|0;return a}d.Ca=function(){var a=this.Rh+this.Gg|0;if(0===a)a=oh().Vi;else{var b=(new tv).Mf(0,a,0);Eb(b,this,this.Zh);1c)this.La(this.L().b[31&(b>>>5|0)]);else if(32768>c)this.xa(this.X().b[31&(b>>>10|0)]),this.La(this.L().b[0]);else if(1048576>c)this.ab(this.ta().b[31&(b>>>15|0)]),this.xa(this.X().b[0]),this.La(this.L().b[0]);else if(33554432>c)this.Ib(this.gb().b[31&(b>>>20|0)]),this.ab(this.ta().b[0]),this.xa(this.X().b[0]),\nthis.La(this.L().b[0]);else if(1073741824>c)this.Qc(this.Rc().b[31&(b>>>25|0)]),this.Ib(this.gb().b[0]),this.ab(this.ta().b[0]),this.xa(this.X().b[0]),this.La(this.L().b[0]);else throw(new Bb).a();this.Af=b;b=this.Nk-this.Af|0;this.Ok=32>b?b:32;this.f=0}else this.Le=!1;return a};d.ta=function(){return this.Vm};d.kd=function(){return this.Jk};d.tg=function(a){this.Zm=a};d.g=function(a,b){this.Nk=b;this.Af=-32&a;this.f=31&a;a=b-this.Af|0;this.Ok=32>a?a:32;this.Le=(this.Af+this.f|0)>31;return Ju(new Gu,a,(new x).g(b,c))}if(sa(b)||La(b))return b|=0,c=b>>31,Ju(new Gu,a,(new x).g(b,c));if(b instanceof x)return c=Ma(b),b=c.f,c=c.i,Ju(new Gu,a,(new x).g(b,c));if(wa(b)||\"number\"===typeof b){c=new Eu;c.s=+b;if(null===a)throw T(S(),null);c.k=a;return c}if(b instanceof wb||void 0===b||\"boolean\"===typeof b||Dr(b)){c=new Lu;Cc();b=ma(b);b=null!==b?(new lj).h(b):null;c.s=b;if(null===a)throw T(S(),null);c.k=a;return c}if(null!==b){c=new Ku;c.s=b;if(null===\na)throw T(S(),null);c.k=a;return c}throw(new J).j(b);}Gv.prototype.mi=function(a,b){return 0>=this.$a(a,b)};Gv.prototype.$classData=z({pt:0},!1,\"scalax.collection.generic.AnyOrdering\",{pt:1,c:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1});function Bs(){this.Ge=this.Ih=this.Cg=this.Yn=null;this.q=!1;this.k=null}Bs.prototype=new A;Bs.prototype.constructor=Bs;d=Bs.prototype;d.Yb=function(a,b){Hi(this,a,b)};d.pa=function(){return this};d.u=function(){return zo(this)};\nfunction us(a){if(!a.q&&!a.q){var b=a.k;null===b.Yi&&null===b.Yi&&(b.Yi=(new Iv).$k(b));a.Yn=b.Yi;a.q=!0}return a.Yn}d.ic=function(){return this};d.$k=function(a){if(null===a)throw T(S(),null);this.k=a;this.Ge=R();return this};d.Sa=function(){var a=L().G;return Ki(this,a)};d.m=function(){return!this.r()};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};d.Wn=function(a){this.Ge=a};d.x=function(){return Mi(this)};\nd.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){return ts(this)};d.Ka=function(){return rm(this)};d.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};function zs(a,b){a.Cg=Jv(b.Ve,F(function(c,e){return function(f){f=f.ra.Xa.U(0);return null===f?null===e:Ca(f,e)}}(a,b))).v()}d.lb=function(){var a=Fp();a=jc(a);return Ki(this,a)};d.tb=function(a,b,c){Am(this,a,b,c)};d.fc=function(){return!1};d.Qb=function(){for(var a=Mp(new Np,eo());ts(this);){var b=zo(this);Op(a,b)}};\nd.Kb=function(a){return Ri(this,a)};d.$classData=z({xt:0},!1,\"scalax.collection.immutable.AdjacencyListBase$$anon$1$Inner$\",{xt:1,c:1,fH:1,ut:1,Bb:1,y:1,A:1,gH:1});function Iv(){this.Ge=this.Ih=this.Cg=this.rn=null;this.q=!1;this.k=null}Iv.prototype=new A;Iv.prototype.constructor=Iv;d=Iv.prototype;d.Yb=function(a,b){Hi(this,a,b)};d.pa=function(){return this};d.u=function(){return zo(this)};d.ic=function(){return this};\nd.$k=function(a){if(null===a)throw T(S(),null);this.k=a;this.Ge=R();this.Cg=ec(a.k.ac.Za);return this};d.Sa=function(){var a=L().G;return Ki(this,a)};d.m=function(){return!this.r()};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return mm(this,a)};d.n=function(){return\"\\x3citerator\\x3e\"};d.K=function(a){nm(this,a)};d.Wn=function(a){this.Ge=a};d.x=function(){return Mi(this)};d.ib=function(){var a=Qq().G;return Ki(this,a)};d.r=function(){return vs(this)};d.Ka=function(){return rm(this)};\nd.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};d.lb=function(){var a=Fp();a=jc(a);return Ki(this,a)};d.tb=function(a,b,c){Am(this,a,b,c)};d.fc=function(){return!1};d.Qb=function(){for(var a=Mp(new Np,eo());vs(this);){var b=zo(this);Op(a,b)}};d.Kb=function(a){return Ri(this,a)};d.$classData=z({yt:0},!1,\"scalax.collection.immutable.AdjacencyListBase$$anon$1$Outer$\",{yt:1,c:1,hH:1,ut:1,Bb:1,y:1,A:1,iH:1});function Kv(){}Kv.prototype=new A;Kv.prototype.constructor=Kv;d=Kv.prototype;d.a=function(){return this};\nd.Ba=function(){return\"HNil\"};d.za=function(){return 0};d.U=function(a){throw(new X).h(\"\"+a);};d.n=function(){return\"HNil\"};d.oa=function(a){return a instanceof Kv};d.z=function(){return 2223273};d.$classData=z({du:0},!1,\"shapeless.HNil$\",{du:1,c:1,uH:1,cu:1,Ia:1,p:1,e:1,d:1});var Lv=void 0;function Ac(){Lv||(Lv=(new Kv).a());return Lv}function Gg(){this.Vh=null}Gg.prototype=new A;Gg.prototype.constructor=Gg;Gg.prototype.$a=function(a,b){return this.Vh.$a(a,b)};\nGg.prototype.mi=function(a,b){return 0>=this.$a(a,b)};Gg.prototype.$classData=z({bv:0},!1,\"java.util.Arrays$$anon$3\",{bv:1,c:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1});function ak(){W.call(this);this.Jf=null}ak.prototype=new Xu;ak.prototype.constructor=ak;ak.prototype.ud=function(){return\"Flags \\x3d '\"+this.Jf+\"'\"};ak.prototype.h=function(a){this.Jf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};\nak.prototype.$classData=z({cv:0},!1,\"java.util.DuplicateFormatFlagsException\",{cv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function Jr(){W.call(this);this.Jf=null;this.Bf=0}Jr.prototype=new Xu;Jr.prototype.constructor=Jr;Jr.prototype.ud=function(){return\"Conversion \\x3d \"+Zj(this.Bf)+\", Flags \\x3d \"+this.Jf};Jr.prototype.$classData=z({dv:0},!1,\"java.util.FormatFlagsConversionMismatchException\",{dv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function ik(){W.call(this);this.Bf=0}ik.prototype=new Xu;\nik.prototype.constructor=ik;ik.prototype.ud=function(){return\"Code point \\x3d 0x\"+(+(this.Bf>>>0)).toString(16)};ik.prototype.ua=function(a){this.Bf=a;W.prototype.Ua.call(this,null,null);return this};ik.prototype.$classData=z({hv:0},!1,\"java.util.IllegalFormatCodePointException\",{hv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function Mr(){W.call(this);this.Bf=0;this.zm=null}Mr.prototype=new Xu;Mr.prototype.constructor=Mr;Mr.prototype.ud=function(){return l.String.fromCharCode(this.Bf)+\" !\\x3d \"+sb(this.zm)};\nMr.prototype.$classData=z({iv:0},!1,\"java.util.IllegalFormatConversionException\",{iv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function tk(){W.call(this);this.Jf=null}tk.prototype=new Xu;tk.prototype.constructor=tk;tk.prototype.ud=function(){return\"Flags \\x3d '\"+this.Jf+\"'\"};tk.prototype.h=function(a){this.Jf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};tk.prototype.$classData=z({jv:0},!1,\"java.util.IllegalFormatFlagsException\",{jv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});\nfunction hk(){W.call(this);this.bo=0}hk.prototype=new Xu;hk.prototype.constructor=hk;hk.prototype.ud=function(){return\"\"+this.bo};hk.prototype.ua=function(a){this.bo=a;W.prototype.Ua.call(this,null,null);return this};hk.prototype.$classData=z({kv:0},!1,\"java.util.IllegalFormatPrecisionException\",{kv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function wk(){W.call(this);this.Vo=0}wk.prototype=new Xu;wk.prototype.constructor=wk;wk.prototype.ud=function(){return\"\"+this.Vo};\nwk.prototype.ua=function(a){this.Vo=a;W.prototype.Ua.call(this,null,null);return this};wk.prototype.$classData=z({lv:0},!1,\"java.util.IllegalFormatWidthException\",{lv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function ek(){W.call(this);this.Wf=null}ek.prototype=new Xu;ek.prototype.constructor=ek;ek.prototype.ud=function(){return\"Format specifier '\"+this.Wf+\"'\"};ek.prototype.h=function(a){this.Wf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};\nek.prototype.$classData=z({mv:0},!1,\"java.util.MissingFormatArgumentException\",{mv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function dk(){W.call(this);this.Wf=null}dk.prototype=new Xu;dk.prototype.constructor=dk;dk.prototype.ud=function(){return this.Wf};dk.prototype.h=function(a){this.Wf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};dk.prototype.$classData=z({nv:0},!1,\"java.util.MissingFormatWidthException\",{nv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});\nfunction Yj(){W.call(this);this.Wf=null}Yj.prototype=new Xu;Yj.prototype.constructor=Yj;Yj.prototype.ud=function(){return\"Conversion \\x3d '\"+this.Wf+\"'\"};Yj.prototype.h=function(a){this.Wf=a;W.prototype.Ua.call(this,null,null);if(null===a)throw(new Oc).a();return this};Yj.prototype.$classData=z({pv:0},!1,\"java.util.UnknownFormatConversionException\",{pv:1,bf:1,Pd:1,wb:1,vb:1,hb:1,c:1,d:1});function Wp(){}Wp.prototype=new av;Wp.prototype.constructor=Wp;d=Wp.prototype;d.a=function(){return this};\nd.t=function(){return!1};d.n=function(){return\"Duration.Undefined\"};d.Sb=function(a){return this.we(a)};d.we=function(a){return a===this?0:1};d.$classData=z({$v:0},!1,\"scala.concurrent.duration.Duration$$anon$1\",{$v:1,po:1,pl:1,c:1,e:1,d:1,Rd:1,bb:1});function Xp(){}Xp.prototype=new av;Xp.prototype.constructor=Xp;d=Xp.prototype;d.a=function(){return this};d.n=function(){return\"Duration.Inf\"};d.Sb=function(a){return this.we(a)};d.we=function(a){return a===sl().vm?-1:a===this?0:1};\nd.$classData=z({aw:0},!1,\"scala.concurrent.duration.Duration$$anon$2\",{aw:1,po:1,pl:1,c:1,e:1,d:1,Rd:1,bb:1});function Yp(){}Yp.prototype=new av;Yp.prototype.constructor=Yp;d=Yp.prototype;d.a=function(){return this};d.n=function(){return\"Duration.MinusInf\"};d.Sb=function(a){return this.we(a)};d.we=function(a){return a===this?0:-1};d.$classData=z({bw:0},!1,\"scala.concurrent.duration.Duration$$anon$3\",{bw:1,po:1,pl:1,c:1,e:1,d:1,Rd:1,bb:1});function Mv(){this.Mj=null}Mv.prototype=new A;\nMv.prototype.constructor=Mv;d=Mv.prototype;d.$c=function(a){var b=this.Ub();b===w(Va)?a=r(D(Va),[a]):b===w(Wa)?a=r(D(Wa),[a]):b===w(Ua)?a=r(D(Ua),[a]):b===w(E)?a=r(D(E),[a]):b===w(Xa)?a=r(D(Xa),[a]):b===w(Ya)?a=r(D(Ya),[a]):b===w(Za)?a=r(D(Za),[a]):b===w(Sa)?a=r(D(Sa),[a]):b===w(Ra)?a=r(D(Aa),[a]):(Bg||(Bg=(new Ag).a()),b=this.Ub(),a=ug(b,[a]));return a};d.t=function(a){if(a&&a.$classData&&a.$classData.qa.Lc){var b=this.Ub();a=a.Ub();b=b===a}else b=!1;return b};d.n=function(){return rt(this,this.Mj)};\nd.Ub=function(){return this.Mj};d.oa=function(a){return!!(a&&a.$classData&&a.$classData.qa.Lc)};function Xb(){var a=new Mv,b=w(Nv);a.Mj=b;return a}d.z=function(){return wi(xi(),this.Mj)};d.$classData=z({tw:0},!1,\"scala.reflect.ClassTag$GenericClassTag\",{tw:1,c:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});function Ov(){this.G=null}Ov.prototype=new kv;Ov.prototype.constructor=Ov;Ov.prototype.a=function(){Gm.prototype.a.call(this);return this};Ov.prototype.fa=function(){Pv||(Pv=(new Qv).a());return(new sn).a()};\nOv.prototype.$classData=z({ox:0},!1,\"scala.collection.Seq$\",{ox:1,me:1,le:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var Rv=void 0;function ch(){Rv||(Rv=(new Ov).a());return Rv}function Sv(){this.G=null}Sv.prototype=new kv;Sv.prototype.constructor=Sv;function Tv(){}Tv.prototype=Sv.prototype;function Uv(){}Uv.prototype=new vq;Uv.prototype.constructor=Uv;Uv.prototype.a=function(){Vv=this;Om(new Nm,Od(function(){return function(a){return a}}(this)));return this};\nfunction Wv(a,b,c,e,f,g,h){var k=31&(b>>>g|0),m=31&(e>>>g|0);if(k!==m)return a=1<a.Kd?(Uu||(Uu=(new Tu).a()),b=Uu):b=a instanceof Pu?og(b,a.gd,a.Kd,a.ve):a===Su()?ng(qg(),b):a;return iw(b)}\nhw.prototype.Jd=function(){return iw(ng(qg(),16))};hw.prototype.$classData=z({Yt:0},!1,\"scalax.collection.mutable.SimpleArraySet$\",{Yt:1,wl:1,Og:1,Ng:1,Cb:1,c:1,Db:1,e:1,d:1});var jw=void 0;function Ls(){jw||(jw=(new hw).a());return jw}function zg(){this.yn=!1;this.Sh=null}zg.prototype=new Fv;zg.prototype.constructor=zg;\nfunction Sb(a,b){for(;\"\"!==b;){var c=b.indexOf(\"\\n\")|0;if(0>c)a.Sh=\"\"+a.Sh+b,b=\"\";else{var e=\"\"+a.Sh+b.substring(0,c);l.console&&(a.yn&&l.console.error?l.console.error(e):l.console.log(e));a.Sh=\"\";b=b.substring(1+c|0)}}}zg.prototype.$e=function(a){this.yn=a;(new Us).a();this.Sh=\"\";return this};zg.prototype.ej=function(){};zg.prototype.$classData=z({Mu:0},!1,\"java.lang.JSConsoleBasedPrintStream\",{Mu:1,FG:1,EG:1,ys:1,c:1,qk:1,Fn:1,gm:1,zu:1});function Kq(){K.call(this);this.ck=this.ak=0}\nKq.prototype=new Vu;Kq.prototype.constructor=Kq;d=Kq.prototype;d.bk=function(){return this.ak};d.g=function(a,b){this.ak=a;this.ck=b;K.prototype.Q.call(this,null,null);return this};d.Qa=function(){return this.ck};d.dk=function(){return this.ck};d.Ga=function(){return this.ak};d.$classData=z({Vv:0},!1,\"scala.Tuple2$mcII$sp\",{Vv:1,um:1,c:1,Sv:1,Ia:1,p:1,e:1,d:1,GH:1});function ve(){W.call(this);this.Fj=null}ve.prototype=new Er;ve.prototype.constructor=ve;d=ve.prototype;d.Ba=function(){return\"UninitializedFieldError\"};\nd.za=function(){return 1};d.t=function(a){return this===a?!0:a instanceof ve?this.Fj===a.Fj:!1};d.U=function(a){switch(a){case 0:return this.Fj;default:throw(new X).h(\"\"+a);}};d.oa=function(a){return a instanceof ve};d.h=function(a){this.Fj=a;W.prototype.Ua.call(this,a,null);return this};d.z=function(){return ui(this)};d.$classData=z({Wv:0},!1,\"scala.UninitializedFieldError\",{Wv:1,wb:1,vb:1,hb:1,c:1,d:1,Ia:1,p:1,e:1});function kw(){}kw.prototype=new A;kw.prototype.constructor=kw;kw.prototype.a=function(){return this};\nkw.prototype.$a=function(a,b){a|=0;b|=0;return a===b?0:a=this.$a(a,b)};kw.prototype.$classData=z({nw:0},!1,\"scala.math.Ordering$Int$\",{nw:1,c:1,NH:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1});var lw=void 0;function mw(){lw||(lw=(new kw).a());return lw}function nw(){this.jc=null}nw.prototype=new A;nw.prototype.constructor=nw;function ow(){}ow.prototype=nw.prototype;nw.prototype.t=function(a){return this===a};nw.prototype.n=function(){return this.jc};\nnw.prototype.oa=function(a){return a instanceof nw};nw.prototype.z=function(){return Ia(this)};function pw(){}pw.prototype=new A;pw.prototype.constructor=pw;function qw(){}qw.prototype=pw.prototype;pw.prototype.oa=function(a){return!!(a&&a.$classData&&a.$classData.qa.md)};function rw(){this.G=null}rw.prototype=new Tv;rw.prototype.constructor=rw;rw.prototype.a=function(){Gm.prototype.a.call(this);sw=this;(new rq).a();return this};rw.prototype.fa=function(){cm();oh();return(new dm).a()};\nrw.prototype.$classData=z({dx:0},!1,\"scala.collection.IndexedSeq$\",{dx:1,vo:1,me:1,le:1,Mc:1,Cb:1,c:1,Nc:1,Db:1});var sw=void 0;function dh(){sw||(sw=(new rw).a());return sw}function tw(){this.wd=this.wg=0;this.Fa=null}tw.prototype=new Yr;tw.prototype.constructor=tw;tw.prototype.u=function(){this.wd>=this.wg&&eh().nb.u();var a=this.Fa.db(this.wd);this.wd=1+this.wd|0;return a};function uw(a,b,c){a.wg=c;if(null===b)throw T(S(),null);a.Fa=b;a.wd=0;return a}tw.prototype.r=function(){return this.wd>>g|0),k=31&(e>>>g|0);if(h!==k)return a=1<>24&&0===(1&a.q)<<24>>24&&(a.Wl=gq(),a.q=(1|a.q)<<24>>24);var b=a.Wl;var c=a=b.mh;if((null===a?null===c:a.t(c))&&0>=b.Fe&&0<=b.Sf){c=0-b.Fe|0;var e=(b.q?b.Cf:aq(b)).b[c];null===e&&(e=Y(),e=fq(new dq,Fn(e,(new x).g(0,0)),a),(b.q?b.Cf:aq(b)).b[c]=e);a=e}else b=(new x).g(0,0),c=new dq,e=new Gn,Gn.prototype.Xk.call(e,b,0),eq(e,a),a=fq(c,e,a);this.nb=a;return this};\nJw.prototype.$classData=z({Dr:0},!1,\"cats.kernel.instances.BigDecimalGroup\",{Dr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Kw(){this.nb=null}Kw.prototype=new A;Kw.prototype.constructor=Kw;Kw.prototype.a=function(){var a=vc();0===(2&a.q)<<24>>24&&0===(2&a.q)<<24>>24&&(a.Xl=nq(),a.q=(2|a.q)<<24>>24);this.nb=kq(a.Xl,0);return this};Kw.prototype.$classData=z({Fr:0},!1,\"cats.kernel.instances.BigIntGroup\",{Fr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Lw(){}Lw.prototype=new A;\nLw.prototype.constructor=Lw;Lw.prototype.a=function(){return this};Lw.prototype.$classData=z({Kr:0},!1,\"cats.kernel.instances.ByteGroup\",{Kr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Mw(){}Mw.prototype=new A;Mw.prototype.constructor=Mw;Mw.prototype.a=function(){return this};Mw.prototype.$classData=z({Pr:0},!1,\"cats.kernel.instances.DurationGroup\",{Pr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Nw(){}Nw.prototype=new A;Nw.prototype.constructor=Nw;Nw.prototype.a=function(){return this};\nNw.prototype.$classData=z({Rr:0},!1,\"cats.kernel.instances.FiniteDurationGroup\",{Rr:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Ow(){}Ow.prototype=new A;Ow.prototype.constructor=Ow;Ow.prototype.a=function(){return this};Ow.prototype.$classData=z({fs:0},!1,\"cats.kernel.instances.ShortGroup\",{fs:1,c:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1});function Pw(){}Pw.prototype=new A;Pw.prototype.constructor=Pw;Pw.prototype.a=function(){return this};\nPw.prototype.$a=function(a,b){return a===b?0:a===b?0:a=this.$a(a,b)};\nQl.prototype.$classData=z({Ts:0},!1,\"scalax.collection.GraphBase$EdgeOrdering$$anon$2\",{Ts:1,c:1,HG:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1,Us:1});function Ll(){this.Vh=this.k=null}Ll.prototype=new A;Ll.prototype.constructor=Ll;function Kl(a,b,c){if(null===b)throw T(S(),null);a.k=b;a.Vh=c;return a}Ll.prototype.$a=function(a,b){return de(this.Vh,a,b)|0};Ll.prototype.mi=function(a,b){return 0>=this.$a(a,b)};\nLl.prototype.$classData=z({Ys:0},!1,\"scalax.collection.GraphBase$NodeOrdering$$anon$1\",{Ys:1,c:1,LG:1,Oj:1,Cj:1,Pj:1,Nj:1,e:1,d:1,Us:1});function dq(){this.Ha=null;this.fj=0}dq.prototype=new oq;dq.prototype.constructor=dq;d=dq.prototype;d.hi=function(){try{return Yq(this.Ha,32),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Yc=function(){return this.Ha.Yc()};\nfunction fq(a,b,c){a.Ha=b;if(null===b)throw(new Bb).h(\"null value for BigDecimal\");if(null===c)throw(new Bb).h(\"null MathContext for BigDecimal\");a.fj=1565550863;return a}d.Aj=function(){try{return Yq(this.Ha,16),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Th=function(){return this.Ha.Xc()<<24>>24};\nd.t=function(a){if(a instanceof dq)return Rw(this,a);if(a instanceof lq){var b=a.qb;b=nf(qf(),b);var c=er(this.Ha);if(b>3.3219280948873626*(-2+(c-this.Ha.R|0)|0)){if(0>=this.Ha.R||0>=ar(this.Ha).R)try{var e=(new Q).j((new lq).Ag(Zq(this.Ha)))}catch(f){if(f instanceof Mn)e=R();else throw f;}else e=R();if(e.m())return!1;e=e.Nb();return 0===fr(a.qb,e.qb)}return!1}return\"number\"===typeof a?(e=+a,Infinity!==e&&-Infinity!==e&&(a=this.Ha.ee(),Infinity!==a&&-Infinity!==a&&a===e)?(e=gq(),Rw(this,cq(a,e.mh))):\n!1):wa(a)?(e=+a,Infinity!==e&&-Infinity!==e&&(a=this.Ha.Kf(),Infinity!==a&&-Infinity!==a&&a===e)?(e=gq(),Rw(this,cq(a,e.mh))):!1):this.zj()&&vb(this,a)};d.yj=function(){return this.hi()&&0<=Yq(this.Ha,32).f&&65535>=Yq(this.Ha,32).f};d.n=function(){return this.Ha.n()};d.xj=function(){try{return Yq(this.Ha,8),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Sb=function(a){return nr(this.Ha,a.Ha)};d.Ro=function(){return this.Ha};d.zi=function(){return this.Ha.Xc()<<16>>16};d.ee=function(){return this.Ha.ee()};\nd.z=function(){if(1565550863===this.fj){if((0>=this.Ha.R||0>=ar(this.Ha).R)&&4934>(er(this.Ha)-this.Ha.R|0))var a=(new lq).Ag(Xq(this.Ha)).z();else{a=this.Ha.ee();if(Infinity!==a&&-Infinity!==a){var b=gq();a=Rw(this,cq(a,b.mh))}else a=!1;a?a=jl(xi(),this.Ha.ee()):(a=ar(this.Ha),a=vi().pi(Xq(lr(a,a.R)).z(),a.R))}this.fj=a}return this.fj};d.Xc=function(){return this.Ha.Xc()};d.zj=function(){try{return Yq(this.Ha,64),!0}catch(a){if(a instanceof Mn)return!1;throw a;}};d.Kf=function(){return this.Ha.Kf()};\nfunction Rw(a,b){return 0===nr(a.Ha,b.Ha)}var bq=z({dw:0},!1,\"scala.math.BigDecimal\",{dw:1,ow:1,Be:1,c:1,d:1,pw:1,ql:1,e:1,Rd:1,bb:1});dq.prototype.$classData=bq;function lq(){this.qb=null}lq.prototype=new oq;lq.prototype.constructor=lq;d=lq.prototype;d.hi=function(){var a=kq(nq(),-2147483648);return 0<=this.Sb(a)?(a=kq(nq(),2147483647),0>=this.Sb(a)):!1};d.Yc=function(){return this.qb.Yc()};d.Aj=function(){var a=kq(nq(),-32768);return 0<=this.Sb(a)?(a=kq(nq(),32767),0>=this.Sb(a)):!1};\nd.Th=function(){return this.qb.Xc()<<24>>24};\nd.t=function(a){if(a instanceof lq)return 0===fr(this.qb,a.qb);if(a instanceof dq)return a.t(this);if(\"number\"===typeof a){a=+a;var b=this.qb;b=nf(qf(),b);if(53>=b)b=!0;else{var c=mr(this.qb);b=1024>=b&&c>=(-53+b|0)&&1024>c}return b&&!Sw(this)?(b=this.qb,Qo(So(),vf(xf(),b))===a):!1}return wa(a)?(a=+a,b=this.qb,b=nf(qf(),b),24>=b?b=!0:(c=mr(this.qb),b=128>=b&&c>=(-24+b|0)&&128>c),b&&!Sw(this)?(b=this.qb,b=vf(xf(),b),ca(Qo(So(),b))===a):!1):this.zj()&&vb(this,a)};\nfunction Sw(a){a=cg(a.qb,2147483647);return 0!==a.N&&!a.t(nq().ro)}d.yj=function(){var a=kq(nq(),0);return 0<=this.Sb(a)?(a=kq(nq(),65535),0>=this.Sb(a)):!1};d.n=function(){var a=this.qb;return vf(xf(),a)};d.xj=function(){var a=kq(nq(),-128);return 0<=this.Sb(a)?(a=kq(nq(),127),0>=this.Sb(a)):!1};d.Sb=function(a){return fr(this.qb,a.qb)};d.Ro=function(){return this.qb};d.zi=function(){return this.qb.Xc()<<16>>16};d.ee=function(){var a=this.qb;return Qo(So(),vf(xf(),a))};\nd.z=function(){if(this.zj()){var a=this.Yc();var b=a.f;a=a.i;b=(-1===a?0<=(-2147483648^b):-1=(-2147483648^b):0>a)?b:ll(xi(),(new x).g(b,a))}else b=wi(xi(),this.qb);return b};d.Xc=function(){return this.qb.Xc()};d.Ag=function(a){this.qb=a;return this};d.zj=function(){var a=mq(nq(),(new x).g(0,-2147483648));return 0<=this.Sb(a)?(a=mq(nq(),(new x).g(-1,2147483647)),0>=this.Sb(a)):!1};d.Kf=function(){var a=this.qb;a=vf(xf(),a);return ca(Qo(So(),a))};\nvar jq=z({fw:0},!1,\"scala.math.BigInt\",{fw:1,ow:1,Be:1,c:1,d:1,pw:1,ql:1,e:1,Rd:1,bb:1});lq.prototype.$classData=jq;function Zh(){this.jc=null}Zh.prototype=new ow;Zh.prototype.constructor=Zh;Zh.prototype.a=function(){this.jc=\"Boolean\";return this};Zh.prototype.$c=function(a){return r(D(Sa),[a])};Zh.prototype.Ub=function(){return w(Sa)};Zh.prototype.$classData=z({xw:0},!1,\"scala.reflect.ManifestFactory$BooleanManifest$\",{xw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Yh=void 0;\nfunction Lh(){this.jc=null}Lh.prototype=new ow;Lh.prototype.constructor=Lh;Lh.prototype.a=function(){this.jc=\"Byte\";return this};Lh.prototype.$c=function(a){return r(D(Va),[a])};Lh.prototype.Ub=function(){return w(Va)};Lh.prototype.$classData=z({yw:0},!1,\"scala.reflect.ManifestFactory$ByteManifest$\",{yw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Kh=void 0;function Ph(){this.jc=null}Ph.prototype=new ow;Ph.prototype.constructor=Ph;Ph.prototype.a=function(){this.jc=\"Char\";return this};\nPh.prototype.$c=function(a){return r(D(Ua),[a])};Ph.prototype.Ub=function(){return w(Ua)};Ph.prototype.$classData=z({zw:0},!1,\"scala.reflect.ManifestFactory$CharManifest$\",{zw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Oh=void 0;function Xh(){this.jc=null}Xh.prototype=new ow;Xh.prototype.constructor=Xh;Xh.prototype.a=function(){this.jc=\"Double\";return this};Xh.prototype.$c=function(a){return r(D(Za),[a])};Xh.prototype.Ub=function(){return w(Za)};\nXh.prototype.$classData=z({Aw:0},!1,\"scala.reflect.ManifestFactory$DoubleManifest$\",{Aw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Wh=void 0;function Vh(){this.jc=null}Vh.prototype=new ow;Vh.prototype.constructor=Vh;Vh.prototype.a=function(){this.jc=\"Float\";return this};Vh.prototype.$c=function(a){return r(D(Ya),[a])};Vh.prototype.Ub=function(){return w(Ya)};Vh.prototype.$classData=z({Bw:0},!1,\"scala.reflect.ManifestFactory$FloatManifest$\",{Bw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});\nvar Uh=void 0;function Rh(){this.jc=null}Rh.prototype=new ow;Rh.prototype.constructor=Rh;Rh.prototype.a=function(){this.jc=\"Int\";return this};Rh.prototype.$c=function(a){return r(D(E),[a])};Rh.prototype.Ub=function(){return w(E)};Rh.prototype.$classData=z({Cw:0},!1,\"scala.reflect.ManifestFactory$IntManifest$\",{Cw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Qh=void 0;function Th(){this.jc=null}Th.prototype=new ow;Th.prototype.constructor=Th;Th.prototype.a=function(){this.jc=\"Long\";return this};\nTh.prototype.$c=function(a){return r(D(Xa),[a])};Th.prototype.Ub=function(){return w(Xa)};Th.prototype.$classData=z({Dw:0},!1,\"scala.reflect.ManifestFactory$LongManifest$\",{Dw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Sh=void 0;function Tw(){this.oe=null}Tw.prototype=new qw;Tw.prototype.constructor=Tw;function Uw(){}Uw.prototype=Tw.prototype;Tw.prototype.t=function(a){return this===a};Tw.prototype.n=function(){return this.oe};Tw.prototype.z=function(){return Ia(this)};\nfunction Nh(){this.jc=null}Nh.prototype=new ow;Nh.prototype.constructor=Nh;Nh.prototype.a=function(){this.jc=\"Short\";return this};Nh.prototype.$c=function(a){return r(D(Wa),[a])};Nh.prototype.Ub=function(){return w(Wa)};Nh.prototype.$classData=z({Hw:0},!1,\"scala.reflect.ManifestFactory$ShortManifest$\",{Hw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var Mh=void 0;function ai(){this.jc=null}ai.prototype=new ow;ai.prototype.constructor=ai;ai.prototype.a=function(){this.jc=\"Unit\";return this};\nai.prototype.$c=function(a){return r(D(Aa),[a])};ai.prototype.Ub=function(){return w(Ra)};ai.prototype.$classData=z({Iw:0},!1,\"scala.reflect.ManifestFactory$UnitManifest$\",{Iw:1,Xf:1,c:1,md:1,Lc:1,ld:1,bd:1,e:1,d:1,p:1});var $h=void 0;function Vw(a,b){if(b instanceof tv&&a instanceof tv){if(a===b)return!0;var c=a.na()===b.na();if(c)for(var e=b.na(),f=0;f=b)){c.ed(b,a);var e=0;for(a=a.v();eb?0:b)|0);var e=0;for(a=a.v();e>16===a};d.Th=function(){Xk();return this.la<<24>>24};\nd.t=function(a){Xk();return a instanceof ux?this.la===a.la:!1};function Fu(a){var b=new ux;b.la=a;return b}d.yj=function(){Xk();var a=this.la;return(65535&Ja(a))===a};d.n=function(){return\"\"+this.la};d.xj=function(){Xk();var a=this.la;return a<<24>>24===a};d.Sb=function(a){var b=this.la;a=+a;return Po(So(),b,a)};d.zi=function(){Xk();return this.la<<16>>16};d.ee=function(){return this.la};d.z=function(){var a=this.la;return Ga(Ha(),a)};d.Xc=function(){Xk();return Ja(this.la)};\nd.Kf=function(){Xk();return ca(this.la)};d.$classData=z({Nz:0},!1,\"scala.runtime.RichDouble\",{Nz:1,c:1,fI:1,Rz:1,ql:1,Tv:1,oo:1,Lz:1,Rd:1,bb:1,Mz:1});z({zq:0},!1,\"cats.instances.Function1Instances$$anon$8\",{zq:1,c:1,AA:1,yA:1,CA:1,Cp:1,e:1,d:1,KA:1,IA:1,DA:1,FA:1});function vx(){}vx.prototype=new A;vx.prototype.constructor=vx;vx.prototype.a=function(){return this};vx.prototype.$a=function(a,b){a=+a;b=+b;return Po(So(),a,b)};vx.prototype.Bc=function(a,b){return+a===+b};\nvx.prototype.$classData=z({Or:0},!1,\"cats.kernel.instances.DoubleOrder\",{Or:1,c:1,sD:1,Pc:1,Jc:1,zc:1,e:1,d:1,CD:1,JC:1,XC:1,Ic:1});function wx(){}wx.prototype=new A;wx.prototype.constructor=wx;wx.prototype.a=function(){return this};wx.prototype.$a=function(a,b){a=+a;b=+b;return Po(So(),a,b)};wx.prototype.Bc=function(a,b){return+a===+b};wx.prototype.$classData=z({Ur:0},!1,\"cats.kernel.instances.FloatOrder\",{Ur:1,c:1,tD:1,Pc:1,Jc:1,zc:1,e:1,d:1,DD:1,KC:1,YC:1,Ic:1});\nfunction hc(a){var b=(new Co).ua(a.Ve.x()),c=a.Ve;a=function(h,k){return function(m){Sl(h.k);var p=m.ra.Xa.U(0);p!==h&&Do(k,p,m)}}(a,b);if(null===c.pb){c=c.vd;for(var e=0,f=c.Ya.b.length;eb)return 1;var c=0;for(a=a.v();a.r();){if(c===b)return a.r()?1:0;a.u();c=1+c|0}return c-b|0}function Bx(a,b){var c=a.na(),e=a.fa();if(1===c)e.Gb(a);else if(1>31===a.i};d.Yc=function(){var a=this.la;return(new x).g(a.f,a.i)};d.Aj=function(){al();var a=this.la,b=a.f<<16>>16;return b===a.f&&b>>31===a.i};function Hu(a,b){a.la=b;return a}d.Th=function(){al();return this.la.f<<24>>24};d.t=function(a){al();var b=this.la;if(a instanceof Iu){a=a.la;var c=a.i;b=b.f===a.f&&b.i===c}else b=!1;return b};\nd.yj=function(){al();var a=this.la,b=65535&a.f;return b===a.f&&b>>31===a.i};d.n=function(){return\"\"+this.la};d.xj=function(){al();var a=this.la,b=a.f<<24>>24;return b===a.f&&b>>31===a.i};d.Sb=function(a){var b=this.la,c=Ma((new x).g(b.f,b.i));b=c.f;c=c.i;var e=Ma(a);a=e.f;e=e.i;return Iq(y(),b,c,a,e)};d.zi=function(){al();return this.la.f<<16>>16};d.ee=function(){return Zk(al(),this.la)};d.z=function(){var a=this.la;return a.f^a.i};d.Xc=function(){al();return this.la.f};\nd.Kf=function(){al();var a=this.la;return ca(Rk(y(),a.f,a.i))};d.$classData=z({Pz:0},!1,\"scala.runtime.RichLong\",{Pz:1,c:1,gI:1,iI:1,Rz:1,ql:1,Tv:1,oo:1,Lz:1,Rd:1,bb:1,Mz:1});function Cx(){}Cx.prototype=new A;Cx.prototype.constructor=Cx;Cx.prototype.a=function(){return this};Cx.prototype.$classData=z({os:0},!1,\"cats.kernel.instances.UnitAlgebra\",{os:1,c:1,kr:1,Cr:1,jr:1,Hd:1,e:1,d:1,$d:1,Zd:1,Gd:1,re:1,se:1});function Dx(a){var b=(new wr).ua(a.x());a=a.pa();Ex(b,a);return b}\nfunction Fx(){this.E=this.k=null}Fx.prototype=new px;Fx.prototype.constructor=Fx;function Gx(){}Gx.prototype=Fx.prototype;Fx.prototype.su=function(a,b){this.E=b;ox.prototype.Ze.call(this,a)};function Hx(a){return 0===a.na()?uw(new tw,a,a.na()).u():a.db(0)}function Ix(a,b){return a.na()-b|0}function Jx(a,b){if(b&&b.$classData&&b.$classData.qa.yh){var c=a.na();if(c===b.na()){for(var e=0;eb||a.m())throw(new X).h(\"\"+b);return a.w()}\nfunction Rx(a,b){if(b&&b.$classData&&b.$classData.qa.Jg){if(a===b)return!0;for(;!a.m()&&!b.m()&&G(H(),a.w(),b.w());)a=a.Aa(),b=b.Aa();return a.m()&&b.m()}return Vw(a,b)}function Sx(a,b){for(;!a.m();){if(!b.l(a.w()))return!1;a=a.Aa()}return!0}function Tx(a,b){for(;!a.m();){if(b.l(a.w()))return(new Q).j(a.w());a=a.Aa()}return R()}function gc(a){for(var b=0;!a.m();)b=1+b|0,a=a.Aa();return b}function Sp(a){if(a.m())throw(new V).a();for(var b=a.Aa();!b.m();)a=b,b=b.Aa();return a.w()}\nfunction Oy(a,b){var c=0;for(;;){if(c===b)return a.m()?0:1;if(a.m())return-1;c=1+c|0;a=a.Aa()}}function Py(a){var b=(new wr).ua(a.x());a.K(F(function(c,e){return function(f){return ur(e,f)}}(a,b)));return b}function Qy(a){return!!(a&&a.$classData&&a.$classData.qa.aa)}function Ry(a){var b=(new wr).ua(a.x());a.K(F(function(c,e){return function(f){return ur(e,f)}}(a,b)));return b}function Sy(a){throw(new V).h(\"key not found: \"+a);}\nfunction Ty(a,b,c,e,f){var g=a.v();a=(new Dt).fi(g,F(function(){return function(h){if(null!==h){var k=h.Ga();h=h.Qa();Sg||(Sg=(new Qg).a());return\"\"+k+\" -\\x3e \"+h}throw(new J).j(h);}}(a)));return Ni(a,b,c,e,f)}function Uy(){}Uy.prototype=new A;Uy.prototype.constructor=Uy;Uy.prototype.a=function(){return this};Uy.prototype.$classData=z({Nr:0},!1,\"cats.kernel.instances.DoubleGroup\",{Nr:1,c:1,vC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,zC:1,DC:1,JD:1,mD:1,QC:1});function Vy(){}Vy.prototype=new A;\nVy.prototype.constructor=Vy;Vy.prototype.a=function(){return this};Vy.prototype.$classData=z({Tr:0},!1,\"cats.kernel.instances.FloatGroup\",{Tr:1,c:1,wC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,AC:1,EC:1,KD:1,nD:1,RC:1});function Wy(){}Wy.prototype=new A;Wy.prototype.constructor=Wy;Wy.prototype.a=function(){return this};Wy.prototype.$classData=z({Vr:0},!1,\"cats.kernel.instances.IntGroup\",{Vr:1,c:1,xC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,BC:1,FC:1,LD:1,oD:1,SC:1});function Xy(){}Xy.prototype=new A;\nXy.prototype.constructor=Xy;Xy.prototype.a=function(){return this};Xy.prototype.$classData=z({$r:0},!1,\"cats.kernel.instances.LongGroup\",{$r:1,c:1,yC:1,re:1,se:1,Gd:1,Hd:1,e:1,d:1,Zd:1,$d:1,CC:1,GC:1,MD:1,pD:1,TC:1});function Yy(){Fx.call(this);this.Gi=this.fk=this.Ve=null}Yy.prototype=new Gx;Yy.prototype.constructor=Yy;function Zy(){}Zy.prototype=Yy.prototype;Yy.prototype.tu=function(a,b,c){Fx.prototype.su.call(this,a,b);this.Ve=iw(c)};\nfunction $y(a){if(null===a.Gi&&null===a.Gi){var b=new Ao;if(null===a)throw T(S(),null);b.k=a;a.Gi=b}return a.Gi}function fc(a){null===a.fk&&(a.fk=(new xx).Dc(Bo($y(a))));return a.fk}z({yq:0},!1,\"cats.instances.Function0Instances$$anon$4\",{yq:1,c:1,lp:1,vf:1,uf:1,sf:1,Ne:1,dc:1,e:1,d:1,Hc:1,yc:1,tf:1,rf:1,Gc:1,rp:1,ch:1});function az(){}az.prototype=new A;az.prototype.constructor=az;az.prototype.a=function(){return this};az.prototype.$a=function(a,b){a=!!a;return a===!!b?0:a?1:-1};\naz.prototype.Bc=function(a,b){return!!a===!!b};az.prototype.$classData=z({Jr:0},!1,\"cats.kernel.instances.BooleanOrder\",{Jr:1,c:1,yD:1,Pc:1,Jc:1,zc:1,e:1,d:1,ID:1,PC:1,cD:1,Ic:1,XD:1,lD:1,ae:1,TD:1,Oe:1});function bz(){}bz.prototype=new A;bz.prototype.constructor=bz;bz.prototype.a=function(){return this};bz.prototype.$a=function(a,b){a|=0;b|=0;return ab?1:0};bz.prototype.Bc=function(a,b){return(a|0)===(b|0)};\nbz.prototype.$classData=z({Lr:0},!1,\"cats.kernel.instances.ByteOrder\",{Lr:1,c:1,qD:1,Pc:1,Jc:1,zc:1,e:1,d:1,AD:1,HC:1,VC:1,Ic:1,ZD:1,fD:1,ae:1,ND:1,Oe:1});function cz(){}cz.prototype=new A;cz.prototype.constructor=cz;cz.prototype.a=function(){return this};cz.prototype.$a=function(a,b){a=null===a?0:a.s;b=null===b?0:b.s;return ab?1:0};cz.prototype.Bc=function(a,b){return(null===a?0:a.s)===(null===b?0:b.s)};\ncz.prototype.$classData=z({Mr:0},!1,\"cats.kernel.instances.CharOrder\",{Mr:1,c:1,rD:1,Pc:1,Jc:1,zc:1,e:1,d:1,BD:1,IC:1,WC:1,Ic:1,aE:1,gD:1,ae:1,OD:1,Oe:1});function dz(){}dz.prototype=new A;dz.prototype.constructor=dz;dz.prototype.a=function(){return this};dz.prototype.$a=function(a,b){a|=0;b|=0;return ab?1:0};dz.prototype.Bc=function(a,b){return(a|0)===(b|0)};\ndz.prototype.$classData=z({Wr:0},!1,\"cats.kernel.instances.IntOrder\",{Wr:1,c:1,uD:1,Pc:1,Jc:1,zc:1,e:1,d:1,ED:1,LC:1,ZC:1,Ic:1,tE:1,hD:1,ae:1,PD:1,Oe:1});function ez(){}ez.prototype=new A;ez.prototype.constructor=ez;ez.prototype.a=function(){return this};ez.prototype.$a=function(a,b){var c=Ma(a);a=c.f;c=c.i;var e=Ma(b);b=e.f;e=e.i;a=(new x).g(a,c);c=(new x).g(b,e);b=a.i;e=c.i;(b===e?(-2147483648^a.f)<(-2147483648^c.f):b(-2147483648^c.f):b>e)?1:0);return a};\nez.prototype.Bc=function(a,b){var c=Ma(a);a=c.f;c=c.i;var e=Ma(b);b=e.f;e=e.i;a=(new x).g(a,c);c=(new x).g(b,e);return a.f===c.f&&a.i===c.i};ez.prototype.$classData=z({as:0},!1,\"cats.kernel.instances.LongOrder\",{as:1,c:1,vD:1,Pc:1,Jc:1,zc:1,e:1,d:1,FD:1,MC:1,$C:1,Ic:1,vE:1,iD:1,ae:1,QD:1,Oe:1});function fz(){}fz.prototype=new A;fz.prototype.constructor=fz;fz.prototype.a=function(){return this};fz.prototype.$a=function(a,b){a|=0;b|=0;return ab?1:0};\nfz.prototype.Bc=function(a,b){return(a|0)===(b|0)};fz.prototype.$classData=z({gs:0},!1,\"cats.kernel.instances.ShortOrder\",{gs:1,c:1,wD:1,Pc:1,Jc:1,zc:1,e:1,d:1,GD:1,NC:1,aD:1,Ic:1,GE:1,jD:1,ae:1,RD:1,Oe:1});function gz(){}gz.prototype=new A;gz.prototype.constructor=gz;gz.prototype.a=function(){return this};gz.prototype.$a=function(){return 0};gz.prototype.Bc=function(){return!0};\ngz.prototype.$classData=z({ps:0},!1,\"cats.kernel.instances.UnitOrder\",{ps:1,c:1,xD:1,Pc:1,Jc:1,zc:1,e:1,d:1,HD:1,OC:1,bD:1,Ic:1,XE:1,kD:1,ae:1,SD:1,Oe:1});function yt(a,b){if(0<=b){a=hz(a,b>>6);var c=a.i&(0===(32&b)?0:1<=e)return a.fa().Ca();c=a.fa();a=a.n().substring(b,e);return c.Gb((new Bc).h(a)).Ca()}\nfunction jz(a,b){Fa();var c=a.n();a=F(function(){return function(f){return f instanceof Sk?f.Ro():f}}(a));var e=ch();return Uj(c,b.Kc(a,e.G).Kb(di()))}function kz(){}kz.prototype=new zx;kz.prototype.constructor=kz;function lz(){}d=lz.prototype=kz.prototype;d.w=function(){return this.v().u()};d.ic=function(){return this.v()};d.je=function(a){return Vw(this,a)};d.Wa=function(a){var b=this.v();return mm(b,a)};d.K=function(a){var b=this.v();nm(b,a)};d.oa=function(){return!0};\nd.Mb=function(a){var b=this.v();return qm(b,a)};d.Jl=function(a){return Ww(this,a)};d.Tb=function(a){return Xw(this,a)};d.Ka=function(){return this.v().Ka()};d.tb=function(a,b,c){Yw(this,a,b,c)};var eu=z({Ja:0},!0,\"scala.collection.immutable.Iterable\",{Ja:1,Oa:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,Na:1,aa:1,ha:1,Y:1,ba:1,p:1});function mz(){this.qf=null}mz.prototype=new A;mz.prototype.constructor=mz;d=mz.prototype;d.ni=function(a,b){return fs(a,b,this.qf)};\nd.xh=function(a){gd||(gd=(new fd).a());var b=this.qf;return nc().Oh(b.xh(a),b)};d.io=function(a){ed||(ed=(new cd).a());return ed.Oh(this.qf.xh(a),this.qf)};d.Rk=function(a,b){return cs(a,b,this.qf)};d.$classData=z({Jp:0},!1,\"cats.data.EitherTInstances1$$anon$14\",{Jp:1,c:1,SA:1,dm:1,cm:1,rf:1,sf:1,Ne:1,dc:1,e:1,d:1,Hc:1,yc:1,tf:1,Gc:1,vf:1,uf:1,RA:1,MA:1});function Tl(a){var b=a.Xa;if(Qy(b))return b.x();if(null!==b)return a.Xa.za();throw(new J).j(b);}\nfunction ho(a,b){switch(b){case 0:return a.Xa.U(0);case 1:return fo(a);default:if(0>b||b>=Tl(a))throw(new X).a();var c=a.Xa;if(Qy(c))return c.Tb(b).w();if(null!==c)return a.Xa.U(b);throw(new J).j(c);}}function nz(a,b){if(oz(b)){var c;!(c=a===b)&&(c=!!(a&&a.$classData&&a.$classData.qa.tk)===!!(b&&b.$classData&&b.$classData.qa.tk))&&(2===Tl(b)?(c=b.Xa.U(0),b=fo(b),c=G(H(),a.Xa.U(0),c)?G(H(),fo(a),b):!1):c=!1);a=c}else a=!1;return a}\nfunction pz(a){a=ko(a);qo||(qo=(new po).a());return U(a,\"\",qo.Tn,\"\")+\"\"}function fo(a){var b=a.Xa;if(Qy(b))return b.Tb(1).w();if(null!==b)return a.Xa.U(1);throw(new J).j(b);}function oz(a){return!!(a&&a.$classData&&a.$classData.qa.sk)}function bo(){Yy.call(this);this.nu=wg();this.ou=null}bo.prototype=new Zy;bo.prototype.constructor=bo;function ao(a,b,c,e){Yy.prototype.tu.call(a,b,c,e);a.nu=wg();a.ou=null;return a}\nbo.prototype.$classData=z({Ft:0},!1,\"scalax.collection.immutable.DefaultGraphImpl$NodeBase\",{Ft:1,oH:1,TG:1,KG:1,c:1,Vs:1,jt:1,Oi:1,Pi:1,VG:1,JG:1,e:1,d:1,hm:1,SG:1,XG:1,lH:1,ZG:1,aH:1});function Bc(){this.ob=null}Bc.prototype=new A;Bc.prototype.constructor=Bc;d=Bc.prototype;d.pa=function(){return(new lj).h(this.ob)};d.Yb=function(a,b){Hi(this,a,b)};d.w=function(){return Hx(this)};d.db=function(a){a=65535&(this.ob.charCodeAt(a)|0);return Zj(a)};d.xd=function(a){return Ix(this,a)};\nd.ic=function(){return uw(new tw,this,this.ob.length|0)};d.je=function(a){return Jx(this,a)};d.Sa=function(){return Kx(this)};d.m=function(){return 0===this.na()};d.Pa=function(){return(new lj).h(this.ob)};d.t=function(a){hj();return a instanceof Bc?this.ob===(null===a?null:a.ob):!1};d.Zc=function(a,b,c){return U(this,a,b,c)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Wa=function(a){return Lx(this,a)};d.n=function(){return this.ob};d.K=function(a){Mx(this,a)};\nd.Sb=function(a){var b=this.ob;return b===a?0:b>>14|0;a=a+(a<<4)|0;return a^(a>>>10|0)};d.eb=function(a){return this.Lf(a,this.kh(a),0)};d.lb=function(){return this};d.Lf=function(){return!1};\nd.wc=function(a){return kA(this,a)};d.Bi=function(){return!0};var xw=z({wi:0},!1,\"scala.collection.immutable.HashSet\",{wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});lA.prototype.$classData=xw;function oA(){}oA.prototype=new bA;oA.prototype.constructor=oA;oA.prototype.a=function(){return this};\noA.prototype.$classData=z({hy:0},!1,\"scala.collection.immutable.ListSet$EmptyListSet$\",{hy:1,fy:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,e:1,d:1});var pA=void 0;function Fw(){pA||(pA=(new oA).a());return pA}function qA(){this.Pl=this.dn=null}qA.prototype=new bA;qA.prototype.constructor=qA;d=qA.prototype;d.Hj=function(){return this.Pl};d.m=function(){return!1};\nd.Hh=function(a){return rA(this,a)?this:cA(this,a)};d.x=function(){a:{var a=this,b=0;for(;;){if(a.m())break a;a=a.Hj();b=1+b|0}}return b};function cA(a,b){var c=new qA;c.dn=b;if(null===a)throw T(S(),null);c.Pl=a;return c}d.eb=function(a){return rA(this,a)};d.Lk=function(){return this.dn};function rA(a,b){for(;;){if(a.m())return!1;if(G(H(),a.Lk(),b))return!0;a=a.Hj()}}d.wc=function(a){return this.Hh(a)};\nd.$classData=z({iy:0},!1,\"scala.collection.immutable.ListSet$Node\",{iy:1,fy:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,e:1,d:1});function sA(){}sA.prototype=new Dz;sA.prototype.constructor=sA;function tA(){}tA.prototype=sA.prototype;sA.prototype.pa=function(){return this};function uA(){}uA.prototype=new mA;uA.prototype.constructor=uA;uA.prototype.a=function(){return this};\nuA.prototype.w=function(){throw(new V).h(\"Empty Set\");};uA.prototype.$classData=z({Sx:0},!1,\"scala.collection.immutable.HashSet$EmptyHashSet$\",{Sx:1,wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});var vA=void 0;function zw(){vA||(vA=(new uA).a());return vA}function cu(){this.te=0;this.fb=null;this.Pg=0}cu.prototype=new mA;cu.prototype.constructor=cu;d=cu.prototype;\nd.Ci=function(a,b,c){var e=1<<(31&(b>>>c|0)),f=oj(Xc(),this.te&(-1+e|0));if(0!==(this.te&e)){e=this.fb.b[f];a=e.Ci(a,b,5+c|0);if(e===a)return this;b=r(D(xw),[this.fb.b.length]);Qr(Sr(),this.fb,0,b,0,this.fb.b.length);b.b[f]=a;return yw(new cu,this.te,b,this.Pg+(a.x()-e.x()|0)|0)}c=r(D(xw),[1+this.fb.b.length|0]);Qr(Sr(),this.fb,0,c,0,f);c.b[f]=nA(a,b);Qr(Sr(),this.fb,f,c,1+f|0,this.fb.b.length-f|0);return yw(new cu,this.te|e,c,1+this.Pg|0)};\nd.K=function(a){for(var b=0;b>>c|0),f=1<>>14|0;a=a+(a<<4)|0;return a^(a>>>10|0)};d.Tc=function(a){return this.rh(a,this.kh(a),0)};\nd.qe=function(a){return SA(this,a)};var Xv=z({vi:0},!1,\"scala.collection.immutable.HashMap\",{vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});MA.prototype.$classData=Xv;function au(){this.Ec=null;this.yb=0}au.prototype=new xA;au.prototype.constructor=au;d=au.prototype;\nd.Ci=function(a,b,c){if(b===this.yb&&G(H(),a,this.Ec))return this;if(b!==this.yb)return ww(Bw(),this.yb,this,b,nA(a,b),c);var e=Fw();c=new UA;a=cA(e,this.Ec).Hh(a);c.yb=b;c.Qf=a;return c};d.K=function(a){a.l(this.Ec)};function nA(a,b){var c=new au;c.Ec=a;c.yb=b;return c}d.x=function(){return 1};d.v=function(){eh();var a=(new cw).Md([this.Ec]);return uw(new tw,a,a.Va.length|0)};d.Lf=function(a,b){return b===this.yb&&G(H(),a,this.Ec)};d.Bi=function(a,b){return a.Lf(this.Ec,this.yb,b)};\nd.$classData=z({Tx:0},!1,\"scala.collection.immutable.HashSet$HashSet1\",{Tx:1,Xx:1,wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});function UA(){this.yb=0;this.Qf=null}UA.prototype=new xA;UA.prototype.constructor=UA;d=UA.prototype;d.Ci=function(a,b,c){b===this.yb?(c=new UA,a=this.Qf.Hh(a),c.yb=b,c.Qf=a,b=c):b=ww(Bw(),this.yb,this,b,nA(a,b),c);return b};\nd.K=function(a){var b=dA(this.Qf);nm(yl(b),a)};d.x=function(){return this.Qf.x()};d.v=function(){var a=dA(this.Qf);return yl(a)};d.Lf=function(a,b){return b===this.yb&&this.Qf.eb(a)};d.Bi=function(a,b){var c=dA(this.Qf);c=yl(c);for(var e=!0;e&&c.r();)e=c.u(),e=a.Lf(e,this.yb,b);return e};\nd.$classData=z({Ux:0},!1,\"scala.collection.immutable.HashSet$HashSetCollision1\",{Ux:1,Xx:1,wi:1,ke:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Wd:1,Ja:1,Oa:1,Na:1,nd:1,e:1,d:1});function VA(){}VA.prototype=new zA;VA.prototype.constructor=VA;VA.prototype.a=function(){return this};\nVA.prototype.$classData=z({dy:0},!1,\"scala.collection.immutable.ListMap$EmptyListMap$\",{dy:1,cy:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1});var WA=void 0;function AA(){WA||(WA=(new VA).a());return WA}function XA(){this.Ql=this.fg=this.Ec=null}XA.prototype=new zA;XA.prototype.constructor=XA;\nfunction YA(a,b){var c=M();for(;;){if(b.m())return Sp(c);if(G(H(),a,b.Eg())){b=b.Tf();for(a=c;!a.m();)c=a.w(),b=BA(b,c.Eg(),c.lf()),a=a.Aa();return b}var e=b.Tf();c=Vb(new N,b,c);b=e}}d=XA.prototype;d.l=function(a){a:{var b=this;for(;;){if(b.m())throw(new V).h(\"key not found: \"+a);if(G(H(),a,b.Eg())){a=b.lf();break a}b=b.Tf()}}return a};d.lf=function(){return this.fg};d.m=function(){return!1};d.Ke=function(a){return this.$g(a)};\nd.x=function(){a:{var a=this,b=0;for(;;){if(a.m())break a;a=a.Tf();b=1+b|0}}return b};d.Eg=function(){return this.Ec};d.$g=function(a){var b=YA(a.Ga(),this);return BA(b,a.Ga(),a.Qa())};d.Nl=function(a,b){var c=YA(a,this);return BA(c,a,b)};d.Tc=function(a){a:{var b=this;for(;;){if(b.m()){a=R();break a}if(G(H(),a,b.Eg())){a=(new Q).j(b.lf());break a}b=b.Tf()}}return a};d.eb=function(a){a:{var b=this;for(;;){if(b.m()){a=!1;break a}if(G(H(),a,b.Eg())){a=!0;break a}b=b.Tf()}}return a};\nfunction BA(a,b,c){var e=new XA;e.Ec=b;e.fg=c;if(null===a)throw T(S(),null);e.Ql=a;return e}d.Tf=function(){return this.Ql};d.qe=function(a){return this.$g(a)};d.$classData=z({ey:0},!1,\"scala.collection.immutable.ListMap$Node\",{ey:1,cy:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1});function cx(){dx.call(this)}cx.prototype=new NA;cx.prototype.constructor=cx;\ncx.prototype.a=function(){dx.prototype.vj.call(this,M(),M());return this};cx.prototype.$classData=z({sy:0},!1,\"scala.collection.immutable.Queue$EmptyQueue$\",{sy:1,xo:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,xi:1,bg:1,Ja:1,Oa:1,Na:1,Jg:1,ti:1,e:1,d:1});var bx=void 0;function ZA(){this.sd=this.xg=this.Xd=0;this.ze=!1;this.tl=this.Lg=0}ZA.prototype=new Dz;ZA.prototype.constructor=ZA;d=ZA.prototype;d.pa=function(){return this};\nd.w=function(){return this.ze?M().pj():this.Xd};d.db=function(a){return $A(this,a)};d.l=function(a){return $A(this,a|0)};d.m=function(){return this.ze};d.Pa=function(){return this};d.t=function(a){if(a instanceof ZA){if(this.ze)return a.ze;if(!a.m()&&this.Xd===a.Xd){var b=aB(this);return b===aB(a)&&(this.Xd===b||this.sd===a.sd)}return!1}return zt(this,a)};function $A(a,b){0>a.Lg&&xq(rh(),a.Xd,a.xg,a.sd);if(0>b||b>=a.Lg)throw(new X).h(\"\"+b);return a.Xd+n(a.sd,b)|0}\nd.Mf=function(a,b,c){this.Xd=a;this.xg=b;this.sd=c;this.ze=a>b&&0c||a===b;if(0===c)throw(new Bb).h(\"step cannot be 0.\");if(this.ze)a=0;else{var e=bB(this);a=e.f;var f=e.i,g=this.sd,h=g>>31;e=y();a=uf(e,a,f,g,h);e=e.M;g=cB(this)?0:1;f=g>>31;g=a+g|0;e=(new x).g(g,(-2147483648^g)<(-2147483648^a)?1+(e+f|0)|0:e+f|0);a=e.f;e=e.i;a=(0===e?-1<(-2147483648^a):0>31,a=gg(y(),a,e,c,f),b=0!==\na?b-a|0:b-c|0}this.tl=b;return this};d.Ra=function(){return cm()};d.n=function(){var a=1===this.sd?\"\":\" by \"+this.sd;return(this.ze?\"empty \":cB(this)?\"\":\"inexact \")+\"Range \"+this.Xd+\" until \"+this.xg+a};d.K=function(a){if(!this.ze)for(var b=this.Xd;;){a.l(b);if(b===this.tl)break;b=b+this.sd|0}};d.x=function(){return this.na()};d.ib=function(){return Dx(this)};d.v=function(){return uw(new tw,this,this.na())};d.na=function(){return 0>this.Lg?xq(rh(),this.Xd,this.xg,this.sd):this.Lg};d.gc=function(){return this.na()};\nfunction cB(a){var b=bB(a),c=b.f;b=b.i;var e=a.sd,f=e>>31;a=y();c=gg(a,c,b,e,f);b=a.M;return 0===c&&0===b}d.Tb=function(a){0>=a||this.ze?a=this:a>=this.Lg&&0<=this.Lg?(a=this.xg,a=(new ZA).Mf(a,a,this.sd)):(a=this.Xd+n(this.sd,a)|0,a=(new ZA).Mf(a,this.xg,this.sd));return a};function aB(a){return a.ze?(a=M(),Sp(a)|0):a.tl}d.z=function(){return jm(this)};function bB(a){var b=a.xg,c=b>>31,e=a.Xd;a=e>>31;e=b-e|0;return(new x).g(e,(-2147483648^e)>(-2147483648^b)?-1+(c-a|0)|0:c-a|0)}\nd.$classData=z({ty:0},!1,\"scala.collection.immutable.Range\",{ty:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,wo:1,bg:1,Ja:1,Oa:1,Na:1,yh:1,Yf:1,nd:1,e:1,d:1});function dB(){}dB.prototype=new Dz;dB.prototype.constructor=dB;function eB(){}d=eB.prototype=dB.prototype;d.pa=function(){return this};d.xd=function(a){return 0>a?1:Oy(this,a)};d.je=function(a){return Rx(this,a)};d.l=function(a){return Qx(this,a|0)};d.Pa=function(){return this};\nd.Qk=function(a,b){if(b.Qe(this)instanceof qv){if(this.m())a=zm();else{b=(new ie).j(this);for(var c=a.l(b.o.w()).Ka();!b.o.m()&&c.m();)b.o=b.o.Aa(),b.o.m()||(c=a.l(b.o.w()).Ka());a=b.o.m()?(lh(),zm()):fB(c,Ob(function(e,f,g){return function(){return f.o.Aa().Qk(g,(lh(),(new zq).a()))}}(this,b,a)))}return a}return ev(this,a,b)};d.t=function(a){return this===a||zt(this,a)};d.bn=function(a){return gB(this,a)};d.Pb=function(a){return this.Zc(\"\",a,\"\")};\nd.Zc=function(a,b,c){var e=this,f=this;for(e.m()||(e=e.Aa());f!==e&&!e.m();){e=e.Aa();if(e.m())break;e=e.Aa();if(e===f)break;f=f.Aa()}return U(this,a,b,c)};d.Wa=function(a){return Sx(this,a)};d.Ra=function(){return lh()};d.n=function(){return U(this,\"Stream(\",\", \",\")\")};d.K=function(a){var b=this;a:for(;;){if(!b.m()){a.l(b.w());b=b.Aa();continue a}break}};d.v=function(){return Xt(this)};d.Mb=function(a){return Tx(this,a)};d.na=function(){for(var a=0,b=this;!b.m();)a=1+a|0,b=b.Aa();return a};\nd.Jl=function(a){return hB(this,a)};d.Ka=function(){return this};d.Tb=function(a){return gB(this,a)};function gB(a,b){for(;;){if(0>=b||a.m())return a;a=a.Aa();b=-1+b|0}}\nd.Hb=function(a,b,c,e){Pi(a,b);if(!this.m()){Qi(a,this.w());b=this;if(b.kf()){var f=this.Aa();if(f.m())return Pi(a,e),a;if(b!==f&&(b=f,f.kf()))for(f=f.Aa();b!==f&&f.kf();)Qi(Pi(a,c),b.w()),b=b.Aa(),f=f.Aa(),f.kf()&&(f=f.Aa());if(f.kf()){for(var g=this,h=0;g!==f;)g=g.Aa(),f=f.Aa(),h=1+h|0;b===f&&0=b||a.m())return lh(),zm();if(1===b)return b=a.w(),xm(new ym,b,Ob(function(){return function(){lh();return zm()}}(a)));var c=a.w();return xm(new ym,c,Ob(function(e,f){return function(){return hB(e.Aa(),-1+f|0)}}(a,b)))}\nfunction fB(a,b){if(a.m())return Sd(b).Ka();var c=a.w();return xm(new ym,c,Ob(function(e,f){return function(){return fB(e.Aa(),f)}}(a,b)))}d.Fb=function(){return\"Stream\"};function iB(a,b){if(b>=a.Eb)throw(new X).h(\"\"+b);return a.Va.b[b]}\nfunction jB(a,b){var c=a.Va.b.length,e=c>>31,f=b>>31;if(f===e?(-2147483648^b)>(-2147483648^c):f>e){f=c<<1;for(c=c>>>31|0|e<<1;;){e=b>>31;var g=f,h=c;if(e===h?(-2147483648^b)>(-2147483648^g):e>h)c=f>>>31|0|c<<1,f<<=1;else break}b=c;if(0===b?-1<(-2147483648^f):0>24&&0===(1&a.q)<<24>>24&&(a.wm=(new Gv).a(),a.q=(1|a.q)<<24>>24);return a.wm}d.ic=function(){return tz(this)};\nd.l=function(a){a:{if(a&&a.$classData&&a.$classData.qa.vk){if(to(a)){var b=this.rd;a=co(Sl(this),a);a=vz(this,a);b=Nz(b,a);break a}throw(new J).j(a);}if(a&&a.$classData&&a.$classData.qa.Oi){if(so(a)){b=this.ac;if(this!==a.k){a=a.E;var c=this.rg.Pe;a=ao(new bo,this,a,c)}b=null!==uj(b.Za,a);break a}if(ro(a)){b=this.rd;this!==a.ra.Xa.U(0).k&&(a=vr(a),a=co(Sl(this),a),a=vz(this,a));b=Nz(b,a);break a}}throw(new J).j(a);}return b};d.Sa=function(){var a=L().G;return O(this,a)};\nd.m=function(){return 0===this.x()};d.Pa=function(){return this};d.t=function(a){return qz(this,a)};function os(a,b,c,e){var f=new kB;f.ug=c;f.rg=e;Ul(f);f.xn=tg(w(uz),f.ug.Ub());f.zn=!tg(w(Wz),f.ug.Ub());f.yu=tg(w(kb),f.ug.Ub());f.yx=wo();f.xx=wo();f.zx=new uo;Ou();f.ac=(new Oz).sj(f);f.rd=(new Xz).sj(f);Ez(f.ac,a);Yz(f.rd,b);return f}d.Pb=function(a){return U(this,\"\",a,\"\")};d.Zc=function(a,b,c){return U(this,a,b,c)};d.Wa=function(a){var b=tz(this);return mm(b,a)};\nd.n=function(){if(100>=Mi(this)){var a=Xn().gj,b=Xn().gj;var c=Xn().gj;0===(2&this.q)<<24>>24&&0===(2&this.q)<<24>>24&&(this.Om=Il(this),this.q=(2|this.q)<<24>>24);var e=this.Om;0===(4&this.q)<<24>>24&&0===(4&this.q)<<24>>24&&(this.Nm=Nl(this),this.q=(4|this.q)<<24>>24);var f=this.Nm;var g=this.ac,h=L().G;g=O(g,h);a=Bx(g,e).Pb(a);e=this.rd;g=L().G;e=O(e,g);b=Bx(e,f).Pb(b);c=\"Graph(\"+(\"\"+a+(0<(a.length|0)&&0<(b.length|0)?c:\"\")+b)+\")\"}else c=fv(this);return c};d.Ra=function(){return ic()};\nd.K=function(a){var b=tz(this);nm(b,a)};d.jf=function(a){var b=tz(this);return mm(b,a)};d.x=function(){return Mi(this)};d.ib=function(){return Py(this)};d.oa=function(){return!0};d.v=function(){return tz(this)};d.Mb=function(a){var b=tz(this);return qm(b,a)};function lB(a,b){var c=a.rd;var e=Sl(a);var f=co(Sl(a),b);e=vz(e.k,f);if(Nz(c,e))return a;c=rz(a.ac);e=sz(a.rd);b=Py(e).Di(b);return os(c,b,a.ug,a.rg)}d.gc=function(){return-1};\nfunction Ol(a){null===a.Ii&&null===a.Ii&&(a.Ii=(new lo).Ze(a));return a.Ii}d.Ka=function(){return tz(this).Ka()};d.Tb=function(a){return Xw(this,a)};d.Hb=function(a,b,c,e){return Ni(this,a,b,c,e)};function Sl(a){null===a.Hi&&null===a.Hi&&(a.Hi=(new Yn).Ze(a));return a.Hi}d.lb=function(){var a=Fp();a=jc(a);return O(this,a)};d.ad=function(){return this};d.tb=function(a,b,c){Yw(this,a,b,c)};d.fc=function(){return!0};d.z=function(){var a=vi();return yi(a,this,a.cg)};\nd.Qb=function(){for(var a=Mp(new Np,eo()),b=tz(this);b.r();){var c=b.u();Op(a,c)}};d.Kc=function(a,b){return hv(this,a,b)};d.Kb=function(a){return Ri(this,a)};d.Rb=function(a){return jb(this,a)};function Jl(a){null===a.Xi&&null===a.Xi&&(a.Xi=(new oo).Ze(a));return a.Xi}\nd.wc=function(a){a:{if(a&&a.$classData&&a.$classData.qa.vk){if(to(a)){a=lB(this,a);break a}throw(new J).j(a);}if(a&&a.$classData&&a.$classData.qa.Oi){if(so(a)){a=a.E;var b=this.ac,c=no(Bz(this),a);null!==uj(b.Za,c)?a=this:(b=rz(this.ac),a=Py(b).Di(a),b=sz(this.rd),a=os(a,b,this.ug,this.rg));break a}if(ro(a)){a=vr(a);a=lB(this,a);break a}}throw(new J).j(a);}return a};function Bz(a){null===a.Wi&&null===a.Wi&&(a.Wi=(new mo).Ze(a));return a.Wi}d.fa=function(){return rs(Ou(),this.ug,this.rg)};d.Fb=function(){return\"Graph\"};\nd.$classData=z({Dt:0},!1,\"scalax.collection.immutable.DefaultGraphImpl\",{Dt:1,c:1,pH:1,Ns:1,Wb:1,P:1,aa:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,ha:1,Y:1,ba:1,p:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,QG:1,WG:1,GG:1,e:1,d:1,NG:1,nH:1,jH:1,YG:1,bH:1,$G:1});function Co(){this.Me=this.Vl=0;this.vl=null;this.Sg=0;this.Dd=null}Co.prototype=new A;Co.prototype.constructor=Co;d=Co.prototype;d.pa=function(){return this};d.Yb=function(a,b){Hi(this,a,b)};\nfunction Do(a,b,c){b=null===b?pb().Ee:b;var e=a.Dd,f=e.b.length;pb();var g=Ia(b);f=qb(a,b,((g<<1)-(g<<8)|0)&(-1+f|0),f);if(0>f){f=~f;e.b[f]=b;e.b[1+f|0]=c;a.Me=1+a.Me|0;if(a.Me>=a.Sg)if(c=a.Dd,b=c.b.length,e=b<<1,1073741824===b){if(536870911===a.Sg)throw(new am).h(\"Capacity exhausted.\");a.Sg=536870911}else if(ba?a=8:536870912a?a=536870912:(Ti||(Ti=(new Si).a()),a=Ti.Gj(a));var b=a<<1;a=b/3|0;b=r(D(C),[b]);this.vl=(new K).Q(a,b);this.Sg=this.vl.bk();this.Dd=this.vl.Qa();return this};function mB(a,b){Do(a,b.Ga(),b.Qa());return a}d.gc=function(){return-1};d.Dc=function(a){Co.prototype.ua.call(this,32);this.Sg=a.Sg;this.Dd=a.Dd.mu();this.Me=a.Me;return this};d.Tc=function(a){up();a=Qz(this,a);return sp(0,a)};\nd.Ka=function(){var a=(new Es).Dc(this);return rm(a)};d.Tb=function(a){return Xw(this,a)};d.Hb=function(a,b,c,e){return Ty(this,a,b,c,e)};function nB(a){return Od(function(){return function(b,c){c|=0;var e=b.b[c];e=e===pb().Ee?pb().Ee:e;return Ia(e)^Ia(b.b[1+c|0])}}(a))}d.lb=function(){var a=Fp();a=jc(a);return O(this,a)};d.ad=function(){return this};d.Ta=function(a){return mB(this,a)};d.hc=function(){};d.tb=function(a,b,c){Yw(this,a,b,c)};d.fc=function(){return!0};\nd.z=function(){var a=this.Dd,b=(new Ds).ei(this),c;for(c=0;b.r();){var e=Ar(b);c=(c|0)+(de(nB(this),a,e)|0)|0}return c|0};d.Qb=function(){for(var a=Mp(new Np,eo()),b=(new Es).Dc(this);b.r();){var c=Fs(b);Op(a,c)}};d.Kc=function(a,b){return hv(this,a,b)};d.Kb=function(a){return Ri(this,a)};d.Rb=function(a){return nt(this,a)};d.qe=function(a){return mB((new Co).Dc(this),a)};d.fa=function(){return(new Co).ua(32)};d.Gb=function(a){return Zi(this,a)};d.Fb=function(){return\"Map\"};\nfunction Qz(a,b){b=null===b?pb().Ee:b;var c=a.Dd.b.length;pb();var e=Ia(b);b=qb(a,b,((e<<1)-(e<<8)|0)&(-1+c|0),c);return 0>b?null:a.Dd.b[1+b|0]}d.$classData=z({Pt:0},!1,\"scalax.collection.mutable.EqHashMap\",{Pt:1,c:1,$H:1,gf:1,hf:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,ef:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,aI:1,tc:1,sc:1,rc:1,ag:1,ff:1,df:1,Ae:1,Mt:1});function oB(){}oB.prototype=new QA;oB.prototype.constructor=oB;oB.prototype.a=function(){return this};\noB.prototype.w=function(){throw(new V).h(\"Empty Map\");};oB.prototype.$classData=z({Lx:0},!1,\"scala.collection.immutable.HashMap$EmptyHashMap$\",{Lx:1,vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});var pB=void 0;function TA(){pB||(pB=(new oB).a());return pB}function $t(){this.Ec=null;this.yb=0;this.Dj=this.fg=null}$t.prototype=new QA;$t.prototype.constructor=$t;\nfunction mv(a){null===a.Dj&&(a.Dj=(new K).Q(a.Ec,a.fg));return a.Dj}function RA(a,b,c,e){var f=new $t;f.Ec=a;f.yb=b;f.fg=c;f.Dj=e;return f}d=$t.prototype;d.Fh=function(a,b,c,e,f,g){if(b===this.yb&&G(H(),a,this.Ec)){if(null===g)return this.fg===e?this:RA(a,b,e,f);a=g.ym(mv(this),null!==f?f:(new K).Q(a,e));return RA(a.Ga(),b,a.Qa(),a)}if(b!==this.yb)return a=RA(a,b,e,f),Wv(Zv(),this.yb,this,b,a,c,2);c=AA();return qB(new rB,b,BA(c,this.Ec,this.fg).Nl(a,e))};\nd.rh=function(a,b){return b===this.yb&&G(H(),a,this.Ec)?(new Q).j(this.fg):R()};d.K=function(a){a.l(mv(this))};d.v=function(){eh();var a=[mv(this)];a=(new cw).Md(a);return uw(new tw,a,a.Va.length|0)};d.x=function(){return 1};d.$classData=z({Mx:0},!1,\"scala.collection.immutable.HashMap$HashMap1\",{Mx:1,vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});\nfunction rB(){this.yb=0;this.Ce=null}rB.prototype=new QA;rB.prototype.constructor=rB;d=rB.prototype;d.Fh=function(a,b,c,e,f,g){if(b===this.yb)return null!==g&&this.Ce.eb(a)?qB(new rB,b,this.Ce.$g(g.ym((new K).Q(a,this.Ce.l(a)),f))):qB(new rB,b,this.Ce.Nl(a,e));a=RA(a,b,e,f);return Wv(Zv(),this.yb,this,b,a,c,1+this.Ce.x()|0)};d.rh=function(a,b){return b===this.yb?this.Ce.Tc(a):R()};d.K=function(a){var b=CA(this.Ce);nm(yl(b),a)};d.v=function(){var a=CA(this.Ce);return yl(a)};d.x=function(){return this.Ce.x()};\nfunction qB(a,b,c){a.yb=b;a.Ce=c;return a}d.$classData=z({Nx:0},!1,\"scala.collection.immutable.HashMap$HashMapCollision1\",{Nx:1,vi:1,ne:1,Sd:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,zd:1,od:1,yd:1,Ad:1,kb:1,P:1,Da:1,Ud:1,Ja:1,Oa:1,Na:1,Vd:1,e:1,d:1,nd:1});function bu(){this.zf=0;this.Sc=null;this.Eb=0}bu.prototype=new QA;bu.prototype.constructor=bu;d=bu.prototype;\nd.Fh=function(a,b,c,e,f,g){var h=1<<(31&(b>>>c|0)),k=oj(Xc(),this.zf&(-1+h|0));if(0!==(this.zf&h)){h=this.Sc.b[k];a=h.Fh(a,b,5+c|0,e,f,g);if(a===h)return this;b=r(D(Xv),[this.Sc.b.length]);Qr(Sr(),this.Sc,0,b,0,this.Sc.b.length);b.b[k]=a;return Yv(this.zf,b,this.Eb+(a.x()-h.x()|0)|0)}c=r(D(Xv),[1+this.Sc.b.length|0]);Qr(Sr(),this.Sc,0,c,0,k);c.b[k]=RA(a,b,e,f);Qr(Sr(),this.Sc,k,c,1+k|0,this.Sc.b.length-k|0);return Yv(this.zf|h,c,1+this.Eb|0)};\nd.rh=function(a,b,c){var e=31&(b>>>c|0);if(-1===this.zf)return this.Sc.b[e].rh(a,b,5+c|0);e=1<a?1:Oy(this,a)};d.l=function(a){return Qx(this,a|0)};d.je=function(a){return Rx(this,a)};\nd.Sa=function(){return this};d.Pa=function(){return this};d.Qk=function(a,b){if(b===L().G){if(this===M())return M();b=this;for(var c=(new Oi).$e(!1),e=(new ie).j(null),f=(new ie).j(null);b!==M();)a.l(b.w()).pa().K(F(function(g,h,k,m){return function(p){h.o?(p=Vb(new N,p,M()),m.o.uc=p,m.o=p):(k.o=Vb(new N,p,M()),m.o=k.o,h.o=!0)}}(this,c,e,f))),b=b.cb();return c.o?e.o:M()}return ev(this,a,b)};d.bn=function(a){return tB(this,a)};d.Wa=function(a){return Sx(this,a)};d.Ra=function(){return L()};\nd.K=function(a){for(var b=this;!b.m();)a.l(b.w()),b=b.cb()};d.v=function(){return yl(this)};function tB(a,b){for(;!a.m()&&0=a)a=M();else{for(var b=Vb(new N,this.w(),M()),c=b,e=this.cb(),f=1;;){if(e.m()){a=this;break a}if(f>>25|0)]=a.gb();a.gb().b[31&(b>>>20|0)]=a.ta();a.ta().b[31&(b>>>15|0)]=a.X();a.X().b[31&(b>>>10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 4:a.Qc(I(a.gb()));a.Ib(I(a.ta()));a.ab(I(a.X()));a.xa(I(a.L()));a.gb().b[31&(b>>>20|0)]=a.ta();a.ta().b[31&(b>>>15|0)]=a.X();a.X().b[31&(b>>>\n10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 3:a.Ib(I(a.ta()));a.ab(I(a.X()));a.xa(I(a.L()));a.ta().b[31&(b>>>15|0)]=a.X();a.X().b[31&(b>>>10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 2:a.ab(I(a.X()));a.xa(I(a.L()));a.X().b[31&(b>>>10|0)]=a.L();a.L().b[31&(b>>>5|0)]=a.mb();break;case 1:a.xa(I(a.L()));a.L().b[31&(b>>>5|0)]=a.mb();break;case 0:break;default:throw(new J).j(c);}}1=a)a=this;else if(this.dg<(this.yg-a|0)){var b=this.dg+a|0,c=-32&b,e=NB(b^(-1+this.yg|0)),f=b&~(-1+(1<h)a.La(I(a.mb()));else if(1024>h)a.xa(I(a.L())),a.L().b[31&(g>>>5|0)]=a.mb(),a.La(Db(a.L(),31&(c>>>5|0)));else if(32768>h)a.xa(I(a.L())),a.ab(I(a.X())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),\n31&(c>>>5|0)));else if(1048576>h)a.xa(I(a.L())),a.ab(I(a.X())),a.Ib(I(a.ta())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.ta().b[31&(g>>>15|0)]=a.X(),a.ab(Db(a.ta(),31&(c>>>15|0))),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),31&(c>>>5|0)));else if(33554432>h)a.xa(I(a.L())),a.ab(I(a.X())),a.Ib(I(a.ta())),a.Qc(I(a.gb())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.ta().b[31&(g>>>15|0)]=a.X(),a.gb().b[31&(g>>>20|0)]=a.ta(),a.Ib(Db(a.gb(),31&(c>>>20|0))),a.ab(Db(a.ta(),\n31&(c>>>15|0))),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),31&(c>>>5|0)));else if(1073741824>h)a.xa(I(a.L())),a.ab(I(a.X())),a.Ib(I(a.ta())),a.Qc(I(a.gb())),a.tg(I(a.Rc())),a.L().b[31&(g>>>5|0)]=a.mb(),a.X().b[31&(g>>>10|0)]=a.L(),a.ta().b[31&(g>>>15|0)]=a.X(),a.gb().b[31&(g>>>20|0)]=a.ta(),a.Rc().b[31&(g>>>25|0)]=a.gb(),a.Qc(Db(a.Rc(),31&(c>>>25|0))),a.Ib(Db(a.gb(),31&(c>>>20|0))),a.ab(Db(a.ta(),31&(c>>>15|0))),a.xa(Db(a.X(),31&(c>>>10|0))),a.La(Db(a.L(),31&(c>>>5|0)));else throw(new Bb).a();}else{g=\n-1+a.kd()|0;switch(g){case 5:a.tg(I(a.Rc()));a.Qc(Db(a.Rc(),31&(c>>>25|0)));a.Ib(Db(a.gb(),31&(c>>>20|0)));a.ab(Db(a.ta(),31&(c>>>15|0)));a.xa(Db(a.X(),31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 4:a.Qc(I(a.gb()));a.Ib(Db(a.gb(),31&(c>>>20|0)));a.ab(Db(a.ta(),31&(c>>>15|0)));a.xa(Db(a.X(),31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 3:a.Ib(I(a.ta()));a.ab(Db(a.ta(),31&(c>>>15|0)));a.xa(Db(a.X(),31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 2:a.ab(I(a.X()));a.xa(Db(a.X(),\n31&(c>>>10|0)));a.La(Db(a.L(),31&(c>>>5|0)));break;case 1:a.xa(I(a.L()));a.La(Db(a.L(),31&(c>>>5|0)));break;case 0:a.La(I(a.mb()));break;default:throw(new J).j(g);}a.nh=!0}a.$h=e;c=-1+e|0;switch(c){case 0:a.td=null;a.Id=null;a.de=null;a.ye=null;a.Ue=null;break;case 1:a.Id=null;a.de=null;a.ye=null;a.Ue=null;break;case 2:a.de=null;a.ye=null;a.Ue=null;break;case 3:a.ye=null;a.Ue=null;break;case 4:a.Ue=null;break;case 5:break;default:throw(new J).j(c);}b=b-f|0;if(32>b)OB(a.Ff,b);else if(1024>b)OB(a.Ff,\n31&b),a.td=PB(a.td,b>>>5|0);else if(32768>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,b>>>10|0);else if(1048576>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,31&(b>>>10|0)),a.de=PB(a.de,b>>>15|0);else if(33554432>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,31&(b>>>10|0)),a.de=PB(a.de,31&(b>>>15|0)),a.ye=PB(a.ye,b>>>20|0);else if(1073741824>b)OB(a.Ff,31&b),a.td=PB(a.td,31&(b>>>5|0)),a.Id=PB(a.Id,31&(b>>>10|0)),a.de=PB(a.de,31&(b>>>15|0)),a.ye=PB(a.ye,31&(b>>>20|0)),\na.Ue=PB(a.Ue,b>>>25|0);else throw(new Bb).a();}else a=oh().Vi;return a};d.Rc=function(){return this.Ue};function NB(a){if(32>a)return 1;if(1024>a)return 2;if(32768>a)return 3;if(1048576>a)return 4;if(33554432>a)return 5;if(1073741824>a)return 6;throw(new Bb).a();}function OB(a,b){for(var c=0;cb?0:b;if(c<=b||b>=(a.Oc.length|0))return(new lj).h(\"\");c=c>(a.Oc.length|0)?a.Oc.length|0:c;Cc();return(new lj).h((null!==a?a.Oc:null).substring(b,c))}d.fa=function(){mj||(mj=(new ij).a());return mj.fa()};d.$classData=z({Ty:0},!1,\"scala.collection.immutable.WrappedString\",{Ty:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,wo:1,bg:1,Ja:1,Oa:1,Na:1,yh:1,Yf:1,yo:1,Tj:1,Rd:1,bb:1});\nfunction N(){this.uc=this.th=null}N.prototype=new sB;N.prototype.constructor=N;d=N.prototype;d.Ba=function(){return\"::\"};d.w=function(){return this.th};d.za=function(){return 2};d.m=function(){return!1};d.cb=function(){return this.uc};d.U=function(a){switch(a){case 0:return this.th;case 1:return this.uc;default:throw(new X).h(\"\"+a);}};d.Aa=function(){return this.uc};function Vb(a,b,c){a.th=b;a.uc=c;return a}\nd.$classData=z({Gx:0},!1,\"scala.collection.immutable.$colon$colon\",{Gx:1,$x:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,xi:1,bg:1,Ja:1,Oa:1,Na:1,Jg:1,ti:1,Ia:1,sl:1,e:1,d:1});function RB(){}RB.prototype=new sB;RB.prototype.constructor=RB;d=RB.prototype;d.a=function(){return this};d.w=function(){this.pj()};d.Ba=function(){return\"Nil\"};d.za=function(){return 0};d.cb=function(){throw(new Pc).h(\"tail of empty list\");};d.m=function(){return!0};\nd.t=function(a){return a&&a.$classData&&a.$classData.qa.dd?a.m():!1};d.U=function(a){throw(new X).h(\"\"+a);};d.pj=function(){throw(new V).h(\"head of empty list\");};d.Aa=function(){return this.cb()};d.$classData=z({qy:0},!1,\"scala.collection.immutable.Nil$\",{qy:1,$x:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,xi:1,bg:1,Ja:1,Oa:1,Na:1,Jg:1,ti:1,Ia:1,sl:1,e:1,d:1});var SB=void 0;function M(){SB||(SB=(new RB).a());return SB}\nfunction TB(){}TB.prototype=new zz;TB.prototype.constructor=TB;function UB(){}d=UB.prototype=TB.prototype;d.pa=function(){return this};d.m=function(){return 0===this.x()};d.t=function(a){return dv(this,a)};d.Ra=function(){xv||(xv=(new vv).a());return xv};d.n=function(){return fv(this)};d.jf=function(a){var b=this.v();return mm(b,a)};d.ib=function(){return Py(this)};d.ed=function(a,b){Sm(this,a,b)};d.hc=function(){};d.z=function(){var a=vi();return yi(a,this,a.cg)};\nd.Kc=function(a,b){return hv(this,a,b)};d.Rb=function(a){return jb(this,a)};d.Gb=function(a){return Zi(this,a)};d.fa=function(){return this.fe()};d.Fb=function(){return\"Set\"};function VB(){this.qj=null;this.qc=0;this.vd=this.pb=null}VB.prototype=new A;VB.prototype.constructor=VB;d=VB.prototype;d.pa=function(){return this};d.Yb=function(a,b){Hi(this,a,b)};d.w=function(){return this.v().u()};d.ic=function(){return this.v()};d.l=function(a){return this.eb(a)};\nd.Sa=function(){var a=L().G;return O(this,a)};d.m=function(){return 0===this.x()};d.Pa=function(){return this};d.t=function(a){return dv(this,a)};d.Pb=function(a){return U(this,\"\",a,\"\")};d.Zc=function(a,b,c){return U(this,a,b,c)};function WB(a,b){Qs(a,b);return a}d.kc=function(a){return WB(this,a)};d.Wa=function(a){var b=this.v();return mm(b,a)};d.n=function(){return fv(this)};d.Ra=function(){return Ls()};\nd.K=function(a){if(null===this.pb)this.vd.K(a);else for(var b=0;b>>1|0,e=e>>>1|0|f<<31,f=g,c=1+c|0;else break}b=1+b|0}};function hz(a,b){return b>6;$B.prototype.zg.call(this,r(D(Xa),[1>6,e=hz(a,c);b=(new x).g(e.f|(0===(32&b)?1<c);if(c>=xt(a)){for(e=xt(a);c>=e;)e<<=1,e=33554432>e?e:33554432;e=r(D(Xa),[e]);Qr(Sr(),a.fb,0,e,0,xt(a));a.fb=e}a.fb.b[c]=b}return a}d.Hb=function(a,b,c,e){Pi(a,b);var f=\"\";b=xt(this)<<6;for(var g=0;g!==b;)yt(this,g)&&(f=Pi(a,f).vc,f.ub+=\"\"+g,f=c),g=1+g|0;return Pi(a,e)};\nd.Em=function(){var a=r(D(Xa),[this.fb.b.length]);Qr(Sr(),this.fb,0,a,0,this.fb.b.length);return(new $B).zg(a)};d.Ta=function(a){return bC(this,a|0)};d.wc=function(a){return this.Fm().Ei(a)};d.Fb=function(){return\"BitSet\"};\nd.$classData=z({Bo:0},!1,\"scala.collection.mutable.BitSet\",{Bo:1,zl:1,xl:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,gf:1,hf:1,ef:1,Wj:1,Wb:1,P:1,Vb:1,Zb:1,bc:1,$b:1,Da:1,Xj:1,Kg:1,tc:1,sc:1,rc:1,ag:1,ff:1,df:1,Ae:1,nz:1,qo:1,tx:1,Fx:1,ax:1,bx:1,e:1,d:1});function xo(){this.fb=null}xo.prototype=new aC;xo.prototype.constructor=xo;d=xo.prototype;d.zg=function(a){$B.prototype.zg.call(this,a);return this};\nd.n=function(){var a=this.fb;var b=[];for(var c=0,e=a.b.length;c>>0)).toString(2),g=(+(g>>>0)).toString(2),g=h+(\"\"+\"00000000000000000000000000000000\".substring(g.length|0)+g)):g=(+(g>>>0)).toString(2);f=jz(f,(new cw).Md([g]));g=l.String.fromCharCode(32);h=l.String.fromCharCode(48);f=f.split(g).join(h);b.push(null===f?null:f);c=1+c|0}a=ka(D(oa),b);b=(new Li).a();c=!0;Pi(b,\"\");e=0;for(f=a.b.length;ea||a>=this.cf)throw(new X).h(\"\"+a);return Qx(this.sb,a)};d.xd=function(a){return 0>a?1:Oy(this.sb,a)};d.l=function(a){return this.db(a|0)};d.je=function(a){return Rx(this.sb,a)};d.m=function(){return 0===this.cf};d.Sa=function(){this.bi=!this.m();return this.sb};d.Pa=function(){return this};\nd.t=function(a){return a instanceof sn?this.sb.t(a.sb):zt(this,a)};d.Pb=function(a){return U(this.sb,\"\",a,\"\")};d.Zc=function(a,b,c){return U(this.sb,a,b,c)};d.kc=function(a){return pn(this,a)};d.Wa=function(a){return Sx(this.sb,a)};d.Ra=function(){return qn()};d.K=function(a){for(var b=this.sb;!b.m();)a.l(b.w()),b=b.cb()};d.Di=function(a){return pn(this,a)};d.ib=function(){var a=this.sb,b=Qq().G;return O(a,b)};d.x=function(){return this.cf};d.Ca=function(){return this.Sa()};\nd.v=function(){var a=new lu;a.Se=this.m()?M():this.sb;return a};d.ed=function(a,b){Sm(this,a,b)};d.Mb=function(a){return Tx(this.sb,a)};d.na=function(){return this.cf};d.Ka=function(){return this.sb.Ka()};d.Hb=function(a,b,c,e){return Ni(this.sb,a,b,c,e)};function pn(a,b){a.bi&&PA(a);if(a.m())a.Rf=Vb(new N,b,M()),a.sb=a.Rf;else{var c=a.Rf;a.Rf=Vb(new N,b,M());c.uc=a.Rf}a.cf=1+a.cf|0;return a}d.lb=function(){var a=this.sb,b=Fp();b=jc(b);return O(a,b)};d.Ta=function(a){return pn(this,a)};d.hc=function(){};\nd.tb=function(a,b,c){Yw(this.sb,a,b,c)};d.Qb=function(){for(var a=this.sb,b=Mp(new Np,eo());!a.m();){var c=a.w();Op(b,c);a=a.cb()}};d.Kb=function(a){return Ri(this.sb,a)};function Up(a,b){a:for(;;){var c=b;if(null!==c&&c===a){b=Ww(a,a.cf);continue a}return Zi(a,b)}}d.Gb=function(a){return Up(this,a)};d.Fb=function(){return\"ListBuffer\"};\nd.$classData=z({hz:0},!1,\"scala.collection.mutable.ListBuffer\",{hz:1,Ao:1,yl:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,Bl:1,gf:1,hf:1,ef:1,Cl:1,ff:1,df:1,Ae:1,Co:1,Do:1,sc:1,rc:1,ag:1,Kg:1,Da:1,yi:1,tc:1,VH:1,UH:1,WH:1,e:1,d:1});function Li(){this.vc=null}Li.prototype=new tA;Li.prototype.constructor=Li;d=Li.prototype;d.pa=function(){return this};d.a=function(){Li.prototype.ru.call(this);return this};d.w=function(){return Hx(this)};\nd.db=function(a){a=65535&(this.vc.ub.charCodeAt(a)|0);return Zj(a)};d.xd=function(a){return Ix(this,a)};d.l=function(a){a=65535&(this.vc.ub.charCodeAt(a|0)|0);return Zj(a)};d.je=function(a){return Jx(this,a)};d.m=function(){return 0===this.na()};d.Sa=function(){return Kx(this)};d.Pa=function(){return this};d.Lo=function(a,b){return this.vc.ub.substring(a,b)};d.kc=function(a){dC(this,null===a?0:a.s);return this};d.Wa=function(a){return Lx(this,a)};d.Ra=function(){aw||(aw=(new $v).a());return aw};\nd.n=function(){return this.vc.ub};d.K=function(a){Mx(this,a)};d.Sb=function(a){var b=this.vc.ub;return b===a?0:bthis.Eb&&1<=a&&(a=r(D(C),[a]),Ka(this.Va,0,a,0,this.Eb),this.Va=a)};d.z=function(){return jm(this)};d.Gb=function(a){return Ex(this,a)};d.Fb=function(){return\"ArrayBuffer\"};\nd.$classData=z({Vy:0},!1,\"scala.collection.mutable.ArrayBuffer\",{Vy:1,Ao:1,yl:1,Td:1,va:1,wa:1,c:1,ja:1,da:1,ea:1,W:1,y:1,A:1,$:1,ca:1,ia:1,ka:1,aa:1,ha:1,Y:1,ba:1,p:1,Bd:1,kb:1,P:1,dd:1,pd:1,qd:1,Bl:1,gf:1,hf:1,ef:1,Cl:1,ff:1,df:1,Ae:1,Co:1,Do:1,sc:1,rc:1,ag:1,Kg:1,Da:1,fz:1,Go:1,Yf:1,Tj:1,tc:1,bI:1,Fo:1,yh:1,nd:1,e:1,d:1});function eC(){this.dj=null}eC.prototype=new A;eC.prototype.constructor=eC;\neC.prototype.a=function(){fC=this;this.dj=(new dz).a();(new Wy).a();hn();(new Tq).a();(new bz).a();(new Lw).a();hn();(new Tq).a();(new cz).a();hn();(new Tq).a();(new ez).a();(new Xy).a();hn();(new Tq).a();(new fz).a();(new Ow).a();hn();(new Tq).a();(new wx).a();(new Vy).a();hn();(new Tq).a();(new vx).a();(new Uy).a();hn();(new Tq).a();(new az).a();hn();(new Tq).a();(new gz).a();(new Cx).a();hn();(new Tq).a();(new Dv).a();(new Kw).a();hn();(new Tq).a();(new Cv).a();(new Jw).a();hn();(new Tq).a();(new Du).a();\n(new lx).a();(new Pw).a();(new ls).a();hn();(new Tq).a();(new Qw).a();hn();(new Tq).a();hn();(new Tq).a();Bv||(Bv=(new Av).a());su||(su=(new ru).a());wu||(wu=(new vu).a());uu||(uu=(new tu).a());(new mx).a();(new Mw).a();Sq||(Sq=(new Rq).a());(new nx).a();(new Nw).a();Sq||(Sq=(new Rq).a());hn();(new Tq).a();hn();(new Tq).a();return this};\neC.prototype.$classData=z({qq:0},!1,\"cats.implicits$\",{qq:1,c:1,ZE:1,gF:1,jF:1,iF:1,kF:1,wG:1,nF:1,zA:1,mF:1,BA:1,pF:1,Yz:1,oF:1,Xz:1,rF:1,sF:1,nG:1,vF:1,Zz:1,wF:1,$z:1,xF:1,GA:1,AF:1,aA:1,BF:1,cA:1,yF:1,zF:1,CF:1,DF:1,FF:1,HF:1,dA:1,IF:1,eA:1,wA:1,NF:1,fA:1,OF:1,mG:1,PF:1,QF:1,hA:1,RF:1,SF:1,UF:1,VF:1,WF:1,ZF:1,$F:1,gG:1,dG:1,vG:1,hG:1,JA:1,iG:1,oA:1,lG:1,qA:1,pG:1,sA:1,qG:1,LA:1,tG:1,uA:1,YF:1,kA:1,AG:1,CG:1,DG:1,$E:1,yG:1,xA:1,hF:1,uG:1,aF:1,GF:1,uF:1,EA:1,XF:1,qF:1,cG:1,oG:1,zG:1,kG:1,bF:1,eG:1,\nrG:1,vA:1,MF:1,gA:1,EF:1,TF:1,BG:1,cF:1,xG:1,LF:1,dF:1,sG:1,lF:1,aG:1,JF:1,jG:1,KF:1,tF:1,eF:1,bG:1,fF:1,fG:1,cB:1,kB:1,IB:1,uE:1,pB:1,$D:1,qB:1,bE:1,KB:1,wE:1,XB:1,HE:1,xB:1,lE:1,rB:1,cE:1,oB:1,YD:1,uC:1,YE:1,sC:1,mC:1,nC:1,oC:1,pC:1,qC:1,RE:1,SE:1,TE:1,UE:1,mB:1,VD:1,lB:1,UD:1,nB:1,WD:1,tB:1,fE:1,gE:1,hE:1,uB:1,iE:1,rr:1,vB:1,CB:1,mE:1,nE:1,oE:1,pE:1,qE:1,rE:1,yB:1,zB:1,AB:1,BB:1,EB:1,FB:1,GB:1,HB:1,sE:1,eD:1,JB:1,Fq:1,Xr:1,Yr:1,Zr:1,MB:1,xE:1,yE:1,Kq:1,bs:1,cs:1,ds:1,es:1,PB:1,zE:1,xr:1,QB:1,RB:1,\nSB:1,TB:1,AE:1,Ar:1,UB:1,VB:1,BE:1,CE:1,DE:1,WB:1,EE:1,FE:1,YB:1,$B:1,ZB:1,dC:1,eC:1,Wq:1,hs:1,is:1,js:1,hC:1,NE:1,iC:1,PE:1,jC:1,kC:1,lC:1,tC:1,WE:1,br:1,qs:1,rs:1,ss:1,dB:1,DB:1,rC:1,eB:1,Mq:1,Hq:1,dr:1,Yq:1,NB:1,aC:1,fB:1,sB:1,eE:1,wB:1,kE:1,gB:1,rq:1,uq:1,tq:1,hB:1,bC:1,OB:1,iB:1,fC:1,jB:1,gC:1,LB:1,LE:1,ME:1,cC:1,IE:1,KE:1,JE:1});var fC=void 0;function Qb(){fC||(fC=(new eC).a());return fC}\n(function(){var a=sc();ka(D(oa),[]);a=es(gs(fs(cs(lc(a),F(function(){return function(c){Qb();c=oc(sc(),c);zv||(zv=(new yv).a());var e=mc(),f=new mz;f.qf=e;if(c instanceof wc)c=f.xh(c.E);else if(c instanceof Fc)c=f.io(c.E);else throw(new J).j(c);return c}}(a)),mc()),F(function(){return function(c){return Tb(sc(),c)}}(a)),mc()),F(function(){return function(c){return Jb(sc(),c)}}(a))),F(function(){return function(c){throw T(S(),c);}}(a)));var b=Cc().Fl;mc();rl(vl(a.s,F(function(){return function(c){if(c instanceof\nwc||c instanceof Fc)return c.E;throw(new J).j(c);}}(a,b))))})();\n//# sourceMappingURL=abc142-opt.js.map\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 363047, "cpu_time_ms": 148, "memory_kb": 30796}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s438013812", "group_id": "codeNet:p02897", "input_text": "const main = function (input) {\n const num = parseInt(input)\nconst numOfEven=Math.round(num/2)\nnumOfEven/num\n console.log(numOfEven);\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1570763782, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/JavaScript/s438013812.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s438013812", "user_id": "u204593575"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "const main = function (input) {\n const num = parseInt(input)\nconst numOfEven=Math.round(num/2)\nnumOfEven/num\n console.log(numOfEven);\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 193, "cpu_time_ms": 66, "memory_kb": 7880}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s698045900", "group_id": "codeNet:p02897", "input_text": "process.stdin.resume();\n\nvar lines = [];\nvar reader = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on(\"line\", line => {\n var num = parseInt(line);\n var odd = 0;\n for (var i = 1; i <= num; i++) {\n if (i % 2 !== 0) {\n odd++;\n }\n }\n p = odd / num;\n console.log(p);\n});\n", "language": "JavaScript", "metadata": {"date": 1569720055, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02897.html", "problem_id": "p02897", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02897/input.txt", "sample_output_relpath": "derived/input_output/data/p02897/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02897/JavaScript/s698045900.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s698045900", "user_id": "u120405020"}, "prompt_components": {"gold_output": "0.5000000000\n", "input_to_evaluate": "process.stdin.resume();\n\nvar lines = [];\nvar reader = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on(\"line\", line => {\n var num = parseInt(line);\n var odd = 0;\n for (var i = 1; i <= num; i++) {\n if (i % 2 !== 0) {\n odd++;\n }\n }\n p = odd / num;\n console.log(p);\n});\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "sample_input": "4\n"}, "reference_outputs": ["0.5000000000\n"], "source_document_id": "p02897", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven is an integer N.\n\nTakahashi chooses an integer a from the positive integers not greater than N with equal probability.\n\nFind the probability that a is odd.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the probability that a is odd.\nYour output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n0.5000000000\n\nThere are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \\frac{2}{4} = 0.5.\n\nSample Input 2\n\n5\n\nSample Output 2\n\n0.6000000000\n\nSample Input 3\n\n1\n\nSample Output 3\n\n1.0000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 337, "cpu_time_ms": 61, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s333312871", "group_id": "codeNet:p02899", "input_text": "function Main(input) {\n input = input.split(\"\\n\"); \n var b = input[1].split(\" \").map(e=>parseInt(e,10)); \n \n var c = \"\"\n b.forEach((ele,ind)=>{\n c+=\" \"+(b.findIndex(e=>e==ind+1)+1)\n })\n\n console.log(c.slice(1))\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n", "language": "JavaScript", "metadata": {"date": 1569720227, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02899.html", "problem_id": "p02899", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02899/input.txt", "sample_output_relpath": "derived/input_output/data/p02899/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02899/JavaScript/s333312871.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s333312871", "user_id": "u968764653"}, "prompt_components": {"gold_output": "3 1 2\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\"); \n var b = input[1].split(\" \").map(e=>parseInt(e,10)); \n \n var c = \"\"\n b.forEach((ele,ind)=>{\n c+=\" \"+(b.findIndex(e=>e==ind+1)+1)\n })\n\n console.log(c.slice(1))\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "sample_input": "3\n2 3 1\n"}, "reference_outputs": ["3 1 2\n"], "source_document_id": "p02899", "source_text": "Score : 300 points\n\nProblem Statement\n\nTakahashi is a teacher responsible for a class of N students.\n\nThe students are given distinct student numbers from 1 to N.\n\nToday, all the students entered the classroom at different times.\n\nAccording to Takahashi's record, there were A_i students in the classroom when student number i entered the classroom (including student number i).\n\nFrom these records, reconstruct the order in which the students entered the classroom.\n\nConstraints\n\n1 \\le N \\le 10^5\n\n1 \\le A_i \\le N\n\nA_i \\neq A_j (i \\neq j)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 \\ldots A_N\n\nOutput\n\nPrint the student numbers of the students in the order the students entered the classroom.\n\nSample Input 1\n\n3\n2 3 1\n\nSample Output 1\n\n3 1 2\n\nFirst, student number 3 entered the classroom.\n\nThen, student number 1 entered the classroom.\n\nFinally, student number 2 entered the classroom.\n\nSample Input 2\n\n5\n1 2 3 4 5\n\nSample Output 2\n\n1 2 3 4 5\n\nSample Input 3\n\n8\n8 2 7 3 4 5 6 1\n\nSample Output 3\n\n8 2 4 5 6 7 3 1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 309, "cpu_time_ms": 2109, "memory_kb": 28112}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s190832286", "group_id": "codeNet:p02903", "input_text": "\nfunction reverse(a){\n return a === 0 ? 1 : 0;\n}\n\nfunction Main(input) {\n const tmp = input.split(\"\\n\")[0].split(\" \").map((v) => (parseInt(v)));\n const h = tmp[0];\n const w = tmp[1];\n const a = tmp[2];\n const b = tmp[3];\n\n const ans = [...Array(h).keys()].map((v) => v < b ? 0 : 1).map((v) => {\n return [...Array(w).keys()].map((x) => x < a ? v : reverse(v))\n })\n\n console.log(ans.map((v) => v.join(\"\")).join(\"\\n\") + \"\\n\");\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1569366508, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02903.html", "problem_id": "p02903", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02903/input.txt", "sample_output_relpath": "derived/input_output/data/p02903/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02903/JavaScript/s190832286.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s190832286", "user_id": "u203527087"}, "prompt_components": {"gold_output": "100\n010\n001\n", "input_to_evaluate": "\nfunction reverse(a){\n return a === 0 ? 1 : 0;\n}\n\nfunction Main(input) {\n const tmp = input.split(\"\\n\")[0].split(\" \").map((v) => (parseInt(v)));\n const h = tmp[0];\n const w = tmp[1];\n const a = tmp[2];\n const b = tmp[3];\n\n const ans = [...Array(h).keys()].map((v) => v < b ? 0 : 1).map((v) => {\n return [...Array(w).keys()].map((x) => x < a ? v : reverse(v))\n })\n\n console.log(ans.map((v) => v.join(\"\")).join(\"\\n\") + \"\\n\");\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a square grid with H rows and W columns.\nSnuke wants to write 0 or 1 in each of the squares.\nHere, all of the following conditions have to be satisfied:\n\nFor every row, the smaller of the following is A: the number of 0s contained in the row, and the number of 1s contained in the row. (If these two numbers are equal, “the smaller” should be read as “either”.)\n\nFor every column, the smaller of the following is B: the number of 0s contained in the column, and the number of 1s contained in the column.\n\nDetermine if these conditions can be satisfied by writing 0 or 1 in each of the squares. If the answer is yes, show one way to fill the squares so that the conditions are satisfied.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\n0 \\leq A\n\n2 \\times A \\leq W\n\n0 \\leq B\n\n2 \\times B \\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W A B\n\nOutput\n\nIf the conditions cannot be satisfied by writing 0 or 1 in each of the squares, print -1.\n\nIf the conditions can be satisfied, print one way to fill the squares so that the conditions are satisfied, in the following format:\n\ns_{11}s_{12}\\cdots s_{1W}\ns_{21}s_{22}\\cdots s_{2W}\n\\vdots\ns_{H1}s_{H2}\\cdots s_{HW}\n\nHere s_{ij} is the digit written in the square at the i-th row from the top and the j-th column from the left in the grid.\n\nIf multiple solutions exist, printing any of them will be accepted.\n\nSample Input 1\n\n3 3 1 1\n\nSample Output 1\n\n100\n010\n001\n\nEvery row contains two 0s and one 1, so the first condition is satisfied.\nAlso, every column contains two 0s and one 1, so the second condition is satisfied.\n\nSample Input 2\n\n1 5 2 0\n\nSample Output 2\n\n01010", "sample_input": "3 3 1 1\n"}, "reference_outputs": ["100\n010\n001\n"], "source_document_id": "p02903", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a square grid with H rows and W columns.\nSnuke wants to write 0 or 1 in each of the squares.\nHere, all of the following conditions have to be satisfied:\n\nFor every row, the smaller of the following is A: the number of 0s contained in the row, and the number of 1s contained in the row. (If these two numbers are equal, “the smaller” should be read as “either”.)\n\nFor every column, the smaller of the following is B: the number of 0s contained in the column, and the number of 1s contained in the column.\n\nDetermine if these conditions can be satisfied by writing 0 or 1 in each of the squares. If the answer is yes, show one way to fill the squares so that the conditions are satisfied.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\n0 \\leq A\n\n2 \\times A \\leq W\n\n0 \\leq B\n\n2 \\times B \\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W A B\n\nOutput\n\nIf the conditions cannot be satisfied by writing 0 or 1 in each of the squares, print -1.\n\nIf the conditions can be satisfied, print one way to fill the squares so that the conditions are satisfied, in the following format:\n\ns_{11}s_{12}\\cdots s_{1W}\ns_{21}s_{22}\\cdots s_{2W}\n\\vdots\ns_{H1}s_{H2}\\cdots s_{HW}\n\nHere s_{ij} is the digit written in the square at the i-th row from the top and the j-th column from the left in the grid.\n\nIf multiple solutions exist, printing any of them will be accepted.\n\nSample Input 1\n\n3 3 1 1\n\nSample Output 1\n\n100\n010\n001\n\nEvery row contains two 0s and one 1, so the first condition is satisfied.\nAlso, every column contains two 0s and one 1, so the second condition is satisfied.\n\nSample Input 2\n\n1 5 2 0\n\nSample Output 2\n\n01010", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 494, "cpu_time_ms": 347, "memory_kb": 51980}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s025697482", "group_id": "codeNet:p02903", "input_text": "\nfunction Main(arg) {\n \n arg = arg.split(\"\\n\")[0];\n var H = arg.split(\" \")[0]-0;\n var W = arg.split(\" \")[1]-0;\n var A = arg.split(\" \")[2]-0;\n var B = arg.split(\" \")[3]-0;\n\n var tmp = new Array(W).fill(0);\n var ans = [];\n for (var i = 0; i < H; i++){\n for (var j = 0; j < W; j++){\n\n if (j < A && i < B) {\n tmp[j] = 0;\n }\n else if(j >= A && i < B) {\n tmp[j] = 1;\n }\n else if(j < A && i >= B) {\n tmp[j] = 1;\n }\n else if(j >= A && i >= B) {\n tmp[j] = 0;\n }\n\n }\n ans[i] = tmp.slice();\n tmp.fill(0);\n }\n\n for (var i = 0; i < H; i++) {\n console.log(ans[i].join(\"\"));\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1569121512, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02903.html", "problem_id": "p02903", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02903/input.txt", "sample_output_relpath": "derived/input_output/data/p02903/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02903/JavaScript/s025697482.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s025697482", "user_id": "u303297838"}, "prompt_components": {"gold_output": "100\n010\n001\n", "input_to_evaluate": "\nfunction Main(arg) {\n \n arg = arg.split(\"\\n\")[0];\n var H = arg.split(\" \")[0]-0;\n var W = arg.split(\" \")[1]-0;\n var A = arg.split(\" \")[2]-0;\n var B = arg.split(\" \")[3]-0;\n\n var tmp = new Array(W).fill(0);\n var ans = [];\n for (var i = 0; i < H; i++){\n for (var j = 0; j < W; j++){\n\n if (j < A && i < B) {\n tmp[j] = 0;\n }\n else if(j >= A && i < B) {\n tmp[j] = 1;\n }\n else if(j < A && i >= B) {\n tmp[j] = 1;\n }\n else if(j >= A && i >= B) {\n tmp[j] = 0;\n }\n\n }\n ans[i] = tmp.slice();\n tmp.fill(0);\n }\n\n for (var i = 0; i < H; i++) {\n console.log(ans[i].join(\"\"));\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have a square grid with H rows and W columns.\nSnuke wants to write 0 or 1 in each of the squares.\nHere, all of the following conditions have to be satisfied:\n\nFor every row, the smaller of the following is A: the number of 0s contained in the row, and the number of 1s contained in the row. (If these two numbers are equal, “the smaller” should be read as “either”.)\n\nFor every column, the smaller of the following is B: the number of 0s contained in the column, and the number of 1s contained in the column.\n\nDetermine if these conditions can be satisfied by writing 0 or 1 in each of the squares. If the answer is yes, show one way to fill the squares so that the conditions are satisfied.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\n0 \\leq A\n\n2 \\times A \\leq W\n\n0 \\leq B\n\n2 \\times B \\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W A B\n\nOutput\n\nIf the conditions cannot be satisfied by writing 0 or 1 in each of the squares, print -1.\n\nIf the conditions can be satisfied, print one way to fill the squares so that the conditions are satisfied, in the following format:\n\ns_{11}s_{12}\\cdots s_{1W}\ns_{21}s_{22}\\cdots s_{2W}\n\\vdots\ns_{H1}s_{H2}\\cdots s_{HW}\n\nHere s_{ij} is the digit written in the square at the i-th row from the top and the j-th column from the left in the grid.\n\nIf multiple solutions exist, printing any of them will be accepted.\n\nSample Input 1\n\n3 3 1 1\n\nSample Output 1\n\n100\n010\n001\n\nEvery row contains two 0s and one 1, so the first condition is satisfied.\nAlso, every column contains two 0s and one 1, so the second condition is satisfied.\n\nSample Input 2\n\n1 5 2 0\n\nSample Output 2\n\n01010", "sample_input": "3 3 1 1\n"}, "reference_outputs": ["100\n010\n001\n"], "source_document_id": "p02903", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have a square grid with H rows and W columns.\nSnuke wants to write 0 or 1 in each of the squares.\nHere, all of the following conditions have to be satisfied:\n\nFor every row, the smaller of the following is A: the number of 0s contained in the row, and the number of 1s contained in the row. (If these two numbers are equal, “the smaller” should be read as “either”.)\n\nFor every column, the smaller of the following is B: the number of 0s contained in the column, and the number of 1s contained in the column.\n\nDetermine if these conditions can be satisfied by writing 0 or 1 in each of the squares. If the answer is yes, show one way to fill the squares so that the conditions are satisfied.\n\nConstraints\n\n1 \\leq H,W \\leq 1000\n\n0 \\leq A\n\n2 \\times A \\leq W\n\n0 \\leq B\n\n2 \\times B \\leq H\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W A B\n\nOutput\n\nIf the conditions cannot be satisfied by writing 0 or 1 in each of the squares, print -1.\n\nIf the conditions can be satisfied, print one way to fill the squares so that the conditions are satisfied, in the following format:\n\ns_{11}s_{12}\\cdots s_{1W}\ns_{21}s_{22}\\cdots s_{2W}\n\\vdots\ns_{H1}s_{H2}\\cdots s_{HW}\n\nHere s_{ij} is the digit written in the square at the i-th row from the top and the j-th column from the left in the grid.\n\nIf multiple solutions exist, printing any of them will be accepted.\n\nSample Input 1\n\n3 3 1 1\n\nSample Output 1\n\n100\n010\n001\n\nEvery row contains two 0s and one 1, so the first condition is satisfied.\nAlso, every column contains two 0s and one 1, so the second condition is satisfied.\n\nSample Input 2\n\n1 5 2 0\n\nSample Output 2\n\n01010", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 837, "cpu_time_ms": 199, "memory_kb": 31124}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s446934763", "group_id": "codeNet:p02909", "input_text": "\"use strict\"\n\nfunction Main(input) {\n input = input.trim();\n if(input === 'Sunny') console.log('Cloudy');\n if(input === 'Rainy') console.log('Sunny');\n if(input === 'Cloudy') console.log('Rainy');\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1582339462, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/JavaScript/s446934763.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s446934763", "user_id": "u634079249"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "\"use strict\"\n\nfunction Main(input) {\n input = input.trim();\n if(input === 'Sunny') console.log('Cloudy');\n if(input === 'Rainy') console.log('Sunny');\n if(input === 'Cloudy') console.log('Rainy');\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 258, "cpu_time_ms": 50, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s157778629", "group_id": "codeNet:p02909", "input_text": "\n// inputに入力データ全体が入る\n\nfunction Main(input) {\n\tS = input.split(\" \");\n\tif (S == 'Sunny'){console.log('Cloudy');\n\t }\n\t else if (S == 'Cloudy'){console.log('Rainy ');\n\t }\n\t \n\t else{ console.log('Sunny');}\n\t \n\t \n\n \n \t } // 1 \n \n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \n \n", "language": "JavaScript", "metadata": {"date": 1568857145, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02909.html", "problem_id": "p02909", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02909/input.txt", "sample_output_relpath": "derived/input_output/data/p02909/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02909/JavaScript/s157778629.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s157778629", "user_id": "u362031378"}, "prompt_components": {"gold_output": "Cloudy\n", "input_to_evaluate": "\n// inputに入力データ全体が入る\n\nfunction Main(input) {\n\tS = input.split(\" \");\n\tif (S == 'Sunny'){console.log('Cloudy');\n\t }\n\t else if (S == 'Cloudy'){console.log('Rainy ');\n\t }\n\t \n\t else{ console.log('Sunny');}\n\t \n\t \n\n \n \t } // 1 \n \n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \n \n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "sample_input": "Sunny\n"}, "reference_outputs": ["Cloudy\n"], "source_document_id": "p02909", "source_text": "Score: 100 points\n\nProblem Statement\n\nThe weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...\n\nGiven is a string S representing the weather in the town today. Predict the weather tomorrow.\n\nConstraints\n\nS is Sunny, Cloudy, or Rainy.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint a string representing the expected weather tomorrow, in the same format in which input is given.\n\nSample Input 1\n\nSunny\n\nSample Output 1\n\nCloudy\n\nIn Takahashi's town, a sunny day is followed by a cloudy day.\n\nSample Input 2\n\nRainy\n\nSample Output 2\n\nSunny", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 530, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s559318923", "group_id": "codeNet:p02910", "input_text": "function Main(input) {\n var od = ['R', 'U', 'D'];\n var ev = ['L', 'U', 'D'];\n input = input.split('');\n\n var results = 'Yes';\n for (var i = 0; i < input.length; i++) {\n if (input[i] == 'U' || input[i] == 'D') {\n continue;\n }\n if (input[i] == 'R') {\n if ((i + 1) % 2 == 0) {\n results = 'No';\n break;\n }\n } else if (input[i] == 'L') {\n if ((i + 1) % 2 != 0) {\n results = 'No';\n break;\n }\n \n }\n }\n console.log(results);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1568597592, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02910.html", "problem_id": "p02910", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02910/input.txt", "sample_output_relpath": "derived/input_output/data/p02910/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02910/JavaScript/s559318923.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s559318923", "user_id": "u081906479"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(input) {\n var od = ['R', 'U', 'D'];\n var ev = ['L', 'U', 'D'];\n input = input.split('');\n\n var results = 'Yes';\n for (var i = 0; i < input.length; i++) {\n if (input[i] == 'U' || input[i] == 'D') {\n continue;\n }\n if (input[i] == 'R') {\n if ((i + 1) % 2 == 0) {\n results = 'No';\n break;\n }\n } else if (input[i] == 'L') {\n if ((i + 1) % 2 != 0) {\n results = 'No';\n break;\n }\n \n }\n }\n console.log(results);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "sample_input": "RUDLUDR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02910", "source_text": "Score: 200 points\n\nProblem Statement\n\nTakahashi will do a tap dance. The dance is described by a string S where each character is L, R, U, or D. These characters indicate the positions on which Takahashi should step. He will follow these instructions one by one in order, starting with the first character.\n\nS is said to be easily playable if and only if it satisfies both of the following conditions:\n\nEvery character in an odd position (1-st, 3-rd, 5-th, \\ldots) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th, \\ldots) is L, U, or D.\n\nYour task is to print Yes if S is easily playable, and No otherwise.\n\nConstraints\n\nS is a string of length between 1 and 100 (inclusive).\n\nEach character of S is L, R, U, or D.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Yes if S is easily playable, and No otherwise.\n\nSample Input 1\n\nRUDLUDR\n\nSample Output 1\n\nYes\n\nEvery character in an odd position (1-st, 3-rd, 5-th, 7-th) is R, U, or D.\n\nEvery character in an even position (2-nd, 4-th, 6-th) is L, U, or D.\n\nThus, S is easily playable.\n\nSample Input 2\n\nDULL\n\nSample Output 2\n\nNo\n\nThe 3-rd character is not R, U, nor D, so S is not easily playable.\n\nSample Input 3\n\nUUUUUUUUUUUUUUU\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nULURU\n\nSample Output 4\n\nNo\n\nSample Input 5\n\nRDULULDURURLRDULRLR\n\nSample Output 5\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 555, "cpu_time_ms": 53, "memory_kb": 9420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s114157460", "group_id": "codeNet:p02911", "input_text": "function Main(input) {\n input = input.split(\"\\n\");//一行目はinput[0]に、二行目はinput[1]に\nvar tmp = input[0].split(\" \");//一行目の要素一つ目をk[0]に、二つ目をk[1]に……\nvar N = tmp[0];\nvar K = tmp[1];\nvar Q = tmp[2];\nif(Q <= K){\n while(N = 0){\n console.log(\"Yes\");\n N --;\n }\n}else{\n while(Q = 0){\n \n\n Q --;\n }\n}\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1568733162, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02911.html", "problem_id": "p02911", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02911/input.txt", "sample_output_relpath": "derived/input_output/data/p02911/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02911/JavaScript/s114157460.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s114157460", "user_id": "u938152299"}, "prompt_components": {"gold_output": "No\nNo\nYes\nNo\nNo\nNo\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");//一行目はinput[0]に、二行目はinput[1]に\nvar tmp = input[0].split(\" \");//一行目の要素一つ目をk[0]に、二つ目をk[1]に……\nvar N = tmp[0];\nvar K = tmp[1];\nvar Q = tmp[2];\nif(Q <= K){\n while(N = 0){\n console.log(\"Yes\");\n N --;\n }\n}else{\n while(Q = 0){\n \n\n Q --;\n }\n}\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "sample_input": "6 3 4\n3\n1\n3\n2\n"}, "reference_outputs": ["No\nNo\nYes\nNo\nNo\nNo\n"], "source_document_id": "p02911", "source_text": "Score: 300 points\n\nProblem Statement\n\nTakahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows.\n\nA game is played by N players, numbered 1 to N. At the beginning of a game, each player has K points.\n\nWhen a player correctly answers a question, each of the other N-1 players receives minus one (-1) point. There is no other factor that affects the players' scores.\n\nAt the end of a game, the players with 0 points or lower are eliminated, and the remaining players survive.\n\nIn the last game, the players gave a total of Q correct answers, the i-th of which was given by Player A_i.\nFor Kizahashi, write a program that determines whether each of the N players survived this game.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq K \\leq 10^9\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq A_i \\leq N\\ (1 \\leq i \\leq Q)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K Q\nA_1\nA_2\n.\n.\n.\nA_Q\n\nOutput\n\nPrint N lines. The i-th line should contain Yes if Player i survived the game, and No otherwise.\n\nSample Input 1\n\n6 3 4\n3\n1\n3\n2\n\nSample Output 1\n\nNo\nNo\nYes\nNo\nNo\nNo\n\nIn the beginning, the players' scores are (3, 3, 3, 3, 3, 3).\n\nPlayer 3 correctly answers a question. The players' scores are now (2, 2, 3, 2, 2, 2).\n\nPlayer 1 correctly answers a question. The players' scores are now (2, 1, 2, 1, 1, 1).\n\nPlayer 3 correctly answers a question. The players' scores are now (1, 0, 2, 0, 0, 0).\n\nPlayer 2 correctly answers a question. The players' scores are now (0, 0, 1, -1, -1, -1).\n\nPlayers 1, 2, 4, 5 and 6, who have 0 points or lower, are eliminated, and Player 3 survives this game.\n\nSample Input 2\n\n6 5 4\n3\n1\n3\n2\n\nSample Output 2\n\nYes\nYes\nYes\nYes\nYes\nYes\n\nSample Input 3\n\n10 13 15\n3\n1\n4\n1\n5\n9\n2\n6\n5\n3\n5\n8\n9\n7\n9\n\nSample Output 3\n\nNo\nNo\nNo\nNo\nYes\nNo\nNo\nNo\nYes\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 417, "cpu_time_ms": 59, "memory_kb": 16716}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s058086842", "group_id": "codeNet:p02915", "input_text": "aaa", "language": "JavaScript", "metadata": {"date": 1568857820, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02915.html", "problem_id": "p02915", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02915/input.txt", "sample_output_relpath": "derived/input_output/data/p02915/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02915/JavaScript/s058086842.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s058086842", "user_id": "u508273185"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "aaa", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "sample_input": "2\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02915", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is going to set a 3-character password.\n\nHow many possible passwords are there if each of its characters must be a digit between 1 and N (inclusive)?\n\nConstraints\n\n1 \\leq N \\leq 9\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of possible passwords.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n8\n\nThere are eight possible passwords: 111, 112, 121, 122, 211, 212, 221, and 222.\n\nSample Input 2\n\n1\n\nSample Output 2\n\n1\n\nThere is only one possible password if you can only use one kind of character.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 3, "cpu_time_ms": 57, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s689878359", "group_id": "codeNet:p02916", "input_text": "function Main(input){\n //パラメータの受け取り\n input = input.split(\"\\n\");\n inputStr = input[0].split(\" \");\n const N = Number.parseInt(inputStr[0]);\n inputStr = input[1].split(\" \");\n const A = inputStr.map(inputStr => Number.parseInt(inputStr));\n inputStr = input[2].split(\" \");\n const B = inputStr.map(inputStr => Number.parseInt(inputStr));\n inputStr = input[3].split(\" \");\n const C = inputStr.map(inputStr => Number.parseInt(inputStr));\n //計算処理\n var ans = B[A[0]-1];\n for(var i=1 ; i Number.parseInt(inputStr));\n inputStr = input[2].split(\" \");\n const B = inputStr.map(inputStr => Number.parseInt(inputStr));\n inputStr = input[3].split(\" \");\n const C = inputStr.map(inputStr => Number.parseInt(inputStr));\n //計算処理\n var ans = B[A[0]-1];\n for(var i=1 ; i{\n if(b_s[x-1]){\n sum += parseInt(b_s[x-1])\n }\n if(x - 1 == last_val + 1){\n if(c_s.length > 0 && c_s[last_val]){\n sum += parseInt(c_s[last_val])\n }else{\n sum += parseInt(c_s)\n }\n }\n last_val = x - 1\n})\n\nconsole.log(sum)", "language": "JavaScript", "metadata": {"date": 1567992682, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02916.html", "problem_id": "p02916", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02916/input.txt", "sample_output_relpath": "derived/input_output/data/p02916/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02916/JavaScript/s366592663.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s366592663", "user_id": "u880432382"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "\"use strict\"\n \nconst arg_str = require('fs').readFileSync('/dev/stdin', 'UTF-8')\nconst args_lines = arg_str.split('\\n')\nconst N = args_lines[0]\nconst a = args_lines[1]\nconst a_s = a.split(' ')\nconst b = args_lines[2]\nconst b_s = b.split(' ')\nconst c = args_lines[3]\nconst c_s = c.split(' ')\n \nlet sum = 0\nlet last_val = -1\n \na_s.map(x=>{\n if(b_s[x-1]){\n sum += parseInt(b_s[x-1])\n }\n if(x - 1 == last_val + 1){\n if(c_s.length > 0 && c_s[last_val]){\n sum += parseInt(c_s[last_val])\n }else{\n sum += parseInt(c_s)\n }\n }\n last_val = x - 1\n})\n\nconsole.log(sum)", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \\ldots, Dish N) once.\n\nThe i-th dish (1 \\leq i \\leq N) he ate was Dish A_i.\n\nWhen he eats Dish i (1 \\leq i \\leq N), he gains B_i satisfaction points.\n\nAdditionally, when he eats Dish i+1 just after eating Dish i (1 \\leq i \\leq N - 1), he gains C_i more satisfaction points.\n\nFind the sum of the satisfaction points he gained.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 20\n\n1 \\leq A_i \\leq N\n\nA_1, A_2, ..., A_N are all different.\n\n1 \\leq B_i \\leq 50\n\n1 \\leq C_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\nC_1 C_2 ... C_{N-1}\n\nOutput\n\nPrint the sum of the satisfaction points Takahashi gained, as an integer.\n\nSample Input 1\n\n3\n3 1 2\n2 5 4\n3 6\n\nSample Output 1\n\n14\n\nTakahashi gained 14 satisfaction points in total, as follows:\n\nFirst, he ate Dish 3 and gained 4 satisfaction points.\n\nNext, he ate Dish 1 and gained 2 satisfaction points.\n\nLastly, he ate Dish 2 and gained 5 + 3 = 8 satisfaction points.\n\nSample Input 2\n\n4\n2 3 4 1\n13 5 8 24\n45 9 15\n\nSample Output 2\n\n74\n\nSample Input 3\n\n2\n1 2\n50 50\n50\n\nSample Output 3\n\n150", "sample_input": "3\n3 1 2\n2 5 4\n3 6\n"}, "reference_outputs": ["14\n"], "source_document_id": "p02916", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1, Dish 2, \\ldots, Dish N) once.\n\nThe i-th dish (1 \\leq i \\leq N) he ate was Dish A_i.\n\nWhen he eats Dish i (1 \\leq i \\leq N), he gains B_i satisfaction points.\n\nAdditionally, when he eats Dish i+1 just after eating Dish i (1 \\leq i \\leq N - 1), he gains C_i more satisfaction points.\n\nFind the sum of the satisfaction points he gained.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 20\n\n1 \\leq A_i \\leq N\n\nA_1, A_2, ..., A_N are all different.\n\n1 \\leq B_i \\leq 50\n\n1 \\leq C_i \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\nB_1 B_2 ... B_N\nC_1 C_2 ... C_{N-1}\n\nOutput\n\nPrint the sum of the satisfaction points Takahashi gained, as an integer.\n\nSample Input 1\n\n3\n3 1 2\n2 5 4\n3 6\n\nSample Output 1\n\n14\n\nTakahashi gained 14 satisfaction points in total, as follows:\n\nFirst, he ate Dish 3 and gained 4 satisfaction points.\n\nNext, he ate Dish 1 and gained 2 satisfaction points.\n\nLastly, he ate Dish 2 and gained 5 + 3 = 8 satisfaction points.\n\nSample Input 2\n\n4\n2 3 4 1\n13 5 8 24\n45 9 15\n\nSample Output 2\n\n74\n\nSample Input 3\n\n2\n1 2\n50 50\n50\n\nSample Output 3\n\n150", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 620, "cpu_time_ms": 1487, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s566348236", "group_id": "codeNet:p02916", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n \tn = Number(input[0].split(\"\"));\n a = input[1].split(\" \").map(Number);\n b = input[2].split(\" \").map(Number);\n c = input[3].split(\" \").map(Number);\n \tvar ans=0;\n \tfor(var i=0; i0&&\"L\"==i[l-1]&&(a=!0):l0&&\"L\"==i[l-1]&&(a=!0):l 0 && index >= 0){\n if(list[index] == -1){\n index--;\n continue;\n }\n if(list[index] < check2[check2.length - 1]){\n check.push(list[index]);\n check2.pop();\n list[index] = -1;\n }\n index--;\n }\n if(check2.length > 0){\n myout(\"No\");\n return;\n }\n }\n //myerr(check);\n myout(\"Yes\");\n}\n\n\n\n", "language": "JavaScript", "metadata": {"date": 1599499903, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02920.html", "problem_id": "p02920", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02920/input.txt", "sample_output_relpath": "derived/input_output/data/p02920/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02920/JavaScript/s944773515.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s944773515", "user_id": "u222822036"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error('\\n↑入力 ↓出力');\n Main();\n});\nfunction makeClone(obj){return (obj instanceof Set) ? new Set(Array.from(obj)) : JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n return {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException ‚There is no more input';}}\n };\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error('debug:' + require('util').inspect(s,false,null));}\n//param \"no\" is\n//unknown or outlier : return i. 1: parseInt.\n//2: split space. 4: split space and parseInt.\n//6: split 1 character. 7: split 1 character and parseInt.\n//8: join space. 9: join nextline. 0: join no character.\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(' ');case 4:return i.split(' ').map(Number);case 6:return i.split('');case 7:return i.split('').map(Number);case 8:return i.join(' ');case 9:return i.join('\\n');case 0:return i.join('');default:return i;}}catch(e){return i;}}\n\n//Don't have to see. end------------------------------------------\nfunction Main(){\n var N = nextInt();\n var list = nextIntArray();\n list.sort(function(a,b){\n return a - b;\n });\n var check = [];\n check.push(list[list.length - 1]);\n list[list.length - 1] = -1;\n for(var i = 0; i < N; i++){\n var check2 = makeClone(check);\n check2.sort(function(a,b){\n return a - b;\n });\n var index = (1 << N) - 1;\n while(check2.length > 0 && index >= 0){\n if(list[index] == -1){\n index--;\n continue;\n }\n if(list[index] < check2[check2.length - 1]){\n check.push(list[index]);\n check2.pop();\n list[index] = -1;\n }\n index--;\n }\n if(check2.length > 0){\n myout(\"No\");\n return;\n }\n }\n //myerr(check);\n myout(\"Yes\");\n}\n\n\n\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nWe have one slime.\n\nYou can set the health of this slime to any integer value of your choice.\n\nA slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.\n\nDetermine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.\n\nHere S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 18\n\n1 \\leq S_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_{2^N}\n\nOutput\n\nIf it is possible to set the healths of the first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals S, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n4 2 3 1\n\nSample Output 1\n\nYes\n\nWe will show one way to make the multiset of the healths of the slimes that will exist in 2 seconds equal to S.\n\nFirst, set the health of the first slime to 4.\n\nBy letting the first slime spawn a slime whose health is 3, the healths of the slimes that exist in 1 second can be 4,~3.\n\nThen, by letting the first slime spawn a slime whose health is 2, and letting the second slime spawn a slime whose health is 1, the healths of the slimes that exist in 2 seconds can be 4,~3,~2,~1, which is equal to S as multisets.\n\nSample Input 2\n\n2\n1 2 3 1\n\nSample Output 2\n\nYes\n\nS may contain multiple instances of the same integer.\n\nSample Input 3\n\n1\n1 1\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n5\n4 3 5 3 1 2 7 8 7 4 6 3 7 2 3 6 2 7 3 2 6 7 3 4 6 7 3 4 2 5 2 3\n\nSample Output 4\n\nNo", "sample_input": "2\n4 2 3 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02920", "source_text": "Score : 600 points\n\nProblem Statement\n\nWe have one slime.\n\nYou can set the health of this slime to any integer value of your choice.\n\nA slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen in one second.\n\nDetermine if it is possible to set the healths of our first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals a multiset S.\n\nHere S is a multiset containing 2^N (possibly duplicated) integers: S_1,~S_2,~...,~S_{2^N}.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 18\n\n1 \\leq S_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 S_2 ... S_{2^N}\n\nOutput\n\nIf it is possible to set the healths of the first slime and the subsequent slimes spawn so that the multiset of the healths of the 2^N slimes that will exist in N seconds equals S, print Yes; otherwise, print No.\n\nSample Input 1\n\n2\n4 2 3 1\n\nSample Output 1\n\nYes\n\nWe will show one way to make the multiset of the healths of the slimes that will exist in 2 seconds equal to S.\n\nFirst, set the health of the first slime to 4.\n\nBy letting the first slime spawn a slime whose health is 3, the healths of the slimes that exist in 1 second can be 4,~3.\n\nThen, by letting the first slime spawn a slime whose health is 2, and letting the second slime spawn a slime whose health is 1, the healths of the slimes that exist in 2 seconds can be 4,~3,~2,~1, which is equal to S as multisets.\n\nSample Input 2\n\n2\n1 2 3 1\n\nSample Output 2\n\nYes\n\nS may contain multiple instances of the same integer.\n\nSample Input 3\n\n1\n1 1\n\nSample Output 3\n\nNo\n\nSample Input 4\n\n5\n4 3 5 3 1 2 7 8 7 4 6 3 7 2 3 6 2 7 3 2 6 7 3 4 6 7 3 4 2 5 2 3\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2508, "cpu_time_ms": 296, "memory_kb": 73436}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s239645021", "group_id": "codeNet:p02921", "input_text": "function Main(input) {\n const args = input.split('\\n');\n const s = args[0];\n const t = args[1];\n var count = 0;\n for(var i = 0; i < s.length; i++){\n if(s.charAt(i) == t.charAt(i)){\n count++;\n }\n }\n \n console.log(count);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1567364851, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/JavaScript/s239645021.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s239645021", "user_id": "u270793064"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n const args = input.split('\\n');\n const s = args[0];\n const t = args[1];\n var count = 0;\n for(var i = 0; i < s.length; i++){\n if(s.charAt(i) == t.charAt(i)){\n count++;\n }\n }\n \n console.log(count);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 454, "cpu_time_ms": 219, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s821984355", "group_id": "codeNet:p02921", "input_text": "const stringList = require('fs').readFileSync('/dev/stdin','utf8').trim().split('\\n')\n\nvar m = 0\nfor(var i in stringList[0]) {\n if(stringList[0][i] === stringList[1][i]) {\n m += 1\n }\n}\n\nconsole.log(m)\n", "language": "JavaScript", "metadata": {"date": 1567364729, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02921.html", "problem_id": "p02921", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02921/input.txt", "sample_output_relpath": "derived/input_output/data/p02921/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02921/JavaScript/s821984355.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s821984355", "user_id": "u506624290"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "const stringList = require('fs').readFileSync('/dev/stdin','utf8').trim().split('\\n')\n\nvar m = 0\nfor(var i in stringList[0]) {\n if(stringList[0][i] === stringList[1][i]) {\n m += 1\n }\n}\n\nconsole.log(m)\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "sample_input": "CSS\nCSR\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02921", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nYou will also be given a string T of length 3 representing the actual weather on those three days.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the actual weather on the i-th day. S, C, and R stand for sunny, cloudy, and rainy, respectively.\n\nPrint the number of days for which the forecast was correct.\n\nConstraints\n\nS and T are strings of length 3 each.\n\nS and T consist of S, C, and R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nPrint the number of days for which the forecast was correct.\n\nSample Input 1\n\nCSS\nCSR\n\nSample Output 1\n\n2\n\nFor the first day, it was forecast to be cloudy, and it was indeed cloudy.\n\nFor the second day, it was forecast to be sunny, and it was indeed sunny.\n\nFor the third day, it was forecast to be sunny, but it was rainy.\n\nThus, the forecast was correct for two days in this case.\n\nSample Input 2\n\nSSR\nSSR\n\nSample Output 2\n\n3\n\nSample Input 3\n\nRRR\nSSS\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 206, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s791750668", "group_id": "codeNet:p02922", "input_text": "function *main() {\n \n const [A, B] = (yield).split(\" \").map(s => +s);\n console.log(Math.ceil((B-1)/(A-1)));\n \n}\n\nconst iter = main();\niter.next();\nrequire(\"readline\").createInterface({input: process.stdin}).on(\"line\", s => iter.next(s));\n", "language": "JavaScript", "metadata": {"date": 1594079157, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/JavaScript/s791750668.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s791750668", "user_id": "u347948131"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function *main() {\n \n const [A, B] = (yield).split(\" \").map(s => +s);\n console.log(Math.ceil((B-1)/(A-1)));\n \n}\n\nconst iter = main();\niter.next();\nrequire(\"readline\").createInterface({input: process.stdin}).on(\"line\", s => iter.next(s));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 242, "cpu_time_ms": 74, "memory_kb": 30012}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s721305812", "group_id": "codeNet:p02922", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var ab = lines[0].split(' ');\n var a = Number(ab[0]);\n var b = Number(ab[1]);\nvar outlet = 1;\nvar ans = 0;\n\nwhile(outlet < b){\n outlet--;\n outlet += a;\n ans++;\n}\n\n\nconsole.log(ans);\n \n});", "language": "JavaScript", "metadata": {"date": 1588126903, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/JavaScript/s721305812.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s721305812", "user_id": "u253481827"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var ab = lines[0].split(' ');\n var a = Number(ab[0]);\n var b = Number(ab[1]);\nvar outlet = 1;\nvar ans = 0;\n\nwhile(outlet < b){\n outlet--;\n outlet += a;\n ans++;\n}\n\n\nconsole.log(ans);\n \n});", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 453, "cpu_time_ms": 61, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s376238365", "group_id": "codeNet:p02922", "input_text": "'use strict'\n\nconst main = input => {\n\tconst args = input.split('\\n').map(arg => arg.split(' '))\n\tconst A = parseInt(args[0][0], 10)\n\tconst B = parseInt(args[0][1], 10)\n\tlet num = 0\n\tlet sum = 1\n\n\twhile (true) {\n\t\tif (sum >= B) break\n\t\tsum--\n\t\tsum += A\n\t\tnum++\n\t}\n\n\tconsole.log(num)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1567370100, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/JavaScript/s376238365.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s376238365", "user_id": "u608105024"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "'use strict'\n\nconst main = input => {\n\tconst args = input.split('\\n').map(arg => arg.split(' '))\n\tconst A = parseInt(args[0][0], 10)\n\tconst B = parseInt(args[0][1], 10)\n\tlet num = 0\n\tlet sum = 1\n\n\twhile (true) {\n\t\tif (sum >= B) break\n\t\tsum--\n\t\tsum += A\n\t\tnum++\n\t}\n\n\tconsole.log(num)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 341, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s366156993", "group_id": "codeNet:p02922", "input_text": "const main = input =>{\n\n const arr = input.split(\" \").map(n => Number(n));\n const num = arr[0];\n const need = arr[1];\n\n var output = 0;\n var result = 0;\n\n for(var i = 0; i < 20; i++ ){\n result ++;\n output += num;\n if(output >= need){\n break;\n }\n\n output --;\n }\n\n console.log(result);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1567367033, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02922.html", "problem_id": "p02922", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02922/input.txt", "sample_output_relpath": "derived/input_output/data/p02922/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02922/JavaScript/s366156993.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s366156993", "user_id": "u393881437"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const main = input =>{\n\n const arr = input.split(\" \").map(n => Number(n));\n const num = arr[0];\n const need = arr[1];\n\n var output = 0;\n var result = 0;\n\n for(var i = 0; i < 20; i++ ){\n result ++;\n output += num;\n if(output >= need){\n break;\n }\n\n output --;\n }\n\n console.log(result);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "sample_input": "4 10\n"}, "reference_outputs": ["3\n"], "source_document_id": "p02922", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi's house has only one socket.\n\nTakahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets.\n\nOne power strip with A sockets can extend one empty socket into A empty sockets.\n\nFind the minimum number of power strips required.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq A \\leq 20\n\n1 \\leq B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the minimum number of power strips required.\n\nSample Input 1\n\n4 10\n\nSample Output 1\n\n3\n\n3 power strips, each with 4 sockets, extend the socket into 10 empty sockets.\n\nSample Input 2\n\n8 9\n\nSample Output 2\n\n2\n\n2 power strips, each with 8 sockets, extend the socket into 15 empty sockets.\n\nSample Input 3\n\n8 8\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 411, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s589586071", "group_id": "codeNet:p02923", "input_text": "\n\nfunction Main(input) {\n input=input.split(\"\\n\");\n if(input[input.length-1]===''){\n input.pop();\n }\n const N=input[0].split(' ')[0]-0;\n const S=input[1].split(' ').map(e=>{\n return e-0;\n });\n var max=0;\n var previous=0;\n var temp=0;\n for(var i=0;i=S[i]){\n temp++;\n }else{\n max=Math.max(max,temp);\n temp=0;\n }\n previous=S[i];\n }\n max=Math.max(max,temp);\n \n console.log(max);\n \n}\n\n\n\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1599828995, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/JavaScript/s589586071.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s589586071", "user_id": "u862192359"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n\nfunction Main(input) {\n input=input.split(\"\\n\");\n if(input[input.length-1]===''){\n input.pop();\n }\n const N=input[0].split(' ')[0]-0;\n const S=input[1].split(' ').map(e=>{\n return e-0;\n });\n var max=0;\n var previous=0;\n var temp=0;\n for(var i=0;i=S[i]){\n temp++;\n }else{\n max=Math.max(max,temp);\n temp=0;\n }\n previous=S[i];\n }\n max=Math.max(max,temp);\n \n console.log(max);\n \n}\n\n\n\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 635, "cpu_time_ms": 91, "memory_kb": 39796}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s062776881", "group_id": "codeNet:p02923", "input_text": "function Main(input) {\n\tvar data = input.split(\"\\n\");\n\tvar n = data[0];\n\tvar masu = data[1].split(\" \").map((n) => parseInt(n, 10));\n\tvar max = 0;\n\tvar t = 0;\n\tfor(var i = (n - 1); i>=0; i--){\n\t\tconsole.log(masu[i], masu[i-1])\n\t\tif(masu[i] <= masu[i-1]){\n\t\t\tt++;\n\t\t\tif(t>max) max = t;\n\t\t}else if(masu[i] > masu[i-1]){\n\t\t\tt = 0;\n\t\t}\n\t}\n\tconsole.log(max)\n}\n \n// Don't edit this line!\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1584043287, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/JavaScript/s062776881.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s062776881", "user_id": "u525357693"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n\tvar data = input.split(\"\\n\");\n\tvar n = data[0];\n\tvar masu = data[1].split(\" \").map((n) => parseInt(n, 10));\n\tvar max = 0;\n\tvar t = 0;\n\tfor(var i = (n - 1); i>=0; i--){\n\t\tconsole.log(masu[i], masu[i-1])\n\t\tif(masu[i] <= masu[i-1]){\n\t\t\tt++;\n\t\t\tif(t>max) max = t;\n\t\t}else if(masu[i] > masu[i-1]){\n\t\t\tt = 0;\n\t\t}\n\t}\n\tconsole.log(max)\n}\n \n// Don't edit this line!\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 437, "cpu_time_ms": 1090, "memory_kb": 34492}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s488253370", "group_id": "codeNet:p02923", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n input = input.split(\"\\n\");\n var n = parseInt(input[0], 10);\n var h = input[1].split(\" \");\n var count = 0;\n var max = c;\n for (var i = 0; i < (n - 1); i++) {\n if (h[i] >= h[i + 1]) {\n count++;\n } else {\n count = 0;\n }\n if (count > max) {\n max = count;\n }\n }\n //出力\n console.log('%s', max);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1567609190, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02923.html", "problem_id": "p02923", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02923/input.txt", "sample_output_relpath": "derived/input_output/data/p02923/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02923/JavaScript/s488253370.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s488253370", "user_id": "u729888731"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n input = input.split(\"\\n\");\n var n = parseInt(input[0], 10);\n var h = input[1].split(\" \");\n var count = 0;\n var max = c;\n for (var i = 0; i < (n - 1); i++) {\n if (h[i] >= h[i + 1]) {\n count++;\n } else {\n count = 0;\n }\n if (count > max) {\n max = count;\n }\n }\n //出力\n console.log('%s', max);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "sample_input": "5\n10 4 8 7 3\n"}, "reference_outputs": ["2\n"], "source_document_id": "p02923", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N squares arranged in a row from left to right.\n\nThe height of the i-th square from the left is H_i.\n\nYou will land on a square of your choice, then repeat moving to the adjacent square on the right as long as the height of the next square is not greater than that of the current square.\n\nFind the maximum number of times you can move.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq H_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the maximum number of times you can move.\n\nSample Input 1\n\n5\n10 4 8 7 3\n\nSample Output 1\n\n2\n\nBy landing on the third square from the left, you can move to the right twice.\n\nSample Input 2\n\n7\n4 4 5 6 6 5 5\n\nSample Output 2\n\n3\n\nBy landing on the fourth square from the left, you can move to the right three times.\n\nSample Input 3\n\n4\n1 2 3 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 695, "cpu_time_ms": 67, "memory_kb": 17996}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s924458057", "group_id": "codeNet:p02924", "input_text": "const line = require('fs').readFileSync('/dev/stdin','utf8').trim()\n\nconst n = parseInt(line)\n\nvar answer = n * (n - 1) >> 1\n\nconsole.log(answer)\n\n\n", "language": "JavaScript", "metadata": {"date": 1567373568, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02924.html", "problem_id": "p02924", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02924/input.txt", "sample_output_relpath": "derived/input_output/data/p02924/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02924/JavaScript/s924458057.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s924458057", "user_id": "u506624290"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "const line = require('fs').readFileSync('/dev/stdin','utf8').trim()\n\nconst n = parseInt(line)\n\nvar answer = n * (n - 1) >> 1\n\nconsole.log(answer)\n\n\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "sample_input": "2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02924", "source_text": "Score : 400 points\n\nProblem Statement\n\nFor an integer N, we will choose a permutation \\{P_1, P_2, ..., P_N\\} of \\{1, 2, ..., N\\}.\n\nThen, for each i=1,2,...,N, let M_i be the remainder when i is divided by P_i.\n\nFind the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nConstraints\n\nN is an integer satisfying 1 \\leq N \\leq 10^9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the maximum possible value of M_1 + M_2 + \\cdots + M_N.\n\nSample Input 1\n\n2\n\nSample Output 1\n\n1\n\nWhen the permutation \\{P_1, P_2\\} = \\{2, 1\\} is chosen, M_1 + M_2 = 1 + 0 = 1.\n\nSample Input 2\n\n13\n\nSample Output 2\n\n78\n\nSample Input 3\n\n1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 148, "cpu_time_ms": 55, "memory_kb": 9420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s487841705", "group_id": "codeNet:p02925", "input_text": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n=o.a();\n var t=o.m(n);\n var graph=xArray(\"{from:[],to:[]}\",n*(n-1)/2);\n for(var i=0;i>1)+Math.min(a,b);\n}\n\nfunction topologicalSort(g){\n var n=g.length;\n var a=Array(n).fill(0);\n var q=[];\n for(var i=0;i+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n=o.a();\n var t=o.m(n);\n var graph=xArray(\"{from:[],to:[]}\",n*(n-1)/2);\n for(var i=0;i>1)+Math.min(a,b);\n}\n\nfunction topologicalSort(g){\n var n=g.length;\n var a=Array(n).fill(0);\n var q=[];\n for(var i=0;i {\n rl.question('', (str) => {\n const arr = str.split(' ');\n const nums = arr.map((num) => parseInt(num));\n nums.sort((a, b) => a - b);\n var averSum = nums[0];\n // for(let i = 1; i < parseInt(N); i++) {\n // averSum = (averSum + nums[i]) / 2;\n // }\n // console.log(averSum);\n });\n});", "language": "JavaScript", "metadata": {"date": 1566180767, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02935.html", "problem_id": "p02935", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02935/input.txt", "sample_output_relpath": "derived/input_output/data/p02935/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02935/JavaScript/s501216583.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s501216583", "user_id": "u026949979"}, "prompt_components": {"gold_output": "3.5\n", "input_to_evaluate": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question('', (N) => {\n rl.question('', (str) => {\n const arr = str.split(' ');\n const nums = arr.map((num) => parseInt(num));\n nums.sort((a, b) => a - b);\n var averSum = nums[0];\n // for(let i = 1; i < parseInt(N); i++) {\n // averSum = (averSum + nums[i]) / 2;\n // }\n // console.log(averSum);\n });\n});", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "sample_input": "2\n3 4\n"}, "reference_outputs": ["3.5\n"], "source_document_id": "p02935", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \\leq i \\leq N) is v_i.\n\nWhen you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.\n\nAfter you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.\n\nConstraints\n\n2 \\leq N \\leq 50\n\n1 \\leq v_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nv_1 v_2 \\ldots v_N\n\nOutput\n\nPrint a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.\n\nYour output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.\n\nSample Input 1\n\n2\n3 4\n\nSample Output 1\n\n3.5\n\nIf you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.\n\nPrinting 3.50001, 3.49999, and so on will also be accepted.\n\nSample Input 2\n\n3\n500 300 200\n\nSample Output 2\n\n375\n\nYou start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:\n\nUse the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400. The next composition will use this ingredient and the ingredient of value 200, resulting in an ingredient of value (400 + 200) / 2 = 300.\n\nUse the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350. The next composition will use this ingredient and the ingredient of value 300, resulting in an ingredient of value (350 + 300) / 2 = 325.\n\nUse the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250. The next composition will use this ingredient and the ingredient of value 500, resulting in an ingredient of value (250 + 500) / 2 = 375.\n\nThus, the maximum possible value of the last ingredient remaining is 375.\n\nPrinting 375.0 and so on will also be accepted.\n\nSample Input 3\n\n5\n138 138 138 138 138\n\nSample Output 3\n\n138", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 463, "cpu_time_ms": 60, "memory_kb": 11596}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s844533504", "group_id": "codeNet:p02939", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n var S = input;\n var arrayS = S.split('');\n var arrayR = [];\n var arrayQ = [];\n\n for(var i=0; i < arrayS.length; i++){\n if(i == 0){\n if(arrayS[i] != arrayS[i+1])\n arrayR.push(`${arrayS[i]}`);\n else if(arrayS[i] == arrayS[i+1]){\n arrayR.push(`${arrayS[i]}${arrayS[i+1]}`);\n i++\n }\n }\n else{\n if(arrayR.slice(-1)[0] != arrayS[i]){\n arrayR.push(`${arrayS[i]}`);\n }\n else if(arrayR.slice(-1)[0] == arrayS[i]){\n if(arrayS[i+1]){\n arrayR.push(`${arrayS[i]}${arrayS[i+1]}`);\n i++\n }\n else{\n arrayR.push(`${arrayS[i]}`);\n }\n }\n if(arrayR.slice(-1)[0] === arrayR.slice(-2)[0]){\n arrayR.pop();\n arrayR[arrayR.length-1] = `${arrayR[arrayR.length-1]}${arrayR[arrayR.length-1]}`;\n }\n }\n }\n\n for(var i=0; i < arrayS.length; i++){\n if(i == 0){\n arrayQ.push(`${arrayS[i]}`);\n }\n else{\n if(arrayQ.slice(-1)[0] != arrayS[i]){\n arrayQ.push(`${arrayS[i]}`);\n }\n else if(arrayQ.slice(-1)[0] == arrayS[i]){\n if(arrayS[i+1]){\n arrayQ.push(`${arrayS[i]}${arrayS[i+1]}`);\n i++\n }\n else{\n arrayQ.push(`${arrayS[i]}`);\n }\n }\n if(arrayQ.slice(-1)[0] === arrayQ.slice(-2)[0]){\n arrayQ.pop();\n arrayQ[arrayQ.length-1] = `${arrayQ[arrayQ.length-1]}${arrayQ[arrayQ.length-1]}`;\n }\n }\n }\n\n console.log(Math.max(arrayQ.length,0));\n // console.log(arrayR);\n // console.log(arrayR.length);\n // console.log(arrayQ)\n // console.log(arrayQ.length);\n }\n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\n Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1566095979, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02939.html", "problem_id": "p02939", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02939/input.txt", "sample_output_relpath": "derived/input_output/data/p02939/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02939/JavaScript/s844533504.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s844533504", "user_id": "u021124817"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n var S = input;\n var arrayS = S.split('');\n var arrayR = [];\n var arrayQ = [];\n\n for(var i=0; i < arrayS.length; i++){\n if(i == 0){\n if(arrayS[i] != arrayS[i+1])\n arrayR.push(`${arrayS[i]}`);\n else if(arrayS[i] == arrayS[i+1]){\n arrayR.push(`${arrayS[i]}${arrayS[i+1]}`);\n i++\n }\n }\n else{\n if(arrayR.slice(-1)[0] != arrayS[i]){\n arrayR.push(`${arrayS[i]}`);\n }\n else if(arrayR.slice(-1)[0] == arrayS[i]){\n if(arrayS[i+1]){\n arrayR.push(`${arrayS[i]}${arrayS[i+1]}`);\n i++\n }\n else{\n arrayR.push(`${arrayS[i]}`);\n }\n }\n if(arrayR.slice(-1)[0] === arrayR.slice(-2)[0]){\n arrayR.pop();\n arrayR[arrayR.length-1] = `${arrayR[arrayR.length-1]}${arrayR[arrayR.length-1]}`;\n }\n }\n }\n\n for(var i=0; i < arrayS.length; i++){\n if(i == 0){\n arrayQ.push(`${arrayS[i]}`);\n }\n else{\n if(arrayQ.slice(-1)[0] != arrayS[i]){\n arrayQ.push(`${arrayS[i]}`);\n }\n else if(arrayQ.slice(-1)[0] == arrayS[i]){\n if(arrayS[i+1]){\n arrayQ.push(`${arrayS[i]}${arrayS[i+1]}`);\n i++\n }\n else{\n arrayQ.push(`${arrayS[i]}`);\n }\n }\n if(arrayQ.slice(-1)[0] === arrayQ.slice(-2)[0]){\n arrayQ.pop();\n arrayQ[arrayQ.length-1] = `${arrayQ[arrayQ.length-1]}${arrayQ[arrayQ.length-1]}`;\n }\n }\n }\n\n console.log(Math.max(arrayQ.length,0));\n // console.log(arrayR);\n // console.log(arrayR.length);\n // console.log(arrayQ)\n // console.log(arrayQ.length);\n }\n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\n Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "sample_input": "aabbaa\n"}, "reference_outputs": ["4\n"], "source_document_id": "p02939", "source_text": "Score : 300 points\n\nProblem Statement\n\nGiven is a string S consisting of lowercase English letters. Find the maximum positive integer K that satisfies the following condition:\n\nThere exists a partition of S into K non-empty strings S=S_1S_2...S_K such that S_i \\neq S_{i+1} (1 \\leq i \\leq K-1).\n\nHere S_1S_2...S_K represents the concatenation of S_1,S_2,...,S_K in this order.\n\nConstraints\n\n1 \\leq |S| \\leq 2 \\times 10^5\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum positive integer K that satisfies the condition.\n\nSample Input 1\n\naabbaa\n\nSample Output 1\n\n4\n\nWe can, for example, divide S into four strings aa, b, ba, and a.\n\nSample Input 2\n\naaaccacabaababc\n\nSample Output 2\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1856, "cpu_time_ms": 412, "memory_kb": 46992}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s986524925", "group_id": "codeNet:p02945", "input_text": "function Main(input) {\n\tvar inputdata = input.split(/\\s/);\n var A = parseInt(inputdata[0]);\n var B = parseInt(inputdata[1]);\n var datas = ( A+B , A-B , A*B );\n console.log( Math.max.apply(null, datas) );\n}", "language": "JavaScript", "metadata": {"date": 1565845764, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/JavaScript/s986524925.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s986524925", "user_id": "u073433854"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "function Main(input) {\n\tvar inputdata = input.split(/\\s/);\n var A = parseInt(inputdata[0]);\n var B = parseInt(inputdata[1]);\n var datas = ( A+B , A-B , A*B );\n console.log( Math.max.apply(null, datas) );\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 47, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s314765298", "group_id": "codeNet:p02945", "input_text": "module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){r(1)(r(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,t){e.exports=function(e){var t=e.split(\" \"),r=Number(t[0]),n=Number(t[1]),o=Math.max(r+n,r-n,r*n)+0;console.log(o)}},function(e,t){e.exports=require(\"fs\")}]);", "language": "JavaScript", "metadata": {"date": 1565485545, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02945.html", "problem_id": "p02945", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02945/input.txt", "sample_output_relpath": "derived/input_output/data/p02945/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02945/JavaScript/s314765298.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s314765298", "user_id": "u501148202"}, "prompt_components": {"gold_output": "-10\n", "input_to_evaluate": "module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){r(1)(r(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,t){e.exports=function(e){var t=e.split(\" \"),r=Number(t[0]),n=Number(t[1]),o=Math.max(r+n,r-n,r*n)+0;console.log(o)}},function(e,t){e.exports=require(\"fs\")}]);", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "sample_input": "-13 3\n"}, "reference_outputs": ["-10\n"], "source_document_id": "p02945", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two integers: A and B.\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nConstraints\n\nAll values in input are integers.\n\n-100 \\leq A,\\ B \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the largest number among A + B, A - B, and A \\times B.\n\nSample Input 1\n\n-13 3\n\nSample Output 1\n\n-10\n\nThe largest number among A + B = -10, A - B = -16, and A \\times B = -39 is -10.\n\nSample Input 2\n\n1 -33\n\nSample Output 2\n\n34\n\nThe largest number among A + B = -32, A - B = 34, and A \\times B = -33 is 34.\n\nSample Input 3\n\n13 3\n\nSample Output 3\n\n39\n\nThe largest number among A + B = 16, A - B = 10, and A \\times B = 39 is 39.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1165, "cpu_time_ms": 271, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s396721574", "group_id": "codeNet:p02946", "input_text": "\"use strict\";\nconst Main = (input) =>{\n let xs = input.trim().split(' ').map(v=>parseInt(v,10));\n let ans = [];\n for(let i = 1; i < xs[0]; i++){\n ans.push(xs[1] - i);\n }\n ans.push(xs[1]); \n for(let i = 1; i < xs[0]; i++){\n ans.push(xs[1] + i);\n }\n const sort = (a,b) =>{\n return a - b;\n }\n ans.sort(sort);\n let ans1 = ans.join(' ');\n console.log(ans1);\n}\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "language": "JavaScript", "metadata": {"date": 1565487792, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02946.html", "problem_id": "p02946", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02946/input.txt", "sample_output_relpath": "derived/input_output/data/p02946/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02946/JavaScript/s396721574.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s396721574", "user_id": "u720390023"}, "prompt_components": {"gold_output": "5 6 7 8 9\n", "input_to_evaluate": "\"use strict\";\nconst Main = (input) =>{\n let xs = input.trim().split(' ').map(v=>parseInt(v,10));\n let ans = [];\n for(let i = 1; i < xs[0]; i++){\n ans.push(xs[1] - i);\n }\n ans.push(xs[1]); \n for(let i = 1; i < xs[0]; i++){\n ans.push(xs[1] + i);\n }\n const sort = (a,b) =>{\n return a - b;\n }\n ans.sort(sort);\n let ans1 = ans.join(' ');\n console.log(ans1);\n}\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "sample_input": "3 7\n"}, "reference_outputs": ["5 6 7 8 9\n"], "source_document_id": "p02946", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \\ldots, 999999, 1000000.\n\nAmong them, some K consecutive stones are painted black, and the others are painted white.\n\nAdditionally, we know that the stone at coordinate X is painted black.\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order.\n\nConstraints\n\n1 \\leq K \\leq 100\n\n0 \\leq X \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nK X\n\nOutput\n\nPrint all coordinates that potentially contain a stone painted black, in ascending order, with spaces in between.\n\nSample Input 1\n\n3 7\n\nSample Output 1\n\n5 6 7 8 9\n\nWe know that there are three stones painted black, and the stone at coordinate 7 is painted black. There are three possible cases:\n\nThe three stones painted black are placed at coordinates 5, 6, and 7.\n\nThe three stones painted black are placed at coordinates 6, 7, and 8.\n\nThe three stones painted black are placed at coordinates 7, 8, and 9.\n\nThus, five coordinates potentially contain a stone painted black: 5, 6, 7, 8, and 9.\n\nSample Input 2\n\n4 0\n\nSample Output 2\n\n-3 -2 -1 0 1 2 3\n\nNegative coordinates can also contain a stone painted black.\n\nSample Input 3\n\n1 100\n\nSample Output 3\n\n100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 440, "cpu_time_ms": 217, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s605415548", "group_id": "codeNet:p02947", "input_text": "function Main(input){\n const sn = input.split('\\n');\n const N = sn.shift();\n let answer = 0;\n let box = new Map();\n for(let i=0; i {\n var count = {} \n for(var i = 0;i Number.isNaN(i) === false ).reduce((i,x) => { return x+i},0)\n}\n\nconst input = require('fs').readFileSync('/dev/stdin','utf8').split(\"\\n\")\nconst N = Number(input[0])\nconst S = input.slice(1).map(x => Array.from(x))\nconsole.log(main(N,S))", "language": "JavaScript", "metadata": {"date": 1573095375, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/JavaScript/s016401474.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s016401474", "user_id": "u951980350"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "const main = (N,S) => {\n var count = {} \n for(var i = 0;i Number.isNaN(i) === false ).reduce((i,x) => { return x+i},0)\n}\n\nconst input = require('fs').readFileSync('/dev/stdin','utf8').split(\"\\n\")\nconst N = Number(input[0])\nconst S = input.slice(1).map(x => Array.from(x))\nconsole.log(main(N,S))", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 514, "cpu_time_ms": 758, "memory_kb": 74620}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s877387684", "group_id": "codeNet:p02947", "input_text": "function Main(input) {\n\tvar idata = input.split(/\\n/);\n\tvar N = parseInt(idata[0]);\n\tvar box = [];\n\tvar box2 =[];\n\tvar same = 0;\n\tvar count = 0;\n\tfor(i = 1; i < N+1; i++){\n\t\tbox[i] = idata[i].split(\"\");\n\t\tbox[i].sort();\n\t\tbox2[i]=box[i].toString();\n\t}\n\tbox2.sort();\n\n\t//合ってるか確認\n\tfor(i=1;i v.split(\"\").sort().join(\"\"));\ns.sort();\nvar sum=0;\nvar cnt=1;\ns.reduce((a,b)=>{\n if(a==b)cnt++;\n else {\n sum+=(cnt*(cnt-1))/2; \n cnt=1;\n }\n return b;\n});\nsum+=(cnt*(cnt-1))/2;\nconsole.log(sum);", "language": "JavaScript", "metadata": {"date": 1565538929, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/JavaScript/s873854351.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s873854351", "user_id": "u375500286"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "var input=`\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n`;\nvar input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.trim().split(\"\\n\").reverse();\nvar n=arr.pop()-0;\nvar s=arr.map(v=> v.split(\"\").sort().join(\"\"));\ns.sort();\nvar sum=0;\nvar cnt=1;\ns.reduce((a,b)=>{\n if(a==b)cnt++;\n else {\n sum+=(cnt*(cnt-1))/2; \n cnt=1;\n }\n return b;\n});\nsum+=(cnt*(cnt-1))/2;\nconsole.log(sum);", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 430, "cpu_time_ms": 478, "memory_kb": 51316}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s523658616", "group_id": "codeNet:p02947", "input_text": "function Main(input) {\n var output = 0;\n var list = [];\n var list2 = [];\n \n for(var i = 1; i <= parseInt(input.split(\"\\n\")[0]); i++){\n list.push(input.split(\"\\n\")[i]);\n }\n \n for(var i = 0; i < list.length; i++){\n var tmp = list[i];\n var tmpList = [];\n for(var j = 0; j < tmp.length; j++){\n tmpList.push(tmp.slice(j, j +1));\n }\n tmpList.sort();\n var tmp2 = \"\";\n for(var j = 0; j < tmpList.length; j++){\n tmp2 += tmpList[j];\n }\n list2.push(tmp2);\n }\n \n var outputList = {};\n var list3 = [];\n for(var i = 0; i < list2.length; i++){\n if(outputList[list2[i]] == null){\n outputList[list2[i]] = 0;\n list3.push(list2[i]);\n }else{\n outputList[list2[i]]++; \n }\n }\n console.log(outputList);\n \n \n for(var i = 0; i < list3.length; i++){\n \n output += pin(outputList[list3[i]]);\n }\n \n console.log(output);\n function pin(val){\n if(val == 0){\n return 0;\n }\n var ret = 0;\n for(var i = 1; i <= val; i++){\n ret += i;\n }\n return ret;\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1565490944, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/JavaScript/s523658616.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s523658616", "user_id": "u222822036"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n var output = 0;\n var list = [];\n var list2 = [];\n \n for(var i = 1; i <= parseInt(input.split(\"\\n\")[0]); i++){\n list.push(input.split(\"\\n\")[i]);\n }\n \n for(var i = 0; i < list.length; i++){\n var tmp = list[i];\n var tmpList = [];\n for(var j = 0; j < tmp.length; j++){\n tmpList.push(tmp.slice(j, j +1));\n }\n tmpList.sort();\n var tmp2 = \"\";\n for(var j = 0; j < tmpList.length; j++){\n tmp2 += tmpList[j];\n }\n list2.push(tmp2);\n }\n \n var outputList = {};\n var list3 = [];\n for(var i = 0; i < list2.length; i++){\n if(outputList[list2[i]] == null){\n outputList[list2[i]] = 0;\n list3.push(list2[i]);\n }else{\n outputList[list2[i]]++; \n }\n }\n console.log(outputList);\n \n \n for(var i = 0; i < list3.length; i++){\n \n output += pin(outputList[list3[i]]);\n }\n \n console.log(output);\n function pin(val){\n if(val == 0){\n return 0;\n }\n var ret = 0;\n for(var i = 1; i <= val; i++){\n ret += i;\n }\n return ret;\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1109, "cpu_time_ms": 2109, "memory_kb": 52376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s682772703", "group_id": "codeNet:p02947", "input_text": "\"use strict\";\n\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nconst inputs = input.split(\"\\n\");\n\nconst main = (inputs) => {\n let N = inputs[0];\n let word;\n let wordArr = [];\n let ans = 0;\n let index;\n\n let countArr = Array(Number(N)).fill(0);\n for (let i = 1; i <= N; i++) {\n word = inputs[i].split(\"\").sort().join(\"\");\n\n index = wordArr.findIndex(item => item === word);\n if (0 <= index) {\n ans++;\n countArr[index]++;\n }\n wordArr.push(word);\n }\n\n // 前のループで出現回数のみカウントしているので、組み合わせ分の回数を足す\n for (let j = 0; j < N; j++) {\n\n if (countArr[j] > 1) {\n let add = (countArr[j] + 1) * countArr[j] / 2;\n ans = ans + add - countArr[j];\n }\n }\n\n return ans;\n};\n\nconsole.log(main(inputs));", "language": "JavaScript", "metadata": {"date": 1565490180, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/JavaScript/s682772703.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s682772703", "user_id": "u772920457"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\"use strict\";\n\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nconst inputs = input.split(\"\\n\");\n\nconst main = (inputs) => {\n let N = inputs[0];\n let word;\n let wordArr = [];\n let ans = 0;\n let index;\n\n let countArr = Array(Number(N)).fill(0);\n for (let i = 1; i <= N; i++) {\n word = inputs[i].split(\"\").sort().join(\"\");\n\n index = wordArr.findIndex(item => item === word);\n if (0 <= index) {\n ans++;\n countArr[index]++;\n }\n wordArr.push(word);\n }\n\n // 前のループで出現回数のみカウントしているので、組み合わせ分の回数を足す\n for (let j = 0; j < N; j++) {\n\n if (countArr[j] > 1) {\n let add = (countArr[j] + 1) * countArr[j] / 2;\n ans = ans + add - countArr[j];\n }\n }\n\n return ans;\n};\n\nconsole.log(main(inputs));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 889, "cpu_time_ms": 2109, "memory_kb": 51500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s237692958", "group_id": "codeNet:p02947", "input_text": "function Main(input) {\n lines = input.split('\\n')\n N = lines.shift() * 1\n ans = 0\n for (i=0; i+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var s = o.r(n,1).map(a=>a.split(\"\").sort().join(\"\")).sort();\n var ans = 0;\n var t = s[0], u = 0;\n for(var i = 1; i < n; i++){\n if(s[i] === t)u++;\n else{\n ans += u*(u+1)/2;\n u = 0;\n t = s[i];\n }\n }\n if(u)ans += u*(u+1)/2;\n return ans;\n}", "language": "JavaScript", "metadata": {"date": 1565485755, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02947.html", "problem_id": "p02947", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02947/input.txt", "sample_output_relpath": "derived/input_output/data/p02947/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02947/JavaScript/s309998811.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s309998811", "user_id": "u643613120"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var s = o.r(n,1).map(a=>a.split(\"\").sort().join(\"\")).sort();\n var ans = 0;\n var t = s[0], u = 0;\n for(var i = 1; i < n; i++){\n if(s[i] === t)u++;\n else{\n ans += u*(u+1)/2;\n u = 0;\n t = s[i];\n }\n }\n if(u)ans += u*(u+1)/2;\n return ans;\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "sample_input": "3\nacornistnt\npeanutbomb\nconstraint\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02947", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will call a string obtained by arranging the characters contained in a string a in some order, an anagram of a.\n\nFor example, greenbin is an anagram of beginner. As seen here, when the same character occurs multiple times, that character must be used that number of times.\n\nGiven are N strings s_1, s_2, \\ldots, s_N. Each of these strings has a length of 10 and consists of lowercase English characters. Additionally, all of these strings are distinct. Find the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nConstraints\n\n2 \\leq N \\leq 10^5\n\ns_i is a string of length 10.\n\nEach character in s_i is a lowercase English letter.\n\ns_1, s_2, \\ldots, s_N are all distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\ns_2\n:\ns_N\n\nOutput\n\nPrint the number of pairs of integers i, j (1 \\leq i < j \\leq N) such that s_i is an anagram of s_j.\n\nSample Input 1\n\n3\nacornistnt\npeanutbomb\nconstraint\n\nSample Output 1\n\n1\n\ns_1 = acornistnt is an anagram of s_3 = constraint. There are no other pairs i, j such that s_i is an anagram of s_j, so the answer is 1.\n\nSample Input 2\n\n2\noneplustwo\nninemodsix\n\nSample Output 2\n\n0\n\nIf there is no pair i, j such that s_i is an anagram of s_j, print 0.\n\nSample Input 3\n\n5\nabaaaaaaaa\noneplustwo\naaaaaaaaba\ntwoplusone\naaaabaaaaa\n\nSample Output 3\n\n4\n\nNote that the answer may not fit into a 32-bit integer type, though we cannot put such a case here.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1145, "cpu_time_ms": 456, "memory_kb": 56488}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s338396041", "group_id": "codeNet:p02948", "input_text": "\n'use strict'\n\nfunction main(input) {\n input = input\n .trim()\n .split('\\n')\n .map(v => v.split(' ').map(v => ~~v))\n const N = ~~input[0][0]\n const M = ~~input[0][1]\n const jobs = input.slice(1).sort((a, b) => {\n return a[0] - b[0] || a[1] - b[1] // Aの昇順、Bの降順\n })\n // let _ = input.slice(1)\n // const jobs = []\n // for (let i = 0; i < N; i++) {\n // if (!jobs[_[i][0]]) jobs[_[i][0]] = []\n // jobs[_[i][0]].push(_[i][1])\n // }\n // console.log(N, M, jobs) // 1000000000 = 1e9\n\n let ans = 0\n\n let day = M - 1\n let marker = N // day が有効な、探索の開始位置\n\n for (let i = day; 0 <= i; i--) {\n // console.log(i)\n let _max = 0\n let _maxind = -1\n for (let j = 0; j < marker; j++) {\n if (M - i >= jobs[j][0]) {\n // console.log(M - i, jobs[j][0], jobs[j][1])\n // enable\n if (_max < jobs[j][1]) {\n _max = jobs[j][1]\n _maxind = j\n }\n } else {\n // // marker = j - 2 > 0 ? j - 2 : 0\n break\n }\n }\n if (_max >= 1) jobs[_maxind][1] = 0 // jobs.splice(_maxind, 1)\n // console.log(_max)\n ans += _max\n }\n // console.log('----')\n console.log(ans)\n // console.log('----')\n\n return\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1565538464, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02948.html", "problem_id": "p02948", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02948/input.txt", "sample_output_relpath": "derived/input_output/data/p02948/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02948/JavaScript/s338396041.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s338396041", "user_id": "u994724450"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "\n'use strict'\n\nfunction main(input) {\n input = input\n .trim()\n .split('\\n')\n .map(v => v.split(' ').map(v => ~~v))\n const N = ~~input[0][0]\n const M = ~~input[0][1]\n const jobs = input.slice(1).sort((a, b) => {\n return a[0] - b[0] || a[1] - b[1] // Aの昇順、Bの降順\n })\n // let _ = input.slice(1)\n // const jobs = []\n // for (let i = 0; i < N; i++) {\n // if (!jobs[_[i][0]]) jobs[_[i][0]] = []\n // jobs[_[i][0]].push(_[i][1])\n // }\n // console.log(N, M, jobs) // 1000000000 = 1e9\n\n let ans = 0\n\n let day = M - 1\n let marker = N // day が有効な、探索の開始位置\n\n for (let i = day; 0 <= i; i--) {\n // console.log(i)\n let _max = 0\n let _maxind = -1\n for (let j = 0; j < marker; j++) {\n if (M - i >= jobs[j][0]) {\n // console.log(M - i, jobs[j][0], jobs[j][1])\n // enable\n if (_max < jobs[j][1]) {\n _max = jobs[j][1]\n _maxind = j\n }\n } else {\n // // marker = j - 2 > 0 ? j - 2 : 0\n break\n }\n }\n if (_max >= 1) jobs[_maxind][1] = 0 // jobs.splice(_maxind, 1)\n // console.log(_max)\n ans += _max\n }\n // console.log('----')\n console.log(ans)\n // console.log('----')\n\n return\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "sample_input": "3 4\n4 3\n4 1\n2 2\n"}, "reference_outputs": ["5\n"], "source_document_id": "p02948", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N one-off jobs available. If you take the i-th job and complete it, you will earn the reward of B_i after A_i days from the day you do it.\n\nYou can take and complete at most one of these jobs in a day.\n\nHowever, you cannot retake a job that you have already done.\n\nFind the maximum total reward that you can earn no later than M days from today.\n\nYou can already start working today.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i \\leq 10^5\n\n1 \\leq B_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the maximum total reward that you can earn no later than M days from today.\n\nSample Input 1\n\n3 4\n4 3\n4 1\n2 2\n\nSample Output 1\n\n5\n\nYou can earn the total reward of 5 by taking the jobs as follows:\n\nTake and complete the first job today. You will earn the reward of 3 after four days from today.\n\nTake and complete the third job tomorrow. You will earn the reward of 2 after two days from tomorrow, that is, after three days from today.\n\nSample Input 2\n\n5 3\n1 2\n1 3\n1 4\n2 1\n2 3\n\nSample Output 2\n\n10\n\nSample Input 3\n\n1 1\n2 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1279, "cpu_time_ms": 2109, "memory_kb": 53052}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s138047999", "group_id": "codeNet:p02951", "input_text": "function Main(input) {\n var A = parseInt(input.split(\" \")[0]);\n var B = parseInt(input.split(\" \")[1]);\n var C = parseInt(input.split(\" \")[2]);\n \n console.log(C - (A - B));\n \n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1564970733, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02951/input.txt", "sample_output_relpath": "derived/input_output/data/p02951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02951/JavaScript/s138047999.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s138047999", "user_id": "u222822036"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n var A = parseInt(input.split(\" \")[0]);\n var B = parseInt(input.split(\" \")[1]);\n var C = parseInt(input.split(\" \")[2]);\n \n console.log(C - (A - B));\n \n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "sample_input": "6 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02951", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 239, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s640823565", "group_id": "codeNet:p02951", "input_text": "\nfunction Main(input) {\n var a = parseInt(input[0], 10);\n var b = parseInt(input[1], 10);\n var c = parseInt(input[2], 10);\n\n var utusu = a - b;\n console.log((c - utusu) < 0 ? 0 : (c - utusu));\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "language": "JavaScript", "metadata": {"date": 1564966925, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02951.html", "problem_id": "p02951", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02951/input.txt", "sample_output_relpath": "derived/input_output/data/p02951/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02951/JavaScript/s640823565.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s640823565", "user_id": "u709108999"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "\nfunction Main(input) {\n var a = parseInt(input[0], 10);\n var b = parseInt(input[1], 10);\n var c = parseInt(input[2], 10);\n\n var utusu = a - b;\n console.log((c - utusu) < 0 ? 0 : (c - utusu));\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "sample_input": "6 4 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p02951", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have two bottles for holding water.\n\nBottle 1 can hold up to A milliliters of water, and now it contains B milliliters of water.\n\nBottle 2 contains C milliliters of water.\n\nWe will transfer water from Bottle 2 to Bottle 1 as much as possible.\n\nHow much amount of water will remain in Bottle 2?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq B \\leq A \\leq 20\n\n1 \\leq C \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the integer representing the amount of water, in milliliters, that will remain in Bottle 2.\n\nSample Input 1\n\n6 4 3\n\nSample Output 1\n\n1\n\nWe will transfer two milliliters of water from Bottle 2 to Bottle 1, and one milliliter of water will remain in Bottle 2.\n\nSample Input 2\n\n8 3 9\n\nSample Output 2\n\n4\n\nSample Input 3\n\n12 3 7\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 288, "cpu_time_ms": 205, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s548796672", "group_id": "codeNet:p02952", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t\n\tinput = input.split(\" \");\n\t\n\t//文字列から10進数に変換するときはparseIntを使います\n\tvar N= parseInt(input[0], 10);\n\t\n\tvar n = 0;\n\tif (N <= 99){var n = 9;\n\t }\n\t else if ( N >= 100 && N<= 999 ){n = N-99+9;}\n\t else if (N >= 1000 && N<=9999){n = 909;}\n\t \n\t else if (N >=10000 && N <=99999){ n = N-9999 + 909;}\n\t else{var n = 90909;}\n\n console.log(n); \n \n }\n \n\t\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1564973017, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02952/input.txt", "sample_output_relpath": "derived/input_output/data/p02952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02952/JavaScript/s548796672.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s548796672", "user_id": "u362031378"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t\n\tinput = input.split(\" \");\n\t\n\t//文字列から10進数に変換するときはparseIntを使います\n\tvar N= parseInt(input[0], 10);\n\t\n\tvar n = 0;\n\tif (N <= 99){var n = 9;\n\t }\n\t else if ( N >= 100 && N<= 999 ){n = N-99+9;}\n\t else if (N >= 1000 && N<=9999){n = 909;}\n\t \n\t else if (N >=10000 && N <=99999){ n = N-9999 + 909;}\n\t else{var n = 90909;}\n\n console.log(n); \n \n }\n \n\t\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 774, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s131250634", "group_id": "codeNet:p02952", "input_text": "'use strict'\n\nfunction main(input) {\n const Num = input.trim()\n const L = Num.length\n const n = ~~Num\n let _mod = 0\n if (L % 2) {\n _mod = (n % Math.pow(10, L - 1)) + 1\n }\n const ll = Math.floor(L / 2)\n let _tmp = ''\n for (let i = 1; i <= ll * 2; i++) {\n _tmp += i % 2 ? '9' : '0'\n }\n\n _tmp = parseInt(\n _tmp\n .split('')\n .reverse()\n .join(''),\n 10\n )\n console.log(_tmp + _mod)\n}\nmain(require('fs').readFilexSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1564968826, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02952/input.txt", "sample_output_relpath": "derived/input_output/data/p02952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02952/JavaScript/s131250634.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s131250634", "user_id": "u032263881"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "'use strict'\n\nfunction main(input) {\n const Num = input.trim()\n const L = Num.length\n const n = ~~Num\n let _mod = 0\n if (L % 2) {\n _mod = (n % Math.pow(10, L - 1)) + 1\n }\n const ll = Math.floor(L / 2)\n let _tmp = ''\n for (let i = 1; i <= ll * 2; i++) {\n _tmp += i % 2 ? '9' : '0'\n }\n\n _tmp = parseInt(\n _tmp\n .split('')\n .reverse()\n .join(''),\n 10\n )\n console.log(_tmp + _mod)\n}\nmain(require('fs').readFilexSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 475, "cpu_time_ms": 50, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s215925082", "group_id": "codeNet:p02952", "input_text": "const N = parseInt(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"), 10);\n\nlet total = 0;\nfor (let i = 0; i <= N; i++) {\n if ((Math.floor(Math.log10(i)) + 1) % 2 == 1) {\n total++;\n }\n}\nconsole.log(total);", "language": "JavaScript", "metadata": {"date": 1564968199, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02952.html", "problem_id": "p02952", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02952/input.txt", "sample_output_relpath": "derived/input_output/data/p02952/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02952/JavaScript/s215925082.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s215925082", "user_id": "u078588801"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "const N = parseInt(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"), 10);\n\nlet total = 0;\nfor (let i = 0; i <= N; i++) {\n if ((Math.floor(Math.log10(i)) + 1) % 2 == 1) {\n total++;\n }\n}\nconsole.log(total);", "problem_context": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "sample_input": "11\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02952", "source_text": "Score : 200 points\n\nProblem Statement\n\nGiven is an integer N. Find the number of positive integers less than or equal to N that have an odd number of digits (in base ten without leading zeros).\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of positive integers less than or equal to N that have an odd number of digits.\n\nSample Input 1\n\n11\n\nSample Output 1\n\n9\n\nAmong the positive integers less than or equal to 11, nine integers have an odd number of digits: 1, 2, \\ldots, 9.\n\nSample Input 2\n\n136\n\nSample Output 2\n\n46\n\nIn addition to 1, 2, \\ldots, 9, another 37 integers also have an odd number of digits: 100, 101, \\ldots, 136.\n\nSample Input 3\n\n100000\n\nSample Output 3\n\n90909", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 209, "cpu_time_ms": 49, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s774589695", "group_id": "codeNet:p02954", "input_text": "\"use strict\";\n\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nconst directions = input.split(\"\");\n\nconst main = directions => {\n let result = Array(directions.length).fill(0);\n\n let pre = \"\";\n let cur = \"\";\n let nex = \"\";\n let d = \"\";\n let len = directions.length;\n for (let i = 0; i < len; i++) {\n // 1つづつ、配列から取り出す\n d = directions[i];\n\n if (d === \"R\") {\n // Rなら右に走査する\n for (let j = i; j < len; j++) {\n cur = directions[j];\n nex = directions[j + 1];\n if (\"RL\" === cur + nex) {\n // RL の場所をみつけたらループ終了\n // 開始地点の偶奇をもとに結果の箇所に加算\n\n if ((j - i) % 2 === 0) {\n result[j]++;\n } else {\n result[j + 1]++;\n }\n break;\n }\n }\n } else if (d === \"L\") {\n // Lなら左に走査する\n for (let k = i; k >= 0; k--) {\n pre = directions[k - 1];\n cur = directions[k];\n if (\"RL\" === pre + cur) {\n // RL の場所をみつけたらループ終了\n // 開始地点の偶奇をもとに結果の箇所に加算\n if ((i - k) % 2 === 0) {\n result[k]++;\n } else {\n result[k - 1]++;\n }\n break;\n }\n }\n }\n }\n\n return result.join(\" \");\n};\n\nconsole.log(main(directions));", "language": "JavaScript", "metadata": {"date": 1565031377, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02954.html", "problem_id": "p02954", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02954/input.txt", "sample_output_relpath": "derived/input_output/data/p02954/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02954/JavaScript/s774589695.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s774589695", "user_id": "u772920457"}, "prompt_components": {"gold_output": "0 1 2 1 1\n", "input_to_evaluate": "\"use strict\";\n\nconst input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nconst directions = input.split(\"\");\n\nconst main = directions => {\n let result = Array(directions.length).fill(0);\n\n let pre = \"\";\n let cur = \"\";\n let nex = \"\";\n let d = \"\";\n let len = directions.length;\n for (let i = 0; i < len; i++) {\n // 1つづつ、配列から取り出す\n d = directions[i];\n\n if (d === \"R\") {\n // Rなら右に走査する\n for (let j = i; j < len; j++) {\n cur = directions[j];\n nex = directions[j + 1];\n if (\"RL\" === cur + nex) {\n // RL の場所をみつけたらループ終了\n // 開始地点の偶奇をもとに結果の箇所に加算\n\n if ((j - i) % 2 === 0) {\n result[j]++;\n } else {\n result[j + 1]++;\n }\n break;\n }\n }\n } else if (d === \"L\") {\n // Lなら左に走査する\n for (let k = i; k >= 0; k--) {\n pre = directions[k - 1];\n cur = directions[k];\n if (\"RL\" === pre + cur) {\n // RL の場所をみつけたらループ終了\n // 開始地点の偶奇をもとに結果の箇所に加算\n if ((i - k) % 2 === 0) {\n result[k]++;\n } else {\n result[k - 1]++;\n }\n break;\n }\n }\n }\n }\n\n return result.join(\" \");\n};\n\nconsole.log(main(directions));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "sample_input": "RRLRL\n"}, "reference_outputs": ["0 1 2 1 1\n"], "source_document_id": "p02954", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is a string S consisting of L and R.\n\nLet N be the length of S. There are N squares arranged from left to right, and the i-th character of S from the left is written on the i-th square from the left.\n\nThe character written on the leftmost square is always R, and the character written on the rightmost square is always L.\n\nInitially, one child is standing on each square.\n\nEach child will perform the move below 10^{100} times:\n\nMove one square in the direction specified by the character written in the square on which the child is standing. L denotes left, and R denotes right.\n\nFind the number of children standing on each square after the children performed the moves.\n\nConstraints\n\nS is a string of length between 2 and 10^5 (inclusive).\n\nEach character of S is L or R.\n\nThe first and last characters of S are R and L, respectively.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the number of children standing on each square after the children performed the moves, in order from left to right.\n\nSample Input 1\n\nRRLRL\n\nSample Output 1\n\n0 1 2 1 1\n\nAfter each child performed one move, the number of children standing on each square is 0, 2, 1, 1, 1 from left to right.\n\nAfter each child performed two moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nAfter each child performed 10^{100} moves, the number of children standing on each square is 0, 1, 2, 1, 1 from left to right.\n\nSample Input 2\n\nRRLLLLRLRRLL\n\nSample Output 2\n\n0 3 3 0 0 0 1 1 0 2 2 0\n\nSample Input 3\n\nRRRLLRLLRRRLLLLL\n\nSample Output 3\n\n0 0 3 2 0 2 1 0 0 0 4 4 0 0 0 0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1420, "cpu_time_ms": 2108, "memory_kb": 17740}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s633479795", "group_id": "codeNet:p02957", "input_text": "var nums = require('fs').readFileSync('/dev/stdin','utf8').split(' '),\n a = parseInt(nums[0]),\n b = parseInt(nums[1]);\n\nif ((a+b) % 2 !== 0)\n console.log('IMPOSSIBLE');\nelse\n console.log((a+b)/2);", "language": "JavaScript", "metadata": {"date": 1565033021, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02957.html", "problem_id": "p02957", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02957/input.txt", "sample_output_relpath": "derived/input_output/data/p02957/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02957/JavaScript/s633479795.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s633479795", "user_id": "u608021893"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "var nums = require('fs').readFileSync('/dev/stdin','utf8').split(' '),\n a = parseInt(nums[0]),\n b = parseInt(nums[1]);\n\nif ((a+b) % 2 !== 0)\n console.log('IMPOSSIBLE');\nelse\n console.log((a+b)/2);", "problem_context": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "sample_input": "2 16\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02957", "source_text": "Score: 100 points\n\nProblem Statement\n\nWe have two distinct integers A and B.\n\nPrint the integer K such that |A - K| = |B - K|.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A,\\ B \\leq 10^9\n\nA and B are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the integer K satisfying the condition.\n\nIf such an integer does not exist, print IMPOSSIBLE instead.\n\nSample Input 1\n\n2 16\n\nSample Output 1\n\n9\n\n|2 - 9| = 7 and |16 - 9| = 7, so 9 satisfies the condition.\n\nSample Input 2\n\n0 3\n\nSample Output 2\n\nIMPOSSIBLE\n\nNo integer satisfies the condition.\n\nSample Input 3\n\n998244353 99824435\n\nSample Output 3\n\n549034394", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 204, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s786613144", "group_id": "codeNet:p02958", "input_text": "\"use strict\"\n\nfunction isSortable(args, sorted_args){\n let not_match_cnt = 0\n sorted_args.map((item, key)=>{\n if(sorted_args[key] != args[key]){\n not_match_cnt++\n }\n })\n if(not_match_cnt == 0 || not_match_cnt == 2){\n return true\n }else{\n return false\n }\n}\n\nconst YES = 'YES'\nconst NO = 'NO'\n\nconst arg_str = require('fs').readFileSync('/dev/stdin', 'UTF-8')\nconst args_lines = arg_str.split('\\n')\nconst n = args_lines[0]\nconst target = args_lines[1].split(' ')\n\nif(target.length != n){\n console.log(NO)\n return\n}\n\nif(Math.min(...target) != 1 || Math.max(...target) != n){\n console.log(NO)\n return\n}\n\nif(n < 2 || 50 < n){\n console.log(NO)\n return\n}\n\nconst args_asc = target.slice().sort((a,b)=>a-b)\nconst args_desc = target.slice().sort((a,b)=>b-a)\n\nconst is_sortable_asc = isSortable(target, args_asc)\nconst is_sortable_desc = isSortable(target, args_desc)\n\nif(is_sortable_asc || is_sortable_desc){\n console.log(YES)\n}else{\n console.log(NO)\n}\n", "language": "JavaScript", "metadata": {"date": 1565497385, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02958.html", "problem_id": "p02958", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02958/input.txt", "sample_output_relpath": "derived/input_output/data/p02958/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02958/JavaScript/s786613144.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s786613144", "user_id": "u880432382"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "\"use strict\"\n\nfunction isSortable(args, sorted_args){\n let not_match_cnt = 0\n sorted_args.map((item, key)=>{\n if(sorted_args[key] != args[key]){\n not_match_cnt++\n }\n })\n if(not_match_cnt == 0 || not_match_cnt == 2){\n return true\n }else{\n return false\n }\n}\n\nconst YES = 'YES'\nconst NO = 'NO'\n\nconst arg_str = require('fs').readFileSync('/dev/stdin', 'UTF-8')\nconst args_lines = arg_str.split('\\n')\nconst n = args_lines[0]\nconst target = args_lines[1].split(' ')\n\nif(target.length != n){\n console.log(NO)\n return\n}\n\nif(Math.min(...target) != 1 || Math.max(...target) != n){\n console.log(NO)\n return\n}\n\nif(n < 2 || 50 < n){\n console.log(NO)\n return\n}\n\nconst args_asc = target.slice().sort((a,b)=>a-b)\nconst args_desc = target.slice().sort((a,b)=>b-a)\n\nconst is_sortable_asc = isSortable(target, args_asc)\nconst is_sortable_desc = isSortable(target, args_desc)\n\nif(is_sortable_asc || is_sortable_desc){\n console.log(YES)\n}else{\n console.log(NO)\n}\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "sample_input": "5\n5 2 3 4 1\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p02958", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have a sequence p = {p_1,\\ p_2,\\ ...,\\ p_N} which is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nYou can perform the following operation at most once: choose integers i and j (1 \\leq i < j \\leq N), and swap p_i and p_j. Note that you can also choose not to perform it.\n\nPrint YES if you can sort p in ascending order in this way, and NO otherwise.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 50\n\np is a permutation of {1,\\ 2,\\ ...,\\ N}.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1 p_2 ... p_N\n\nOutput\n\nPrint YES if you can sort p in ascending order in the way stated in the problem statement, and NO otherwise.\n\nSample Input 1\n\n5\n5 2 3 4 1\n\nSample Output 1\n\nYES\n\nYou can sort p in ascending order by swapping p_1 and p_5.\n\nSample Input 2\n\n5\n2 4 3 5 1\n\nSample Output 2\n\nNO\n\nIn this case, swapping any two elements does not sort p in ascending order.\n\nSample Input 3\n\n7\n1 2 3 4 5 6 7\n\nSample Output 3\n\nYES\n\np is already sorted in ascending order, so no operation is needed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 975, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s717309399", "group_id": "codeNet:p02958", "input_text": "function Main(input) {\n\tinput = input.split(\"\\n\");\n var N = input[0];\n\tvar vals = input[1].split(\" \");\n\tvar org = input[1].split(\" \");\n \n \tvar count = 0;\n \tvals.sort();\n \tfor(var i=0; i {\n count = 0\n for(var i = 0;i Number(x))\nconst B = input[2].split(\" \").map(x => Number(x))\nconsole.log(main(N,A,B))", "language": "JavaScript", "metadata": {"date": 1573283696, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/JavaScript/s652469311.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s652469311", "user_id": "u951980350"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "const main = (N,A,B) => {\n count = 0\n for(var i = 0;i Number(x))\nconst B = input[2].split(\" \").map(x => Number(x))\nconsole.log(main(N,A,B))", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 502, "cpu_time_ms": 227, "memory_kb": 30776}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s732650708", "group_id": "codeNet:p02959", "input_text": "function Main(input) {\n input = input.split('\\n')\n var N = parseInt(input[0])\n var A = input[1].split(' ').map(str => parseInt(str))\n var B = input[2].split(' ').map(str => parseInt(str))\n var allMonster = A.reduce((prev, current) => prev + current)\n\n for (var i = 0; i < N; i++) {\n if (A[i] <= B[i]) {\n B[i] -= A[i]\n A[i] = 0\n if (A[i + 1] <= B[i]) {\n A[i + 1] = 0\n } else {\n A[i + 1] -= B[i]\n }\n } else {\n A[i] -= B[i]\n }\n }\n\n var remainMonster = A.reduce((prev, current) => prev + current)\n console.log(allMonster - remainMonster)\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1564281007, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/JavaScript/s732650708.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s732650708", "user_id": "u859175044"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "function Main(input) {\n input = input.split('\\n')\n var N = parseInt(input[0])\n var A = input[1].split(' ').map(str => parseInt(str))\n var B = input[2].split(' ').map(str => parseInt(str))\n var allMonster = A.reduce((prev, current) => prev + current)\n\n for (var i = 0; i < N; i++) {\n if (A[i] <= B[i]) {\n B[i] -= A[i]\n A[i] = 0\n if (A[i + 1] <= B[i]) {\n A[i + 1] = 0\n } else {\n A[i + 1] -= B[i]\n }\n } else {\n A[i] -= B[i]\n }\n }\n\n var remainMonster = A.reduce((prev, current) => prev + current)\n console.log(allMonster - remainMonster)\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 654, "cpu_time_ms": 140, "memory_kb": 31840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s366721561", "group_id": "codeNet:p02959", "input_text": "function main(input){\n input = input.split(\"\\n\");\n const n = parseInt(input[0]);\n var a = input[1].split(\" \").map(x => parseInt(x))\n var b = input[2].split(\" \").map(x => parseInt(x))\n var cnt = 0;\n// console.log(n);\n\n\n \n for (var i = 0; i < n; i++) {\n // a[i]とb[i]の比較\n if (a[i] > b[i]) {\n cnt += b[i];\n a[i] -= b[i];\n b[i] = 0; \n }else {\n cnt += a[i];\n b[i] -= a[i];\n a[i] = 0;\n }\n\n // a[i+1]とb[i]の比較\n if (a[i+1] > b[i]) {\n cnt += b[i];\n a[i+1] -= b[i];\n b[i] = 0; \n }else {\n cnt += a[i+1];\n b[i] -= a[i+1];\n a[i+1] = 0;\n }\n \n }\n \n// console.log(a);\n// console.log(b);\n\n console.log(cnt);\n\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1564278108, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02959.html", "problem_id": "p02959", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02959/input.txt", "sample_output_relpath": "derived/input_output/data/p02959/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02959/JavaScript/s366721561.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s366721561", "user_id": "u582460965"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "function main(input){\n input = input.split(\"\\n\");\n const n = parseInt(input[0]);\n var a = input[1].split(\" \").map(x => parseInt(x))\n var b = input[2].split(\" \").map(x => parseInt(x))\n var cnt = 0;\n// console.log(n);\n\n\n \n for (var i = 0; i < n; i++) {\n // a[i]とb[i]の比較\n if (a[i] > b[i]) {\n cnt += b[i];\n a[i] -= b[i];\n b[i] = 0; \n }else {\n cnt += a[i];\n b[i] -= a[i];\n a[i] = 0;\n }\n\n // a[i+1]とb[i]の比較\n if (a[i+1] > b[i]) {\n cnt += b[i];\n a[i+1] -= b[i];\n b[i] = 0; \n }else {\n cnt += a[i+1];\n b[i] -= a[i+1];\n a[i+1] = 0;\n }\n \n }\n \n// console.log(a);\n// console.log(b);\n\n console.log(cnt);\n\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "sample_input": "2\n3 5 2\n4 5\n"}, "reference_outputs": ["9\n"], "source_document_id": "p02959", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N+1 towns. The i-th town is being attacked by A_i monsters.\n\nWe have N heroes. The i-th hero can defeat monsters attacking the i-th or (i+1)-th town, for a total of at most B_i monsters.\n\nWhat is the maximum total number of monsters the heroes can cooperate to defeat?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N+1}\nB_1 B_2 ... B_N\n\nOutput\n\nPrint the maximum total number of monsters the heroes can defeat.\n\nSample Input 1\n\n2\n3 5 2\n4 5\n\nSample Output 1\n\n9\n\nIf the heroes choose the monsters to defeat as follows, they can defeat nine monsters in total, which is the maximum result.\n\nThe first hero defeats two monsters attacking the first town and two monsters attacking the second town.\n\nThe second hero defeats three monsters attacking the second town and two monsters attacking the third town.\n\nSample Input 2\n\n3\n5 6 3 8\n5 100 8\n\nSample Output 2\n\n22\n\nSample Input 3\n\n2\n100 1 1\n1 100\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 775, "cpu_time_ms": 119, "memory_kb": 30764}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s734154432", "group_id": "codeNet:p02963", "input_text": "// 入力とかに使うもの\nvar reader = require('readline').createInterface({ input: process.stdin, output: process.stdout });\nvar lines = [];\nreader.on('line', function (line) { lines.push(line); });\n\n// メイン\nreader.on('close', function () {\n\tvar s = Number(lines[0]);\n\tvar x = 1;\n\twhile(s/x >= 1000000000) x++;\n\tconsole.log(\"0 0 \"+x+\" 0 0 \"+(s/x));\n});", "language": "JavaScript", "metadata": {"date": 1563844155, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02963/input.txt", "sample_output_relpath": "derived/input_output/data/p02963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02963/JavaScript/s734154432.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s734154432", "user_id": "u469650155"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "// 入力とかに使うもの\nvar reader = require('readline').createInterface({ input: process.stdin, output: process.stdout });\nvar lines = [];\nreader.on('line', function (line) { lines.push(line); });\n\n// メイン\nreader.on('close', function () {\n\tvar s = Number(lines[0]);\n\tvar x = 1;\n\twhile(s/x >= 1000000000) x++;\n\tconsole.log(\"0 0 \"+x+\" 0 0 \"+(s/x));\n});", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "sample_input": "3\n"}, "reference_outputs": ["1 0 2 2 0 1\n"], "source_document_id": "p02963", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 363, "cpu_time_ms": 2108, "memory_kb": 11596}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s022210444", "group_id": "codeNet:p02963", "input_text": "// 入力とかに使うもの\nvar reader = require('readline').createInterface({ input: process.stdin, output: process.stdout });\nvar lines = [];\nreader.on('line', function (line) { lines.push(line); });\n\n// メイン\nreader.on('close', function () {\n\tvar s = Number(lines[0].split(\" \")[0]);\n\tvar x = 1;\n\tconseole.log(\"0 0 1 0 0 \"+s);\n});", "language": "JavaScript", "metadata": {"date": 1563843868, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02963.html", "problem_id": "p02963", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02963/input.txt", "sample_output_relpath": "derived/input_output/data/p02963/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02963/JavaScript/s022210444.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s022210444", "user_id": "u469650155"}, "prompt_components": {"gold_output": "1 0 2 2 0 1\n", "input_to_evaluate": "// 入力とかに使うもの\nvar reader = require('readline').createInterface({ input: process.stdin, output: process.stdout });\nvar lines = [];\nreader.on('line', function (line) { lines.push(line); });\n\n// メイン\nreader.on('close', function () {\n\tvar s = Number(lines[0].split(\" \")[0]);\n\tvar x = 1;\n\tconseole.log(\"0 0 1 0 0 \"+s);\n});", "problem_context": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "sample_input": "3\n"}, "reference_outputs": ["1 0 2 2 0 1\n"], "source_document_id": "p02963", "source_text": "Score : 400 points\n\nProblem Statement\n\nGiven is an integer S.\nFind a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions:\n\n0 \\leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \\leq 10^9\n\nThe area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) is S/2.\n\nWe can prove that there always exist six integers that satisfy the conditions under the constraints of this problem.\n\nConstraints\n\n1 \\leq S \\leq 10^{18}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfy the conditions, in this order, with spaces in between.\nIf multiple solutions exist, any of them will be accepted.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n1 0 2 2 0 1\n\nThe area of the triangle in a two-dimensional plane whose vertices are (1,0),(2,2), and (0,1) is 3/2.\nPrinting 3 0 3 1 0 1 or 1 0 0 1 2 2 will also be accepted.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n0 0 10 0 0 10\n\nSample Input 3\n\n311114770564041497\n\nSample Output 3\n\n314159265 358979323 846264338 327950288 419716939 937510582", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 339, "cpu_time_ms": 60, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s650709360", "group_id": "codeNet:p02969", "input_text": "//↓見なくていいよ!ここから--------------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nvar obj;\nvar inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error(\"\\n\");\n var start = new Date();\n Main();\n var end = new Date() - start;\n \n myerr(\"time : \" + (end) + \"ms\");\n myerr(\"memory : \" + Math.round(process.memoryUsage().heapTotal / 1024) + \"KB\");\n});\nfunction makeClone(obj){return JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n var returnObj = {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(!this.hasNext()){throw \"ArrayIndexOutOfBoundsException これ以上ないよ\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error(\"debug:\" + require(\"util\").inspect(s,false,null));}\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map(Number);case 6:return i.split(\"\");case 7:return i.split(\"\").map(Number);case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\n\n//↑見なくていいよ!ここまで--------------------------------------------------\nfunction Main(){\n\tvar r = nextInt();\n\tmyout(r*r*3);\n}\n", "language": "JavaScript", "metadata": {"date": 1595171041, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/JavaScript/s650709360.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s650709360", "user_id": "u222822036"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "//↓見なくていいよ!ここから--------------------------------------------------\nvar read = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nvar obj;\nvar inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n obj = init(inLine);\n console.error(\"\\n\");\n var start = new Date();\n Main();\n var end = new Date() - start;\n \n myerr(\"time : \" + (end) + \"ms\");\n myerr(\"memory : \" + Math.round(process.memoryUsage().heapTotal / 1024) + \"KB\");\n});\nfunction makeClone(obj){return JSON.parse(JSON.stringify(obj));}\nfunction nextInt(){return myconv(next(),1);} function nextStrArray(){return myconv(next(),2);}\nfunction nextIntArray(){return myconv(next(),4);} function nextCharArray(){return myconv(next(),6);}\nfunction next(){return obj.next();} function hasNext(){return obj.hasNext();}\nfunction init(input){ \n var returnObj = {\n list : input, index : 0, max : input.length,\n hasNext : function(){return (this.index < this.max);},\n next : function(){if(!this.hasNext()){throw \"ArrayIndexOutOfBoundsException これ以上ないよ\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(s){console.log(s);}\nfunction myerr(s){console.error(\"debug:\" + require(\"util\").inspect(s,false,null));}\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map(Number);case 6:return i.split(\"\");case 7:return i.split(\"\").map(Number);case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\n\n//↑見なくていいよ!ここまで--------------------------------------------------\nfunction Main(){\n\tvar r = nextInt();\n\tmyout(r*r*3);\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2110, "cpu_time_ms": 195, "memory_kb": 29992}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s685118409", "group_id": "codeNet:p02969", "input_text": "function main(input){\n input = input.split(\"\\n\");\n var r = parseInt(input[0]);\n \n console.log(3 * r * r);\n}\n \n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1563671178, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02969.html", "problem_id": "p02969", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02969/input.txt", "sample_output_relpath": "derived/input_output/data/p02969/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02969/JavaScript/s685118409.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s685118409", "user_id": "u582460965"}, "prompt_components": {"gold_output": "48\n", "input_to_evaluate": "function main(input){\n input = input.split(\"\\n\");\n var r = parseInt(input[0]);\n \n console.log(3 * r * r);\n}\n \n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "sample_input": "4\n"}, "reference_outputs": ["48\n"], "source_document_id": "p02969", "source_text": "Score : 100 points\n\nProblem Statement\n\nIt is known that the area of a regular dodecagon inscribed in a circle of radius a is 3a^2.\n\nGiven an integer r, find the area of a regular dodecagon inscribed in a circle of radius r.\n\nConstraints\n\n1 \\leq r \\leq 100\n\nr is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr\n\nOutput\n\nPrint an integer representing the area of the regular dodecagon.\n\nSample Input 1\n\n4\n\nSample Output 1\n\n48\n\nThe area of the regular dodecagon is 3 \\times 4^2 = 48.\n\nSample Input 2\n\n15\n\nSample Output 2\n\n675\n\nSample Input 3\n\n80\n\nSample Output 3\n\n19200", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 170, "cpu_time_ms": 286, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s495330329", "group_id": "codeNet:p02971", "input_text": "function Main(input) {\n var dataList = input.split(\"\\n\");\n dataList.shift();\n dataList.pop();\n for (var i = 0; i < dataList.length; i++) {\n dataList[i] = Number(dataList[i]);\n }\n for (var i = 0; i < dataList.length; i++) {\n console.log(gatMax(dataList[i]));\n }\n function gatMax(exclude) {\n var max = 0;\n for (var i = 0; i < dataList.length; i++) {\n if (i === 0) max = dataList[i];\n if (dataList[i] == exclude) continue;\n if (dataList[i] > max) max = dataList[i];\n } \n return max;\n } \n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1564767391, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/JavaScript/s495330329.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s495330329", "user_id": "u499881094"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "function Main(input) {\n var dataList = input.split(\"\\n\");\n dataList.shift();\n dataList.pop();\n for (var i = 0; i < dataList.length; i++) {\n dataList[i] = Number(dataList[i]);\n }\n for (var i = 0; i < dataList.length; i++) {\n console.log(gatMax(dataList[i]));\n }\n function gatMax(exclude) {\n var max = 0;\n for (var i = 0; i < dataList.length; i++) {\n if (i === 0) max = dataList[i];\n if (dataList[i] == exclude) continue;\n if (dataList[i] > max) max = dataList[i];\n } \n return max;\n } \n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 714, "cpu_time_ms": 2109, "memory_kb": 32424}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s353685371", "group_id": "codeNet:p02971", "input_text": "function Main(input) {\n\tvar inputArr = input.split(\"\\n\");\n\n inputArr.map( str => parseInt(str, 10) );\n var n = inputArr[0];\n  inputArr.shift();\n var max = 0;\n var next = 0;\n  for(var v of inputArr) {\n if (max < v) {\n next = max;\n max = v;\n } else if (next < v) {\n next = v;\n }\n }\n  for(var v of inputArr) {\n console.log(max === v ? next : max);\n }\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1564096828, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/JavaScript/s353685371.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s353685371", "user_id": "u888733083"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "function Main(input) {\n\tvar inputArr = input.split(\"\\n\");\n\n inputArr.map( str => parseInt(str, 10) );\n var n = inputArr[0];\n  inputArr.shift();\n var max = 0;\n var next = 0;\n  for(var v of inputArr) {\n if (max < v) {\n next = max;\n max = v;\n } else if (next < v) {\n next = v;\n }\n }\n  for(var v of inputArr) {\n console.log(max === v ? next : max);\n }\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 478, "cpu_time_ms": 1570, "memory_kb": 37944}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s996059548", "group_id": "codeNet:p02971", "input_text": "function Main(input){\n\tvar tmp = input.split('\\n');\n var N = Number(tmp.shift());\n tmp.pop();\n var D = tmp.map(a=>Number(a));\n var arr = [];\n for(var i=0;ib!=i);\n arr.push(tmp.reduce((a,b)=>a>b?a:b));\n }\n for(var i=0;iNumber(a));\n var arr = [];\n for(var i=0;ib!=i);\n arr.push(tmp.reduce((a,b)=>a>b?a:b));\n }\n for(var i=0;i parseInt(x))\n\tvar max = 0\n\tvar second = 0\n\tAs.forEach((e,i) => {\n\t\tif(As[max] < e){\n\t\t\tsecond = max\n\t\t\tmax = i\n\t\t}else if(As[second] < e){\n\t\t\tsecond = i\n\t\t}\n\t})\n\tfor(i=0; i < N; i++){\n\t\tif(i == max){\n\t\t\tconsole.log(As[second])\n\t\t}else{\n\t\t\tconsole.log(As[max])\n\t\t}\n\t}\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1563672705, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02971.html", "problem_id": "p02971", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02971/input.txt", "sample_output_relpath": "derived/input_output/data/p02971/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02971/JavaScript/s287934982.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s287934982", "user_id": "u637646387"}, "prompt_components": {"gold_output": "4\n3\n4\n", "input_to_evaluate": "function Main(input) {\n\tinput = input.split(\"\\n\");\n\tconst N = parseInt(input[0])\n\tconst As = input.slice(1).map(x => parseInt(x))\n\tvar max = 0\n\tvar second = 0\n\tAs.forEach((e,i) => {\n\t\tif(As[max] < e){\n\t\t\tsecond = max\n\t\t\tmax = i\n\t\t}else if(As[second] < e){\n\t\t\tsecond = i\n\t\t}\n\t})\n\tfor(i=0; i < N; i++){\n\t\tif(i == max){\n\t\t\tconsole.log(As[second])\n\t\t}else{\n\t\t\tconsole.log(As[max])\n\t\t}\n\t}\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "sample_input": "3\n1\n4\n3\n"}, "reference_outputs": ["4\n3\n4\n"], "source_document_id": "p02971", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given a sequence of length N: A_1, A_2, ..., A_N.\nFor each integer i between 1 and N (inclusive), answer the following question:\n\nFind the maximum value among the N-1 elements other than A_i in the sequence.\n\nConstraints\n\n2 \\leq N \\leq 200000\n\n1 \\leq A_i \\leq 200000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1\n:\nA_N\n\nOutput\n\nPrint N lines. The i-th line (1 \\leq i \\leq N) should contain the maximum value among the N-1 elements other than A_i in the sequence.\n\nSample Input 1\n\n3\n1\n4\n3\n\nSample Output 1\n\n4\n3\n4\n\nThe maximum value among the two elements other than A_1, that is, A_2 = 4 and A_3 = 3, is 4.\n\nThe maximum value among the two elements other than A_2, that is, A_1 = 1 and A_3 = 3, is 3.\n\nThe maximum value among the two elements other than A_3, that is, A_1 = 1 and A_2 = 4, is 4.\n\nSample Input 2\n\n2\n5\n5\n\nSample Output 2\n\n5\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 441, "cpu_time_ms": 1808, "memory_kb": 40388}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s862880377", "group_id": "codeNet:p02972", "input_text": "console.log((args=>{\n const [[N],a] = args.trim().split('\\n').map(r=>r.split(' ').map(v=>v|0));\n const b = [], c = Array(N).fill(0);\n for ( let i = N-1; i >= 0; i-- ) {\n let s = 0;\n for ( let j = i; j < N; j+=i+1 ) s ^= c[j];\n c[i] = s ^ a[i];\n if ( c[i] ) b.push(i+1);\n }\n return b.length + '\\n' + b.join` `;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1594258302, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/JavaScript/s862880377.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s862880377", "user_id": "u088845406"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "console.log((args=>{\n const [[N],a] = args.trim().split('\\n').map(r=>r.split(' ').map(v=>v|0));\n const b = [], c = Array(N).fill(0);\n for ( let i = N-1; i >= 0; i-- ) {\n let s = 0;\n for ( let j = i; j < N; j+=i+1 ) s ^= c[j];\n c[i] = s ^ a[i];\n if ( c[i] ) b.push(i+1);\n }\n return b.length + '\\n' + b.join` `;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 381, "cpu_time_ms": 187, "memory_kb": 46780}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s202008011", "group_id": "codeNet:p02972", "input_text": "console.log((args=>{\n const [[N],a] = args.trim().split('\\n').map(r=>r.split(' ').map(v=>v|0));\n const b = [];\n for ( let i = 0; i < N; i++ ) {\n let s = 0;\n for ( let j = i; j < N; j+=i+1 ) s ^= a[j];\n if ( s !== a[i] ) return '-1';\n else if ( s ) b.push(i+1);\n }\n return b.length + '\\n' + b.join` `;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));", "language": "JavaScript", "metadata": {"date": 1594257411, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/JavaScript/s202008011.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s202008011", "user_id": "u088845406"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "console.log((args=>{\n const [[N],a] = args.trim().split('\\n').map(r=>r.split(' ').map(v=>v|0));\n const b = [];\n for ( let i = 0; i < N; i++ ) {\n let s = 0;\n for ( let j = i; j < N; j+=i+1 ) s ^= a[j];\n if ( s !== a[i] ) return '-1';\n else if ( s ) b.push(i+1);\n }\n return b.length + '\\n' + b.join` `;\n})(require('fs').readFileSync('/dev/stdin', 'utf8')));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 372, "cpu_time_ms": 75, "memory_kb": 36452}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s869313797", "group_id": "codeNet:p02972", "input_text": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var a = input[1].split(\" \").map(i => parseInt(i));\n var bb = new Array(N).fill(0);\n var bsub = new Array();\n var num = 0;\n for(var i=N;i>0;i--){\n var cnt =0;\n for(var j=1;j*i<=N;j++){\n cnt+=bb[j*i-1];\n }\n if(cnt%2!=a[i-1]){\n num++;\n bsub.push(i);\n bb[i-1]++;\n }\n }\n var b = bsub.join(\" \");\n var ans = num+\"\\n\"+b;\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1574193082, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/JavaScript/s869313797.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s869313797", "user_id": "u221230011"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var a = input[1].split(\" \").map(i => parseInt(i));\n var bb = new Array(N).fill(0);\n var bsub = new Array();\n var num = 0;\n for(var i=N;i>0;i--){\n var cnt =0;\n for(var j=1;j*i<=N;j++){\n cnt+=bb[j*i-1];\n }\n if(cnt%2!=a[i-1]){\n num++;\n bsub.push(i);\n bb[i-1]++;\n }\n }\n var b = bsub.join(\" \");\n var ans = num+\"\\n\"+b;\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 804, "cpu_time_ms": 119, "memory_kb": 29052}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s515055008", "group_id": "codeNet:p02972", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0]);\n const A = arg[1].split(\" \").map(n=>parseInt(n));\n \n // 逆から考える\n A.reverse();\n \n let answer = [];\n let list = [];\n \n for(let i in A) {\n let alreadyIn = 0;\n \n for(let j=i-(N - i); j>=0; j -= (N - i)) {\n if(list[j] === 1) {\n alreadyIn++;\n }\n }\n\n if(alreadyIn % 2 === 0) {\n if(A[i] !== 0) {\n answer.push(N - i);\n list.push(1);\n } else {\n list.push(0);\n }\n } else {\n if(A[i] === 0) {\n answer.push(N - i);\n list.push(1);\n } else {\n list.push(0);\n }\n }\n }\n\n const cnt = answer.length;\n answer.sort((a,b)=>a-b);\n\n console.log(cnt);\n console.log(answer.join(\"\\n\"));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1567617531, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02972.html", "problem_id": "p02972", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02972/input.txt", "sample_output_relpath": "derived/input_output/data/p02972/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02972/JavaScript/s515055008.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s515055008", "user_id": "u598795006"}, "prompt_components": {"gold_output": "1\n1\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0]);\n const A = arg[1].split(\" \").map(n=>parseInt(n));\n \n // 逆から考える\n A.reverse();\n \n let answer = [];\n let list = [];\n \n for(let i in A) {\n let alreadyIn = 0;\n \n for(let j=i-(N - i); j>=0; j -= (N - i)) {\n if(list[j] === 1) {\n alreadyIn++;\n }\n }\n\n if(alreadyIn % 2 === 0) {\n if(A[i] !== 0) {\n answer.push(N - i);\n list.push(1);\n } else {\n list.push(0);\n }\n } else {\n if(A[i] === 0) {\n answer.push(N - i);\n list.push(1);\n } else {\n list.push(0);\n }\n }\n }\n\n const cnt = answer.length;\n answer.sort((a,b)=>a-b);\n\n console.log(cnt);\n console.log(answer.join(\"\\n\"));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "sample_input": "3\n1 0 0\n"}, "reference_outputs": ["1\n1\n"], "source_document_id": "p02972", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N empty boxes arranged in a row from left to right.\nThe integer i is written on the i-th box from the left (1 \\leq i \\leq N).\n\nFor each of these boxes, Snuke can choose either to put a ball in it or to put nothing in it.\n\nWe say a set of choices to put a ball or not in the boxes is good when the following condition is satisfied:\n\nFor every integer i between 1 and N (inclusive), the total number of balls contained in the boxes with multiples of i written on them is congruent to a_i modulo 2.\n\nDoes there exist a good set of choices? If the answer is yes, find one good set of choices.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\na_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nIf a good set of choices does not exist, print -1.\n\nIf a good set of choices exists, print one such set of choices in the following format:\n\nM\nb_1 b_2 ... b_M\n\nwhere M denotes the number of boxes that will contain a ball, and b_1,\\ b_2,\\ ...,\\ b_M are the integers written on these boxes, in any order.\n\nSample Input 1\n\n3\n1 0 0\n\nSample Output 1\n\n1\n1\n\nConsider putting a ball only in the box with 1 written on it.\n\nThere are three boxes with multiples of 1 written on them: the boxes with 1, 2, and 3. The total number of balls contained in these boxes is 1.\n\nThere is only one box with a multiple of 2 written on it: the box with 2. The total number of balls contained in these boxes is 0.\n\nThere is only one box with a multiple of 3 written on it: the box with 3. The total number of balls contained in these boxes is 0.\n\nThus, the condition is satisfied, so this set of choices is good.\n\nSample Input 2\n\n5\n0 0 0 0 0\n\nSample Output 2\n\n0\n\nPutting nothing in the boxes can be a good set of choices.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1018, "cpu_time_ms": 414, "memory_kb": 37680}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s817096496", "group_id": "codeNet:p02973", "input_text": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n input.shift();\n var A = input.map(i => parseInt(i));\n A.splice(N,A.length);\n var ans=1;\n var b=Math.pow(10,9)+1;\n for(var i=1;i parseInt(i));\n A.splice(N,A.length);\n var ans=1;\n var b=Math.pow(10,9)+1;\n for(var i=1;iNumber(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = nextInt();\n var list = nextIntArray();\n var count = {};\n for(var i = 0; i < N; i++){\n if(count[list[i]] == null){\n count[list[i]] = 1;\n }else{\n count[list[i]]++;\n }\n }\n var keys = Object.keys(count);\n myerr(keys);\n if(keys.length > 3){\n myout(\"No\");\n }else if(keys.length == 3){\n \n if((keys[0] ^ keys[1]) == keys[2] && count[keys[0]] == count[keys[1]] && count[keys[1]] == count[keys[2]]){\n myout(\"Yes\");\n }else{\n myout(\"No\");\n }\n }else if(keys.length == 2){\n if(keys.indexOf(\"0\") != -1){\n \n var zeroCount = count[\"0\"];\n var notZeroCount;\n if(keys[0] != 0){\n notZeroCount = count[keys[0]];\n }else{\n notZeroCount = count[keys[1]];\n }\n myerr(zeroCount);\n myerr(notZeroCount);\n if(notZeroCount / 2 == zeroCount){\n myout(\"Yes\");\n }else{\n myout(\"No\");\n }\n }else{\n myout(\"No\");\n }\n }else{\n if(keys[0] == 0){\n myout(\"Yes\");\n }else{\n myout(\"No\");\n }\n }\n}", "language": "JavaScript", "metadata": {"date": 1584547579, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02975.html", "problem_id": "p02975", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02975/input.txt", "sample_output_relpath": "derived/input_output/data/p02975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02975/JavaScript/s937202445.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s937202445", "user_id": "u222822036"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "var obj = init();\nMain();\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角��ペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");}\nfunction init(){\n var inputFile = myin();\n var returnObj = {\n \"list\" : inputFile, \"index\" : 0, \"max\" : inputFile.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){if(!this.hasNext()){return \"\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = nextInt();\n var list = nextIntArray();\n var count = {};\n for(var i = 0; i < N; i++){\n if(count[list[i]] == null){\n count[list[i]] = 1;\n }else{\n count[list[i]]++;\n }\n }\n var keys = Object.keys(count);\n myerr(keys);\n if(keys.length > 3){\n myout(\"No\");\n }else if(keys.length == 3){\n \n if((keys[0] ^ keys[1]) == keys[2] && count[keys[0]] == count[keys[1]] && count[keys[1]] == count[keys[2]]){\n myout(\"Yes\");\n }else{\n myout(\"No\");\n }\n }else if(keys.length == 2){\n if(keys.indexOf(\"0\") != -1){\n \n var zeroCount = count[\"0\"];\n var notZeroCount;\n if(keys[0] != 0){\n notZeroCount = count[keys[0]];\n }else{\n notZeroCount = count[keys[1]];\n }\n myerr(zeroCount);\n myerr(notZeroCount);\n if(notZeroCount / 2 == zeroCount){\n myout(\"Yes\");\n }else{\n myout(\"No\");\n }\n }else{\n myout(\"No\");\n }\n }else{\n if(keys[0] == 0){\n myout(\"Yes\");\n }else{\n myout(\"No\");\n }\n }\n}", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02975", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2589, "cpu_time_ms": 519, "memory_kb": 69120}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s529763399", "group_id": "codeNet:p02975", "input_text": "module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&t&&\"string\"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,\"a\",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p=\"\",r(r.s=0)}([function(e,t,r){\"use strict\";var n=r(1);r(2)(n.readFileSync(\"/dev/stdin\",\"utf8\"))},function(e,t){e.exports=require(\"fs\")},function(e,t,r){\"use strict\";var n=r(3),i=r(5);e.exports=function(e){var t=new n(e);i(t)}},function(e,t,r){\"use strict\";var n=r(4);e.exports=class{constructor(e){var t=e.trim().split(/\\s+/g);this.inp=new n(t)}inr(){return this.inp.deq()}in(){return parseInt(this.inp.deq(),10)}fin(){this.inp.clear()}}},function(e,t,r){\"use strict\";e.exports=class{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.size=e.length,this.items=e,this.ind=0}enq(e){this.size+=1,this.items.push(e)}deq(){var e=this.items[this.ind];return this.size-=1,this.ind+=1,e}clear(){this.items=[],this.size=0,this.ind=0}}},function(e,t,r){\"use strict\";e.exports=function(e){for(var t=e.in(),r=new Array(t),n=!1,i=0;i0&&void 0!==arguments[0]?arguments[0]:[];this.size=e.length,this.items=e,this.ind=0}enq(e){this.size+=1,this.items.push(e)}deq(){var e=this.items[this.ind];return this.size-=1,this.ind+=1,e}clear(){this.items=[],this.size=0,this.ind=0}}},function(e,t,r){\"use strict\";e.exports=function(e){for(var t=e.in(),r=new Array(t),n=!1,i=0;i0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value===\"number\"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);var a=self.value,b=n.value;var quotient;if(b===0)throw new Error(\"Cannot divide by zero\");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);var value=n.value;if(value===0)return false;if(value===1)return true;if(value===2)return this.isEven();return this.mod(n).equals(Integer[0])};SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(25))return true}BigInteger.prototype.isPrime=function(){var isPrime=isBasicPrime(this);if(isPrime!==undefined)return isPrime;var n=this.abs(),nPrev=n.prev();var a=[2,3,5,7,11,13,17,19],b=nPrev,d,t,i,x;while(b.isEven())b=b.divide(2);for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return(typeof n===\"number\"||typeof n===\"string\")&&+Math.abs(n)<=BASE||n instanceof BigInteger&&n.value.length<=1}BigInteger.prototype.shiftLeft=function(n){if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}n=+n;if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(n){var remQuo;if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}n=+n;if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v===\"number\"?v|LOBMASK_I:v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=Math.min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b){a=parseValue(a);b=parseValue(b);var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(Math.random()*range));var length=range.value.length-1;var result=[],restricted=true;for(var i=length;i>=0;i--){var top=restricted?range.value[i]:BASE;var digit=truncate(Math.random()*top);result.unshift(digit);if(digit=absBase){if(c===\"1\"&&absBase===1)continue;throw new Error(c+\" is not a valid digit in base \"+base+\".\")}else if(c.charCodeAt(0)-87>=absBase){throw new Error(c+\" is not a valid digit in base \"+base+\".\")}}}if(2<=base&&base<=36){if(length<=LOG_MAX_INT/Math.log(base)){var result=parseInt(text,base);if(isNaN(result)){throw new Error(c+\" is not a valid digit in base \"+base+\".\")}return new SmallInteger(parseInt(text,base))}}base=parseValue(base);var digits=[];var isNegative=text[0]===\"-\";for(i=isNegative?1:0;i\");digits.push(parseValue(text.slice(start+1,i)))}else throw new Error(c+\" is not a valid character\")}return parseBaseFromArray(digits,base,isNegative)};function parseBaseFromArray(digits,base,isNegative){var val=Integer[0],pow=Integer[1],i;for(i=digits.length-1;i>=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit){if(digit<=35){return\"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(digit)}return\"<\"+digit+\">\"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error(\"Cannot convert nonzero numbers to base 0.\")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n)).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(+n-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.equals(1)){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(+n)).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base){var arr=toBase(n,base);return(arr.isNegative?\"-\":\"\")+arr.value.map(stringify).join(\"\")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!==10)return toBaseString(this,radix);var v=this.value,l=v.length,str=String(v[--l]),zeros=\"0000000\",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?\"-\":\"\";return sign+str};SmallInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!=10)return toBaseString(this,radix);return String(this.value)};BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return new SmallInteger(x);throw new Error(\"Invalid integer: \"+v)}var sign=v[0]===\"-\";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error(\"Invalid integer: \"+split.join(\"e\"));if(split.length===2){var exp=split[1];if(exp[0]===\"+\")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error(\"Invalid integer: \"+exp+\" is not a valid exponent.\");var text=split[0];var decimalPlace=text.indexOf(\".\");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error(\"Cannot include negative exponent part for integers\");text+=new Array(exp+1).join(\"0\");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error(\"Invalid integer: \"+v);var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+\" is not an integer.\");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v===\"number\"){return parseNumberValue(v)}if(typeof v===\"string\"){return parseStringValue(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=new SmallInteger(i);if(i>0)Integer[-i]=new SmallInteger(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();\n\nfunction main(arg) {\n var data = arg.trim().split(\"\\n\")[1].split(\" \")\n let flag = false\n\n for (let i = 0; i < data.length; i++) {\n let a\n let b\n let c = data[i]\n if (i+1 >= data.length) {\n a = data[0]\n } else {\n a = data[i+1]\n }\n if (i-1 < 0) {\n b = data[data.length - 1]\n } else {\n b = data[i-1]\n }\n if (!bigInt(a).xor(b).neq(c)) {\n flag = true\n }\n }\n if (flag) {\n console.log('Yes')\n } else {\n console.log('No')\n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1563159736, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02975.html", "problem_id": "p02975", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02975/input.txt", "sample_output_relpath": "derived/input_output/data/p02975/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02975/JavaScript/s275471094.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s275471094", "user_id": "u063969814"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\"\nvar bigInt=function(undefined){\"use strict\";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),LOG_MAX_INT=Math.log(MAX_INT);function Integer(v,radix){if(typeof v===\"undefined\")return Integer[0];if(typeof radix!==\"undefined\")return+radix===10?parseValue(v):parseBase(v,radix);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value===\"number\"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);var a=self.value,b=n.value;var quotient;if(b===0)throw new Error(\"Cannot divide by zero\");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);var value=n.value;if(value===0)return false;if(value===1)return true;if(value===2)return this.isEven();return this.mod(n).equals(Integer[0])};SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(25))return true}BigInteger.prototype.isPrime=function(){var isPrime=isBasicPrime(this);if(isPrime!==undefined)return isPrime;var n=this.abs(),nPrev=n.prev();var a=[2,3,5,7,11,13,17,19],b=nPrev,d,t,i,x;while(b.isEven())b=b.divide(2);for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return(typeof n===\"number\"||typeof n===\"string\")&&+Math.abs(n)<=BASE||n instanceof BigInteger&&n.value.length<=1}BigInteger.prototype.shiftLeft=function(n){if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}n=+n;if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(n){var remQuo;if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}n=+n;if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v===\"number\"?v|LOBMASK_I:v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=Math.min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b){a=parseValue(a);b=parseValue(b);var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(Math.random()*range));var length=range.value.length-1;var result=[],restricted=true;for(var i=length;i>=0;i--){var top=restricted?range.value[i]:BASE;var digit=truncate(Math.random()*top);result.unshift(digit);if(digit=absBase){if(c===\"1\"&&absBase===1)continue;throw new Error(c+\" is not a valid digit in base \"+base+\".\")}else if(c.charCodeAt(0)-87>=absBase){throw new Error(c+\" is not a valid digit in base \"+base+\".\")}}}if(2<=base&&base<=36){if(length<=LOG_MAX_INT/Math.log(base)){var result=parseInt(text,base);if(isNaN(result)){throw new Error(c+\" is not a valid digit in base \"+base+\".\")}return new SmallInteger(parseInt(text,base))}}base=parseValue(base);var digits=[];var isNegative=text[0]===\"-\";for(i=isNegative?1:0;i\");digits.push(parseValue(text.slice(start+1,i)))}else throw new Error(c+\" is not a valid character\")}return parseBaseFromArray(digits,base,isNegative)};function parseBaseFromArray(digits,base,isNegative){var val=Integer[0],pow=Integer[1],i;for(i=digits.length-1;i>=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit){if(digit<=35){return\"0123456789abcdefghijklmnopqrstuvwxyz\".charAt(digit)}return\"<\"+digit+\">\"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error(\"Cannot convert nonzero numbers to base 0.\")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n)).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(+n-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.equals(1)){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(+n)).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base){var arr=toBase(n,base);return(arr.isNegative?\"-\":\"\")+arr.value.map(stringify).join(\"\")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!==10)return toBaseString(this,radix);var v=this.value,l=v.length,str=String(v[--l]),zeros=\"0000000\",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?\"-\":\"\";return sign+str};SmallInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!=10)return toBaseString(this,radix);return String(this.value)};BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return new SmallInteger(x);throw new Error(\"Invalid integer: \"+v)}var sign=v[0]===\"-\";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error(\"Invalid integer: \"+split.join(\"e\"));if(split.length===2){var exp=split[1];if(exp[0]===\"+\")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error(\"Invalid integer: \"+exp+\" is not a valid exponent.\");var text=split[0];var decimalPlace=text.indexOf(\".\");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error(\"Cannot include negative exponent part for integers\");text+=new Array(exp+1).join(\"0\");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error(\"Invalid integer: \"+v);var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+\" is not an integer.\");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v===\"number\"){return parseNumberValue(v)}if(typeof v===\"string\"){return parseStringValue(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=new SmallInteger(i);if(i>0)Integer[-i]=new SmallInteger(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();\n\nfunction main(arg) {\n var data = arg.trim().split(\"\\n\")[1].split(\" \")\n let flag = false\n\n for (let i = 0; i < data.length; i++) {\n let a\n let b\n let c = data[i]\n if (i+1 >= data.length) {\n a = data[0]\n } else {\n a = data[i+1]\n }\n if (i-1 < 0) {\n b = data[data.length - 1]\n } else {\n b = data[i-1]\n }\n if (!bigInt(a).xor(b).neq(c)) {\n flag = true\n }\n }\n if (flag) {\n console.log('Yes')\n } else {\n console.log('No')\n }\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02975", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has N hats. The i-th hat has an integer a_i written on it.\n\nThere are N camels standing in a circle.\nSnuke will put one of his hats on each of these camels.\n\nIf there exists a way to distribute the hats to the camels such that the following condition is satisfied for every camel, print Yes; otherwise, print No.\n\nThe bitwise XOR of the numbers written on the hats on both adjacent camels is equal to the number on the hat on itself.\n\nWhat is XOR?\n\nThe bitwise XOR x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n of n non-negative integers x_1, x_2, \\ldots, x_n is defined as follows:\n\n- When x_1 \\oplus x_2 \\oplus \\ldots \\oplus x_n is written in base two, the digit in the 2^k's place (k \\geq 0) is 1 if the number of integers among x_1, x_2, \\ldots, x_n whose binary representations have 1 in the 2^k's place is odd, and 0 if that count is even.\n\nFor example, 3 \\oplus 5 = 6.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10^{5}\n\n0 \\leq a_i \\leq 10^{9}\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 \\ldots a_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\nYes\n\nIf we put the hats with 1, 2, and 3 in this order, clockwise, the condition will be satisfied for every camel, so the answer is Yes.\n\nSample Input 2\n\n4\n1 2 4 8\n\nSample Output 2\n\nNo\n\nThere is no such way to distribute the hats; the answer is No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 28148, "cpu_time_ms": 320, "memory_kb": 31920}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s937643291", "group_id": "codeNet:p02981", "input_text": "function Main(input) {\n const args = input.split(' ');\n var fee;\n\tvar number = parseInt(args[0],10);\n var taxifee = parseInt(args[1],10);\n \tvar taxiAllFee = number * taxifee\n var trainAllfee = parseInt(args[2],10);\n \n if(taxiAllFee < trainAllfee){\n fee = taxiAllFee\n }else {\n fee = trainAllfee\n }\n \n\tconsole.log(fee);\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1563555957, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02981.html", "problem_id": "p02981", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02981/input.txt", "sample_output_relpath": "derived/input_output/data/p02981/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02981/JavaScript/s937643291.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s937643291", "user_id": "u819348316"}, "prompt_components": {"gold_output": "8\n", "input_to_evaluate": "function Main(input) {\n const args = input.split(' ');\n var fee;\n\tvar number = parseInt(args[0],10);\n var taxifee = parseInt(args[1],10);\n \tvar taxiAllFee = number * taxifee\n var trainAllfee = parseInt(args[2],10);\n \n if(taxiAllFee < trainAllfee){\n fee = taxiAllFee\n }else {\n fee = trainAllfee\n }\n \n\tconsole.log(fee);\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "sample_input": "4 2 9\n"}, "reference_outputs": ["8\n"], "source_document_id": "p02981", "source_text": "Score : 100 points\n\nProblem Statement\n\nN of us are going on a trip, by train or taxi.\n\nThe train will cost each of us A yen (the currency of Japan).\n\nThe taxi will cost us a total of B yen.\n\nHow much is our minimum total travel expense?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq A \\leq 50\n\n1 \\leq B \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint an integer representing the minimum total travel expense.\n\nSample Input 1\n\n4 2 9\n\nSample Output 1\n\n8\n\nThe train will cost us 4 \\times 2 = 8 yen, and the taxi will cost us 9 yen, so the minimum total travel expense is 8 yen.\n\nSample Input 2\n\n4 2 7\n\nSample Output 2\n\n7\n\nSample Input 3\n\n4 2 8\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 416, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s859903871", "group_id": "codeNet:p02982", "input_text": "\"use strict\"\nconst create = () => {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nconst dist = (y,z) => {\n let sum = 0\n for(let i = 0; i {\n const [N, D] = nextIntArray()\n let x = []\n while(hasNext()){\n x.push(nextIntArray())\n }\n let cnt = 0\n for(let i =0;i {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nconst dist = (y,z) => {\n let sum = 0\n for(let i = 0; i {\n const [N, D] = nextIntArray()\n let x = []\n while(hasNext()){\n x.push(nextIntArray())\n }\n let cnt = 0\n for(let i =0;i ++c);\n return c;\n}\n \nfunction main(stdin) {\n const l = [];\n let res = 'Yes';\n \n for (let i = 0; i < 4; ++i) { \n const c = stdin.charCodeAt(i);\n l[c] = l[c] || 0;\n ++l[c];\n }\n \n if (ary_counter(l) !== 2) res = 'No'; \n \n console.log(res);\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1566942292, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/JavaScript/s781827373.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s781827373", "user_id": "u830237447"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict';\n \nfunction ary_counter(ary) {\n let c = 0;\n ary.forEach(a => ++c);\n return c;\n}\n \nfunction main(stdin) {\n const l = [];\n let res = 'Yes';\n \n for (let i = 0; i < 4; ++i) { \n const c = stdin.charCodeAt(i);\n l[c] = l[c] || 0;\n ++l[c];\n }\n \n if (ary_counter(l) !== 2) res = 'No'; \n \n console.log(res);\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s957161589", "group_id": "codeNet:p02987", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n \nvar a = input.substr( 0,1 );\n var b = input.substr( 1, 1 );\n var c = input.substr(2, 1 );\n var d = input.substr( 3, 1 );\n \n var str = input; \n// 0文字目から4文字分を指定\n \n \n var str = [a,b,c,d];\nstr.sort();\n \n \n var a= str[0];\n var b= str[1];\n var c= str[2];\n var d= str[3];\n // console.log(a,b,c,d)\nvar f = 0;\n if (a == b) {\n if (a==c) {console.log('No');}\n else if (c==d){\n //console.log('Yes');\n var f=1;\n }\n \n }\n \n \n if (f == 1){console.log('Yes')}else{console.log('No');}\n \n}\n\n \n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \n", "language": "JavaScript", "metadata": {"date": 1564855804, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/JavaScript/s957161589.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s957161589", "user_id": "u362031378"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n \nvar a = input.substr( 0,1 );\n var b = input.substr( 1, 1 );\n var c = input.substr(2, 1 );\n var d = input.substr( 3, 1 );\n \n var str = input; \n// 0文字目から4文字分を指定\n \n \n var str = [a,b,c,d];\nstr.sort();\n \n \n var a= str[0];\n var b= str[1];\n var c= str[2];\n var d= str[3];\n // console.log(a,b,c,d)\nvar f = 0;\n if (a == b) {\n if (a==c) {console.log('No');}\n else if (c==d){\n //console.log('Yes');\n var f=1;\n }\n \n }\n \n \n if (f == 1){console.log('Yes')}else{console.log('No');}\n \n}\n\n \n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 950, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s928504660", "group_id": "codeNet:p02987", "input_text": "'use strict'\n\nfunction main(input) {\n input = input\n .split('')\n .slice(0, -1)\n .sort()\n\n const ans =\n input[0] === input[1] && input[2] === input[3] && input[1] !== input[2]\n ? 'Yes'\n : 'No'\n //Yes // No\n console.log(ans)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1564197843, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/JavaScript/s928504660.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s928504660", "user_id": "u032263881"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict'\n\nfunction main(input) {\n input = input\n .split('')\n .slice(0, -1)\n .sort()\n\n const ans =\n input[0] === input[1] && input[2] === input[3] && input[1] !== input[2]\n ? 'Yes'\n : 'No'\n //Yes // No\n console.log(ans)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s806797162", "group_id": "codeNet:p02987", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n var S = input;\n var targetStr = S[0]\n var targetStr2 = S[2]\n var count = (S.match(new RegExp(targetStr, \"g\" ))||[]).length;\n var count2 = (S.match(new RegExp(targetStr2, \"g\" ))||[]).length;\n if(count == 2 && count2 == 2){\n console.log(\"Yes\")\n }else{\n console.log(\"No\")\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1561858483, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02987.html", "problem_id": "p02987", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02987/input.txt", "sample_output_relpath": "derived/input_output/data/p02987/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02987/JavaScript/s806797162.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s806797162", "user_id": "u803040570"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n var S = input;\n var targetStr = S[0]\n var targetStr2 = S[2]\n var count = (S.match(new RegExp(targetStr, \"g\" ))||[]).length;\n var count2 = (S.match(new RegExp(targetStr2, \"g\" ))||[]).length;\n if(count == 2 && count2 == 2){\n console.log(\"Yes\")\n }else{\n console.log(\"No\")\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "sample_input": "ASSA\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02987", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a 4-character string S consisting of uppercase English letters.\nDetermine if S consists of exactly two kinds of characters which both appear twice in S.\n\nConstraints\n\nThe length of S is 4.\n\nS consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S consists of exactly two kinds of characters which both appear twice in S, print Yes; otherwise, print No.\n\nSample Input 1\n\nASSA\n\nSample Output 1\n\nYes\n\nS consists of A and S which both appear twice in S.\n\nSample Input 2\n\nSTOP\n\nSample Output 2\n\nNo\n\nSample Input 3\n\nFFEE\n\nSample Output 3\n\nYes\n\nSample Input 4\n\nFREE\n\nSample Output 4\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 433, "cpu_time_ms": 51, "memory_kb": 9420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s411096691", "group_id": "codeNet:p02991", "input_text": "'use strict'\n\nconst INF = 900719925474099;\nfunction mapint(temp){\n return temp.split(' ').map((v)=>parseInt(v));\n}\n\nfunction lower_bound(d,a,b,e){\n for(var c;1new Array(0));\n let nt = new Array(n).fill(-1);\n for(let i=1;i<=m;i++){\n tt = mapint(temp[i]);\n g[tt[0]-1].push(tt[1]-1);\n }\n tt = mapint(temp[m+1]);\n let s = tt[0]-1;\n let t = tt[1]-1;\n //console.log(g.map(v=>v.join(' ')),[...nt]);\n\n let next = [s];\n nt[s] = 0;\n let l = 1;\n let step = 0;\n let f=false;\n let next2 = new Set;\n while(l>0){\n //for(let k=0;k<10;k++){\n next2.clear();\n step++;\n for(let i=0;iparseInt(v));\n}\n\nfunction lower_bound(d,a,b,e){\n for(var c;1new Array(0));\n let nt = new Array(n).fill(-1);\n for(let i=1;i<=m;i++){\n tt = mapint(temp[i]);\n g[tt[0]-1].push(tt[1]-1);\n }\n tt = mapint(temp[m+1]);\n let s = tt[0]-1;\n let t = tt[1]-1;\n //console.log(g.map(v=>v.join(' ')),[...nt]);\n\n let next = [s];\n nt[s] = 0;\n let l = 1;\n let step = 0;\n let f=false;\n let next2 = new Set;\n while(l>0){\n //for(let k=0;k<10;k++){\n next2.clear();\n step++;\n for(let i=0;i task.b) return console.log('No')\n}\nreturn console.log('Yes')", "language": "JavaScript", "metadata": {"date": 1583207366, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02996.html", "problem_id": "p02996", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02996/input.txt", "sample_output_relpath": "derived/input_output/data/p02996/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02996/JavaScript/s571911361.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s571911361", "user_id": "u556056975"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict'\nconst inputs = require('fs').readFileSync(0, 'utf8').split('\\n')\ninputs.shift()\nconst tasks = []\nfor (const input of inputs) {\n const ab = input.split(' ')\n tasks.push({a: ab[0], b: parseInt(ab[1], 10)})\n}\ntasks.sort(function(x, y) {return x.b - y.b})\nlet time = 0\nfor (const task of tasks) {\n time += parseInt(task.a, 10)\n if (time > task.b) return console.log('No')\n}\nreturn console.log('Yes')", "problem_context": "Score: 400 points\n\nProblem Statement\n\nKizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs.\n\nLet the current time be time 0. Kizahashi has N jobs numbered 1 to N.\n\nIt takes A_i units of time for Kizahashi to complete Job i. The deadline for Job i is time B_i, and he must complete the job before or at this time.\n\nKizahashi cannot work on two or more jobs simultaneously, but when he completes a job, he can start working on another immediately.\n\nCan Kizahashi complete all the jobs in time? If he can, print Yes; if he cannot, print No.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq 10^9 (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n.\n.\n.\nA_N B_N\n\nOutput\n\nIf Kizahashi can complete all the jobs in time, print Yes; if he cannot, print No.\n\nSample Input 1\n\n5\n2 4\n1 9\n1 8\n4 9\n3 12\n\nSample Output 1\n\nYes\n\nHe can complete all the jobs in time by, for example, doing them in the following order:\n\nDo Job 2 from time 0 to 1.\n\nDo Job 1 from time 1 to 3.\n\nDo Job 4 from time 3 to 7.\n\nDo Job 3 from time 7 to 8.\n\nDo Job 5 from time 8 to 11.\n\nNote that it is fine to complete Job 3 exactly at the deadline, time 8.\n\nSample Input 2\n\n3\n334 1000\n334 1000\n334 1000\n\nSample Output 2\n\nNo\n\nHe cannot complete all the jobs in time, no matter what order he does them in.\n\nSample Input 3\n\n30\n384 8895\n1725 9791\n170 1024\n4 11105\n2 6\n578 1815\n702 3352\n143 5141\n1420 6980\n24 1602\n849 999\n76 7586\n85 5570\n444 4991\n719 11090\n470 10708\n1137 4547\n455 9003\n110 9901\n15 8578\n368 3692\n104 1286\n3 4\n366 12143\n7 6649\n610 2374\n152 7324\n4 7042\n292 11386\n334 5720\n\nSample Output 3\n\nYes", "sample_input": "5\n2 4\n1 9\n1 8\n4 9\n3 12\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p02996", "source_text": "Score: 400 points\n\nProblem Statement\n\nKizahashi, who was appointed as the administrator of ABC at National Problem Workshop in the Kingdom of AtCoder, got too excited and took on too many jobs.\n\nLet the current time be time 0. Kizahashi has N jobs numbered 1 to N.\n\nIt takes A_i units of time for Kizahashi to complete Job i. The deadline for Job i is time B_i, and he must complete the job before or at this time.\n\nKizahashi cannot work on two or more jobs simultaneously, but when he completes a job, he can start working on another immediately.\n\nCan Kizahashi complete all the jobs in time? If he can, print Yes; if he cannot, print No.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i, B_i \\leq 10^9 (1 \\leq i \\leq N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 B_1\n.\n.\n.\nA_N B_N\n\nOutput\n\nIf Kizahashi can complete all the jobs in time, print Yes; if he cannot, print No.\n\nSample Input 1\n\n5\n2 4\n1 9\n1 8\n4 9\n3 12\n\nSample Output 1\n\nYes\n\nHe can complete all the jobs in time by, for example, doing them in the following order:\n\nDo Job 2 from time 0 to 1.\n\nDo Job 1 from time 1 to 3.\n\nDo Job 4 from time 3 to 7.\n\nDo Job 3 from time 7 to 8.\n\nDo Job 5 from time 8 to 11.\n\nNote that it is fine to complete Job 3 exactly at the deadline, time 8.\n\nSample Input 2\n\n3\n334 1000\n334 1000\n334 1000\n\nSample Output 2\n\nNo\n\nHe cannot complete all the jobs in time, no matter what order he does them in.\n\nSample Input 3\n\n30\n384 8895\n1725 9791\n170 1024\n4 11105\n2 6\n578 1815\n702 3352\n143 5141\n1420 6980\n24 1602\n849 999\n76 7586\n85 5570\n444 4991\n719 11090\n470 10708\n1137 4547\n455 9003\n110 9901\n15 8578\n368 3692\n104 1286\n3 4\n366 12143\n7 6649\n610 2374\n152 7324\n4 7042\n292 11386\n334 5720\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 412, "cpu_time_ms": 626, "memory_kb": 72908}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s875312088", "group_id": "codeNet:p02999", "input_text": "const Main = (input) => {\n const nSplitted = input.split(\" \");\n const X = Number(nSplitted[0]);\n const A = Number(nSplitted[1]);\n if (X < 0 || X > 10 || A < 0 || A > 10) {\n \treturn;\n }\n var result = 10;\n if (X < A) {\n \tresult = 0;\n }\n console.log(result);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1562081094, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02999.html", "problem_id": "p02999", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02999/input.txt", "sample_output_relpath": "derived/input_output/data/p02999/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02999/JavaScript/s875312088.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s875312088", "user_id": "u751960655"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "const Main = (input) => {\n const nSplitted = input.split(\" \");\n const X = Number(nSplitted[0]);\n const A = Number(nSplitted[1]);\n if (X < 0 || X > 10 || A < 0 || A > 10) {\n \treturn;\n }\n var result = 10;\n if (X < A) {\n \tresult = 0;\n }\n console.log(result);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02999", "source_text": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 323, "cpu_time_ms": 54, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s056374967", "group_id": "codeNet:p02999", "input_text": "function main(input) {\n console.log(input);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nb = 0;\n\nif (X >= A) {\n\tb = 10;\n}\n\n console.log(b);\n", "language": "JavaScript", "metadata": {"date": 1560713941, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02999.html", "problem_id": "p02999", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02999/input.txt", "sample_output_relpath": "derived/input_output/data/p02999/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02999/JavaScript/s056374967.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s056374967", "user_id": "u533610110"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "function main(input) {\n console.log(input);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nb = 0;\n\nif (X >= A) {\n\tb = 10;\n}\n\n console.log(b);\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02999", "source_text": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 157, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s638863646", "group_id": "codeNet:p02999", "input_text": "\nfunction Main(input) {\n var X = parseInt(input[0], 10);\n var A = parseInt(input[1], 10);\n\n console.log(X < A ? '0' : '10');\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "language": "JavaScript", "metadata": {"date": 1560711672, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p02999.html", "problem_id": "p02999", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p02999/input.txt", "sample_output_relpath": "derived/input_output/data/p02999/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p02999/JavaScript/s638863646.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s638863646", "user_id": "u709108999"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "\nfunction Main(input) {\n var X = parseInt(input[0], 10);\n var A = parseInt(input[1], 10);\n\n console.log(X < A ? '0' : '10');\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "sample_input": "3 5\n"}, "reference_outputs": ["0\n"], "source_document_id": "p02999", "source_text": "Score : 100 points\n\nProblem Statement\n\nX and A are integers between 0 and 9 (inclusive).\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nConstraints\n\n0 \\leq X, A \\leq 9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX A\n\nOutput\n\nIf X is less than A, print 0; if X is not less than A, print 10.\n\nSample Input 1\n\n3 5\n\nSample Output 1\n\n0\n\n3 is less than 5, so we should print 0.\n\nSample Input 2\n\n7 5\n\nSample Output 2\n\n10\n\n7 is not less than 5, so we should print 10.\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n10\n\n6 is not less than 6, so we should print 10.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 214, "cpu_time_ms": 207, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s117199737", "group_id": "codeNet:p03000", "input_text": "function Main(input) {\n const N = parseInt(input.shift())\n const X = parseInt(input.shift())\n const Ls = input.map(x => parseInt(x));\n\n var current = 0;\n var sum = 1;\n for (var i = 0; i < N; i++) {\n current += Ls[i];\n if(current <= X) {\n sum++;\n }\n }\n console.log(sum);\n}\n\n// 1行入力の場合\n// Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());\n\n// 改行で分割\n// Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n/));\n\n// 改行・空白で分割\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "language": "JavaScript", "metadata": {"date": 1560713552, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03000.html", "problem_id": "p03000", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03000/input.txt", "sample_output_relpath": "derived/input_output/data/p03000/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03000/JavaScript/s117199737.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s117199737", "user_id": "u757900744"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n const N = parseInt(input.shift())\n const X = parseInt(input.shift())\n const Ls = input.map(x => parseInt(x));\n\n var current = 0;\n var sum = 1;\n for (var i = 0; i < N; i++) {\n current += Ls[i];\n if(current <= X) {\n sum++;\n }\n }\n console.log(sum);\n}\n\n// 1行入力の場合\n// Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());\n\n// 改行で分割\n// Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n/));\n\n// 改行・空白で分割\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "sample_input": "3 6\n3 4 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03000", "source_text": "Score : 200 points\n\nProblem Statement\n\nA ball will bounce along a number line, making N + 1 bounces. It will make the first bounce at coordinate D_1 = 0, and the i-th bounce (2 \\leq i \\leq N+1) at coordinate D_i = D_{i-1} + L_{i-1}.\n\nHow many times will the ball make a bounce where the coordinate is at most X?\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq L_i \\leq 100\n\n1 \\leq X \\leq 10000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nL_1 L_2 ... L_{N-1} L_N\n\nOutput\n\nPrint the number of times the ball will make a bounce where the coordinate is at most X.\n\nSample Input 1\n\n3 6\n3 4 5\n\nSample Output 1\n\n2\n\nThe ball will make a bounce at the coordinates 0, 3, 7 and 12, among which two are less than or equal to 6.\n\nSample Input 2\n\n4 9\n3 3 3 3\n\nSample Output 2\n\n4\n\nThe ball will make a bounce at the coordinates 0, 3, 6, 9 and 12, among which four are less than or equal to 9.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 622, "cpu_time_ms": 192, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s923513170", "group_id": "codeNet:p03005", "input_text": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var k = o.a();\n if(k === 1)return 0;\n return n-k;\n}", "language": "JavaScript", "metadata": {"date": 1560646868, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03005.html", "problem_id": "p03005", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03005/input.txt", "sample_output_relpath": "derived/input_output/data/p03005/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03005/JavaScript/s923513170.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s923513170", "user_id": "u643613120"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var k = o.a();\n if(k === 1)return 0;\n return n-k;\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi is distributing N balls to K persons.\n\nIf each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?\n\nConstraints\n\n1 \\leq K \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the maximum possible difference in the number of balls received.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1\n\nThe only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.\n\nThus, the maximum possible difference in the number of balls received is 1.\n\nSample Input 2\n\n3 1\n\nSample Output 2\n\n0\n\nWe have no choice but to give three balls to the only person, in which case the difference in the number of balls received is 0.\n\nSample Input 3\n\n8 5\n\nSample Output 3\n\n3\n\nFor example, if we give 1, 4, 1, 1, 1 balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be 3, which is the maximum result.", "sample_input": "3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03005", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi is distributing N balls to K persons.\n\nIf each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?\n\nConstraints\n\n1 \\leq K \\leq N \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the maximum possible difference in the number of balls received.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n1\n\nThe only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.\n\nThus, the maximum possible difference in the number of balls received is 1.\n\nSample Input 2\n\n3 1\n\nSample Output 2\n\n0\n\nWe have no choice but to give three balls to the only person, in which case the difference in the number of balls received is 0.\n\nSample Input 3\n\n8 5\n\nSample Output 3\n\n3\n\nFor example, if we give 1, 4, 1, 1, 1 balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be 3, which is the maximum result.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 933, "cpu_time_ms": 681, "memory_kb": 22964}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s952392351", "group_id": "codeNet:p03012", "input_text": "var lines = [];\n\nvar readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var N = Number(lines[0]);\n var W = lines[1].split(\" \").map(i => Number(i))\n\n \n var result = Infinity\n\n for (var i = 0; i < N; i++) {\n var S1 = 0; var S2 = 0;;\n\n for (var j = 0; j < i; j++) { S1 += W[j] }\n for (var j = i; j < N; j++) { S2 += W[j] }\n \n result = Math.min(Math.abs(S1 - S2),result)\n }\n console.log(result)\n}); ", "language": "JavaScript", "metadata": {"date": 1560129067, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03012.html", "problem_id": "p03012", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03012/input.txt", "sample_output_relpath": "derived/input_output/data/p03012/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03012/JavaScript/s952392351.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s952392351", "user_id": "u266742706"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "var lines = [];\n\nvar readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var N = Number(lines[0]);\n var W = lines[1].split(\" \").map(i => Number(i))\n\n \n var result = Infinity\n\n for (var i = 0; i < N; i++) {\n var S1 = 0; var S2 = 0;;\n\n for (var j = 0; j < i; j++) { S1 += W[j] }\n for (var j = i; j < N; j++) { S2 += W[j] }\n \n result = Math.min(Math.abs(S1 - S2),result)\n }\n console.log(result)\n}); ", "problem_context": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03012", "source_text": "Score : 200 points\n\nProblem Statement\n\nWe have N weights indexed 1 to N. The \bmass of the weight indexed i is W_i.\n\nWe will divide these weights into two groups: the weights with indices not greater than T, and those with indices greater than T, for some integer 1 \\leq T < N. Let S_1 be the sum of the masses of the weights in the former group, and S_2 be the sum of the masses of the weights in the latter group.\n\nConsider all possible such divisions and find the minimum possible absolute difference of S_1 and S_2.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq W_i \\leq 100\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nW_1 W_2 ... W_{N-1} W_N\n\nOutput\n\nPrint the minimum possible absolute difference of S_1 and S_2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n0\n\nIf T = 2, S_1 = 1 + 2 = 3 and S_2 = 3, with the absolute difference of 0.\n\nSample Input 2\n\n4\n1 3 1 1\n\nSample Output 2\n\n2\n\nIf T = 2, S_1 = 1 + 3 = 4 and S_2 = 1 + 1 = 2, with the absolute difference of 2. We cannot have a smaller absolute difference.\n\nSample Input 3\n\n8\n27 23 76 2 3 5 62 52\n\nSample Output 3\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 611, "cpu_time_ms": 63, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s182699730", "group_id": "codeNet:p03013", "input_text": "var memo = [1];\nfunction Main(input) {\n var result;\n const N = parseInt(input.shift());\n const M = parseInt(input.shift());\n const As = input.map(a => parseInt(a)).filter(function (x, i, self) {\n return self.indexOf(x) === i;\n });\n \n // 前処理\n var lastA = -10;\n for (var i = 0; i < As.length; i++) {\n var element = As[i];\n if(element-1 == lastA) {\n console.log(\"0\");\n return;\n }\n lastA = element;\n }\n\n for (var i = 1; i < N; i++) {\n memo.push(memo[i-1] * i);\n }\n\n var divs = [];\n lastA = -1;\n for (var i = 0; i < As.length; i++) {\n var element = As[i];\n divs.push(getPattern(element - lastA - 2));\n lastA = element;\n }\n \n divs.push(getPattern(N -lastA -1));\n \n result = 1;\n divs.forEach(element => {\n result *= element;\n result %= 1000000007;\n });\n \n console.log(result);\n \n}\n\nfunction getPattern(div) {\n // console.log(\"div\",div);\n \n var result = 0;\n var maxTwo = Math.floor(div/2);\n \n for (var two = 0; two <= maxTwo; two++) {\n // console.log(div - two*2, two);\n \n result += get12Pattern(div - two*2, two);\n result = result % 1000000007;\n }\n // console.log(\"result\", result);\n \n return result;\n}\n\nfunction get12Pattern(one, two){\n // console.log(one, two);\n \n return kaijo(one+two) / (kaijo(one) * kaijo(two));\n}\n\nfunction kaijo(value) {\n return memo[value];\n}\n\n// 改行・空白で分割\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "language": "JavaScript", "metadata": {"date": 1560133767, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03013.html", "problem_id": "p03013", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03013/input.txt", "sample_output_relpath": "derived/input_output/data/p03013/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03013/JavaScript/s182699730.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s182699730", "user_id": "u757900744"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "var memo = [1];\nfunction Main(input) {\n var result;\n const N = parseInt(input.shift());\n const M = parseInt(input.shift());\n const As = input.map(a => parseInt(a)).filter(function (x, i, self) {\n return self.indexOf(x) === i;\n });\n \n // 前処理\n var lastA = -10;\n for (var i = 0; i < As.length; i++) {\n var element = As[i];\n if(element-1 == lastA) {\n console.log(\"0\");\n return;\n }\n lastA = element;\n }\n\n for (var i = 1; i < N; i++) {\n memo.push(memo[i-1] * i);\n }\n\n var divs = [];\n lastA = -1;\n for (var i = 0; i < As.length; i++) {\n var element = As[i];\n divs.push(getPattern(element - lastA - 2));\n lastA = element;\n }\n \n divs.push(getPattern(N -lastA -1));\n \n result = 1;\n divs.forEach(element => {\n result *= element;\n result %= 1000000007;\n });\n \n console.log(result);\n \n}\n\nfunction getPattern(div) {\n // console.log(\"div\",div);\n \n var result = 0;\n var maxTwo = Math.floor(div/2);\n \n for (var two = 0; two <= maxTwo; two++) {\n // console.log(div - two*2, two);\n \n result += get12Pattern(div - two*2, two);\n result = result % 1000000007;\n }\n // console.log(\"result\", result);\n \n return result;\n}\n\nfunction get12Pattern(one, two){\n // console.log(one, two);\n \n return kaijo(one+two) / (kaijo(one) * kaijo(two));\n}\n\nfunction kaijo(value) {\n return memo[value];\n}\n\n// 改行・空白で分割\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "sample_input": "6 1\n3\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03013", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere is a staircase with N steps. Takahashi is now standing at the foot of the stairs, that is, on the 0-th step.\nHe can climb up one or two steps at a time.\n\nHowever, the treads of the a_1-th, a_2-th, a_3-th, \\ldots, a_M-th steps are broken, so it is dangerous to set foot on those steps.\n\nHow many are there to climb up to the top step, that is, the N-th step, without setting foot on the broken steps?\nFind the count modulo 1\\ 000\\ 000\\ 007.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n0 \\leq M \\leq N-1\n\n1 \\leq a_1 < a_2 < ... < a_M \\leq N-1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1\na_2\n.\n.\n.\na_M\n\nOutput\n\nPrint the number of ways to climb up the stairs under the condition, modulo 1\\ 000\\ 000\\ 007.\n\nSample Input 1\n\n6 1\n3\n\nSample Output 1\n\n4\n\nThere are four ways to climb up the stairs, as follows:\n\n0 \\to 1 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 1 \\to 2 \\to 4 \\to 6\n\n0 \\to 2 \\to 4 \\to 5 \\to 6\n\n0 \\to 2 \\to 4 \\to 6\n\nSample Input 2\n\n10 2\n4\n5\n\nSample Output 2\n\n0\n\nThere may be no way to climb up the stairs without setting foot on the broken steps.\n\nSample Input 3\n\n100 5\n1\n23\n45\n67\n89\n\nSample Output 3\n\n608200469\n\nBe sure to print the count modulo 1\\ 000\\ 000\\ 007.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1615, "cpu_time_ms": 2108, "memory_kb": 28736}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s399967545", "group_id": "codeNet:p03017", "input_text": "module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,\"a\",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p=\"\",t(t.s=0)}([function(e,r,t){t(1)(t(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,r){function t(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=[],n=!0,o=!1,u=void 0;try{for(var i,l=e[Symbol.iterator]();!(n=(i=l.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==l.return||l.return()}finally{if(o)throw u}}return t}(e,r)||function(){throw new TypeError(\"Invalid attempt to destructure non-iterable instance\")}()}e.exports=function(e){for(var r=e.split(\"\\n\"),n=t(r[0].split(\" \").map(function(e){return Number(e)}),5),o=n[0],u=(n[1],n[2]),i=n[3],l=n[4],f=r[1].split(\"\"),c=1;c=0&&l-2=0&&l=0&&l-2=0&&l parseInt(n));\n\n // Translate to index value\n var A = Line1[1] - 1;\n var B = Line1[2] - 1;\n let C = Line1[3] - 1;\n let D = Line1[4] - 1;\n\n let S = Line[1].trim();\n\n // console.log(\"Pattern:ABDC\"); \n if (B < D && D < C) {\n\n var comma = [];\n comma3check(S, comma);\n let overtake_index = isSpace3Existing(B, C, comma);\n\n // BがCに到着するまでにAがBを追い越せないならNG\n if (overtake_index == -1) {\n console.log(\"No\");\n return;\n\n } else {\n A = overtake_index + 2;\n B = overtake_index;\n }\n \n }\n \n var rock = [];\n rock2check(S, rock);\n let A_flag = !isRockExisting(A, C, rock);\n let B_flag = !isRockExisting(B, D, rock);\n\n if (A_flag && B_flag){\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n}\n\n// 空白が連続して3つ以上あれば追い抜ける\n// 空白が連続する開始位置のインデックスを返却\n// 追い抜けないときは-1を返却\nfunction isSpace3Existing(start, end, space) {\n var overtake_index = -1;\n const result = space.some(elm => {\n overtake_index = elm;\n return(start < elm && elm <= end - 1);\n });\n return overtake_index;\n}\n\n// 岩が連続してあればtrue(通れない)\nfunction isRockExisting(start, end, rock) {\n const result = rock.some(elm => {\n return(start - 1 <= elm && elm < end - 2);\n });\n return result;\n}\n\n// 自身と次が岩であれば自身のインデックスを格納する\nfunction rock2check(S, rock){\n for (let i = 0; i < S.length - 1; i++) {\n if (S[i] == '#' && S[i + 1] == '#') {\n rock.push(i);\n }\n }\n}\n\n// 自身から3つ空白が続いたら自身のインデックスを格納する\nfunction comma3check(S, comma) {\n for (let i = 0; i < S.length - 2; i++) {\n if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {\n comma.push(i);\n }\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf-8\"));", "language": "JavaScript", "metadata": {"date": 1561053127, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/JavaScript/s535934556.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s535934556", "user_id": "u279735925"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "\"use strict\";\n\nfunction Main(input){\n let Line = input.split('\\n');\n let Line1 = Line[0].split(' ').map(n => parseInt(n));\n\n // Translate to index value\n var A = Line1[1] - 1;\n var B = Line1[2] - 1;\n let C = Line1[3] - 1;\n let D = Line1[4] - 1;\n\n let S = Line[1].trim();\n\n // console.log(\"Pattern:ABDC\"); \n if (B < D && D < C) {\n\n var comma = [];\n comma3check(S, comma);\n let overtake_index = isSpace3Existing(B, C, comma);\n\n // BがCに到着するまでにAがBを追い越せないならNG\n if (overtake_index == -1) {\n console.log(\"No\");\n return;\n\n } else {\n A = overtake_index + 2;\n B = overtake_index;\n }\n \n }\n \n var rock = [];\n rock2check(S, rock);\n let A_flag = !isRockExisting(A, C, rock);\n let B_flag = !isRockExisting(B, D, rock);\n\n if (A_flag && B_flag){\n console.log(\"Yes\");\n } else {\n console.log(\"No\");\n }\n\n}\n\n// 空白が連続して3つ以上あれば追い抜ける\n// 空白が連続する開始位置のインデックスを返却\n// 追い抜けないときは-1を返却\nfunction isSpace3Existing(start, end, space) {\n var overtake_index = -1;\n const result = space.some(elm => {\n overtake_index = elm;\n return(start < elm && elm <= end - 1);\n });\n return overtake_index;\n}\n\n// 岩が連続してあればtrue(通れない)\nfunction isRockExisting(start, end, rock) {\n const result = rock.some(elm => {\n return(start - 1 <= elm && elm < end - 2);\n });\n return result;\n}\n\n// 自身と次が岩であれば自身のインデックスを格納する\nfunction rock2check(S, rock){\n for (let i = 0; i < S.length - 1; i++) {\n if (S[i] == '#' && S[i + 1] == '#') {\n rock.push(i);\n }\n }\n}\n\n// 自身から3つ空白が続いたら自身のインデックスを格納する\nfunction comma3check(S, comma) {\n for (let i = 0; i < S.length - 2; i++) {\n if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') {\n comma.push(i);\n }\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf-8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2017, "cpu_time_ms": 59, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s041401452", "group_id": "codeNet:p03017", "input_text": "function Main(input) {\n\tlines = input.split(\"\\n\");\n\tN = parseInt(lines[0].split(' ')[0], 10);\n\tA = parseInt(lines[0].split(' ')[1], 10);\n\tB = parseInt(lines[0].split(' ')[2], 10);\n\tC = parseInt(lines[0].split(' ')[3], 10);\n\tD = parseInt(lines[0].split(' ')[4], 10);\n\tS = lines[1].split('');\n\tflag = false;\n\twhile(A !== C || B !== D) {\n\t if(S[A+1] !== '#' && A+2 !== B && A+2 <= C && A+2 <= N) { A+=2; }\n\t else if(S[A] !== '#' && A+1 !== B && A+1 <= C && A+1 <= N) { A++; }\n\t else if(S[B+1] !== '#' && B+2 !== A && B+2 <= D && B+2 <= N){ B+=2; }\n\t else if(S[B] !== '#' && B+1 !== A && B+1 <= D && B+1 <= N){ B++; }\n\t else { flag=true; break; }\n\t}\n\tflag ? console.log('No') : console.log('YES');\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1559529918, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03017.html", "problem_id": "p03017", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03017/input.txt", "sample_output_relpath": "derived/input_output/data/p03017/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03017/JavaScript/s041401452.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s041401452", "user_id": "u696046068"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(input) {\n\tlines = input.split(\"\\n\");\n\tN = parseInt(lines[0].split(' ')[0], 10);\n\tA = parseInt(lines[0].split(' ')[1], 10);\n\tB = parseInt(lines[0].split(' ')[2], 10);\n\tC = parseInt(lines[0].split(' ')[3], 10);\n\tD = parseInt(lines[0].split(' ')[4], 10);\n\tS = lines[1].split('');\n\tflag = false;\n\twhile(A !== C || B !== D) {\n\t if(S[A+1] !== '#' && A+2 !== B && A+2 <= C && A+2 <= N) { A+=2; }\n\t else if(S[A] !== '#' && A+1 !== B && A+1 <= C && A+1 <= N) { A++; }\n\t else if(S[B+1] !== '#' && B+2 !== A && B+2 <= D && B+2 <= N){ B+=2; }\n\t else if(S[B] !== '#' && B+1 !== A && B+1 <= D && B+1 <= N){ B++; }\n\t else { flag=true; break; }\n\t}\n\tflag ? console.log('No') : console.log('YES');\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "sample_input": "7 1 3 6 7\n.#..#..\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03017", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N squares arranged in a row, numbered 1, 2, ..., N from left to right.\nYou are given a string S of length N consisting of . and #. If the i-th character of S is #, Square i contains a rock; if the i-th character of S is ., Square i is empty.\n\nIn the beginning, Snuke stands on Square A, and Fnuke stands on Square B.\n\nYou can repeat the following operation any number of times:\n\nChoose Snuke or Fnuke, and make him jump one or two squares to the right. The destination must be one of the squares, and it must not contain a rock or the other person.\n\nYou want to repeat this operation so that Snuke will stand on Square C and Fnuke will stand on Square D.\n\nDetermine whether this is possible.\n\nConstraints\n\n4 \\leq N \\leq 200\\ 000\n\nS is a string of length N consisting of . and #.\n\n1 \\leq A, B, C, D \\leq N\n\nSquare A, B, C and D do not contain a rock.\n\nA, B, C and D are all different.\n\nA < B\n\nA < C\n\nB < D\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C D\nS\n\nOutput\n\nPrint Yes if the objective is achievable, and No if it is not.\n\nSample Input 1\n\n7 1 3 6 7\n.#..#..\n\nSample Output 1\n\nYes\n\nThe objective is achievable by, for example, moving the two persons as follows. (A and B represent Snuke and Fnuke, respectively.)\n\nA#B.#..\n\nA#.B#..\n\n.#AB#..\n\n.#A.#B.\n\n.#.A#B.\n\n.#.A#.B\n\n.#..#AB\n\nSample Input 2\n\n7 1 3 7 6\n.#..#..\n\nSample Output 2\n\nNo\n\nSample Input 3\n\n15 1 3 15 13\n...#.#...#.#...\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 757, "cpu_time_ms": 59, "memory_kb": 9420}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s377983911", "group_id": "codeNet:p03023", "input_text": "(function() {\nfunction Main(input) {\n lines = input.split(\"\\n\")[0] * 1\n ans = (lines - 2) * 180\n console.log(ans);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n}())\n", "language": "JavaScript", "metadata": {"date": 1559437843, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03023.html", "problem_id": "p03023", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03023/input.txt", "sample_output_relpath": "derived/input_output/data/p03023/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03023/JavaScript/s377983911.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s377983911", "user_id": "u461478706"}, "prompt_components": {"gold_output": "180\n", "input_to_evaluate": "(function() {\nfunction Main(input) {\n lines = input.split(\"\\n\")[0] * 1\n ans = (lines - 2) * 180\n console.log(ans);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n}())\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nGiven an integer N not less than 3, find the sum of the interior angles of a regular polygon with N sides.\n\nPrint the answer in degrees, but do not print units.\n\nConstraints\n\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint an integer representing the sum of the interior angles of a regular polygon with N sides.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n180\n\nThe sum of the interior angles of a regular triangle is 180 degrees.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n17640", "sample_input": "3\n"}, "reference_outputs": ["180\n"], "source_document_id": "p03023", "source_text": "Score : 100 points\n\nProblem Statement\n\nGiven an integer N not less than 3, find the sum of the interior angles of a regular polygon with N sides.\n\nPrint the answer in degrees, but do not print units.\n\nConstraints\n\n3 \\leq N \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint an integer representing the sum of the interior angles of a regular polygon with N sides.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n180\n\nThe sum of the interior angles of a regular triangle is 180 degrees.\n\nSample Input 2\n\n100\n\nSample Output 2\n\n17640", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 181, "cpu_time_ms": 242, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s300339295", "group_id": "codeNet:p03024", "input_text": "'use strict';(function(input){\n input=input.trim().split('').reduce((a,c)=>a+(c==='x'?1:0),0);\n var ans=((input<=7)?'YES':'NO');\n console.log(ans);\n})(require('fs').readFileSync('/dev/stdin','utf8'));", "language": "JavaScript", "metadata": {"date": 1559441841, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03024.html", "problem_id": "p03024", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03024/input.txt", "sample_output_relpath": "derived/input_output/data/p03024/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03024/JavaScript/s300339295.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s300339295", "user_id": "u833932983"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "'use strict';(function(input){\n input=input.trim().split('').reduce((a,c)=>a+(c==='x'?1:0),0);\n var ans=((input<=7)?'YES':'NO');\n console.log(ans);\n})(require('fs').readFileSync('/dev/stdin','utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "sample_input": "oxoxoxoxoxoxox\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03024", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 203, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s656480855", "group_id": "codeNet:p03024", "input_text": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var s = o.a(1);\n var ans = 0;\n for(var i = 0; i < s.length; i++){\n if(s[i] === \"x\")ans++;\n }\n return ans>7?\"NO\":\"YES\";\n}", "language": "JavaScript", "metadata": {"date": 1559437365, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03024.html", "problem_id": "p03024", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03024/input.txt", "sample_output_relpath": "derived/input_output/data/p03024/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03024/JavaScript/s656480855.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s656480855", "user_id": "u643613120"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(0).map(x=>{return \"+v+\";})\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\n\nconsole.log(main());\nfunction main(){\n var s = o.a(1);\n var ans = 0;\n for(var i = 0; i < s.length; i++){\n if(s[i] === \"x\")ans++;\n }\n return ans>7?\"NO\":\"YES\";\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "sample_input": "oxoxoxoxoxoxox\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03024", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi is competing in a sumo tournament.\nThe tournament lasts for 15 days, during which he performs in one match per day.\nIf he wins 8 or more matches, he can also participate in the next tournament.\n\nThe matches for the first k days have finished.\nYou are given the results of Takahashi's matches as a string S consisting of o and x.\nIf the i-th character in S is o, it means that Takahashi won the match on the i-th day; if that character is x, it means that Takahashi lost the match on the i-th day.\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO if there is no such possibility.\n\nConstraints\n\n1 \\leq k \\leq 15\n\nS is a string of length k consisting of o and x.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint YES if there is a possibility that Takahashi can participate in the next tournament, and print NO otherwise.\n\nSample Input 1\n\noxoxoxoxoxoxox\n\nSample Output 1\n\nYES\n\nTakahashi has 7 wins and 7 losses before the last match. If he wins that match, he will have 8 wins.\n\nSample Input 2\n\nxxxxxxxx\n\nSample Output 2\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 990, "cpu_time_ms": 264, "memory_kb": 22076}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s934386158", "group_id": "codeNet:p03026", "input_text": "\"use strict\";\nfunction Main(input) {\n const args = input.split('\\n');\n const N = parseInt(args.shift());\n const ns = Array(N).fill(0);\n const cs = args[N - 1].split(' ').map(m => parseInt(m)).sort((a, b) => a - b);\n const ms = [];\n const abs = [];\n for(let i = 0; i < args.length - 2; i++) {\n const ab = args[i].split(' ').map(m => parseInt(m) - 1);\n abs.push(ab);\n ns[ab[0]]++;\n ns[ab[1]]++;\n }\n let ds = [];\n ns.map((m, i) => {\n return {\n idx: i,\n count: m\n }\n })\n .sort((a, b) => a.count - b.count)\n .forEach((v, i) => ds[v.idx] = cs[i]);\n for(let ab of abs) {\n const a = ab.shift();\n const b = ab.shift();\n ms.push(ds[a] < ds[b] ? ds[a] : ds[b]);\n }\n const M = ms.reduce((p ,c) => p += c);\n console.log(M);\n console.log(ds);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1559442994, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03026.html", "problem_id": "p03026", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03026/input.txt", "sample_output_relpath": "derived/input_output/data/p03026/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03026/JavaScript/s934386158.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s934386158", "user_id": "u456515457"}, "prompt_components": {"gold_output": "10\n1 2 3 4 5\n", "input_to_evaluate": "\"use strict\";\nfunction Main(input) {\n const args = input.split('\\n');\n const N = parseInt(args.shift());\n const ns = Array(N).fill(0);\n const cs = args[N - 1].split(' ').map(m => parseInt(m)).sort((a, b) => a - b);\n const ms = [];\n const abs = [];\n for(let i = 0; i < args.length - 2; i++) {\n const ab = args[i].split(' ').map(m => parseInt(m) - 1);\n abs.push(ab);\n ns[ab[0]]++;\n ns[ab[1]]++;\n }\n let ds = [];\n ns.map((m, i) => {\n return {\n idx: i,\n count: m\n }\n })\n .sort((a, b) => a.count - b.count)\n .forEach((v, i) => ds[v.idx] = cs[i]);\n for(let ab of abs) {\n const a = ab.shift();\n const b = ab.shift();\n ms.push(ds[a] < ds[b] ? ds[a] : ds[b]);\n }\n const M = ms.reduce((p ,c) => p += c);\n console.log(M);\n console.log(ds);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 500 points\n\nProblem Statement\n\nYou are given a tree with N vertices 1,2,\\ldots,N, and positive integers c_1,c_2,\\ldots,c_N.\nThe i-th edge in the tree (1 \\leq i \\leq N-1) connects Vertex a_i and Vertex b_i.\n\nWe will write a positive integer on each vertex in T and calculate our score as follows:\n\nOn each edge, write the smaller of the integers written on the two endpoints.\n\nLet our score be the sum of the integers written on all the edges.\n\nFind the maximum possible score when we write each of c_1,c_2,\\ldots,c_N on one vertex in T, and show one way to achieve it. If an integer occurs multiple times in c_1,c_2,\\ldots,c_N, we must use it that number of times.\n\nConstraints\n\n1 \\leq N \\leq 10000\n\n1 \\leq a_i,b_i \\leq N\n\n1 \\leq c_i \\leq 10^5\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nc_1 \\ldots c_N\n\nOutput\n\nUse the following format:\n\nM\nd_1 \\ldots d_N\n\nwhere M is the maximum possible score, and d_i is the integer to write on Vertex i.\nd_1,d_2,\\ldots,d_N must be a permutation of c_1,c_2,\\ldots,c_N.\nIf there are multiple ways to achieve the maximum score, any of them will be accepted.\n\nSample Input 1\n\n5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n\nSample Output 1\n\n10\n1 2 3 4 5\n\nIf we write 1,2,3,4,5 on Vertex 1,2,3,4,5, respectively, the integers written on the four edges will be 1,2,3,4, for the score of 10. This is the maximum possible score.\n\nSample Input 2\n\n5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59\n\nSample Output 2\n\n197\n59 26 3141 59 53\n\nc_1,c_2,\\ldots,c_N may not be pairwise distinct.", "sample_input": "5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n"}, "reference_outputs": ["10\n1 2 3 4 5\n"], "source_document_id": "p03026", "source_text": "Score : 500 points\n\nProblem Statement\n\nYou are given a tree with N vertices 1,2,\\ldots,N, and positive integers c_1,c_2,\\ldots,c_N.\nThe i-th edge in the tree (1 \\leq i \\leq N-1) connects Vertex a_i and Vertex b_i.\n\nWe will write a positive integer on each vertex in T and calculate our score as follows:\n\nOn each edge, write the smaller of the integers written on the two endpoints.\n\nLet our score be the sum of the integers written on all the edges.\n\nFind the maximum possible score when we write each of c_1,c_2,\\ldots,c_N on one vertex in T, and show one way to achieve it. If an integer occurs multiple times in c_1,c_2,\\ldots,c_N, we must use it that number of times.\n\nConstraints\n\n1 \\leq N \\leq 10000\n\n1 \\leq a_i,b_i \\leq N\n\n1 \\leq c_i \\leq 10^5\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1\n:\na_{N-1} b_{N-1}\nc_1 \\ldots c_N\n\nOutput\n\nUse the following format:\n\nM\nd_1 \\ldots d_N\n\nwhere M is the maximum possible score, and d_i is the integer to write on Vertex i.\nd_1,d_2,\\ldots,d_N must be a permutation of c_1,c_2,\\ldots,c_N.\nIf there are multiple ways to achieve the maximum score, any of them will be accepted.\n\nSample Input 1\n\n5\n1 2\n2 3\n3 4\n4 5\n1 2 3 4 5\n\nSample Output 1\n\n10\n1 2 3 4 5\n\nIf we write 1,2,3,4,5 on Vertex 1,2,3,4,5, respectively, the integers written on the four edges will be 1,2,3,4, for the score of 10. This is the maximum possible score.\n\nSample Input 2\n\n5\n1 2\n1 3\n1 4\n1 5\n3141 59 26 53 59\n\nSample Output 2\n\n197\n59 26 3141 59 53\n\nc_1,c_2,\\ldots,c_N may not be pairwise distinct.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 842, "cpu_time_ms": 280, "memory_kb": 30644}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s894582932", "group_id": "codeNet:p03029", "input_text": "'use strict'\nfunction Main(input) {\n input = input.split(\" \"); \n let apple = parseInt(input[0], 10);\n let piece = parseInt(input[1], 10);\n let sum = Math.floor((apple*3 + piece)/2);\n console.log('%s',sum);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1558920289, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03029.html", "problem_id": "p03029", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03029/input.txt", "sample_output_relpath": "derived/input_output/data/p03029/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03029/JavaScript/s894582932.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s894582932", "user_id": "u649464963"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "'use strict'\nfunction Main(input) {\n input = input.split(\" \"); \n let apple = parseInt(input[0], 10);\n let piece = parseInt(input[1], 10);\n let sum = Math.floor((apple*3 + piece)/2);\n console.log('%s',sum);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe have A apples and P pieces of apple.\n\nWe can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.\n\nFind the maximum number of apple pies we can make with what we have now.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, P \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA P\n\nOutput\n\nPrint the maximum number of apple pies we can make with what we have.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n3\n\nWe can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.\n\nSample Input 2\n\n0 1\n\nSample Output 2\n\n0\n\nWe cannot make an apple pie in this case, unfortunately.\n\nSample Input 3\n\n32 21\n\nSample Output 3\n\n58", "sample_input": "1 3\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03029", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe have A apples and P pieces of apple.\n\nWe can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.\n\nFind the maximum number of apple pies we can make with what we have now.\n\nConstraints\n\nAll values in input are integers.\n\n0 \\leq A, P \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA P\n\nOutput\n\nPrint the maximum number of apple pies we can make with what we have.\n\nSample Input 1\n\n1 3\n\nSample Output 1\n\n3\n\nWe can first make one apple pie by simmering two of the three pieces of apple. Then, we can make two more by simmering the remaining piece and three more pieces obtained by cutting the whole apple.\n\nSample Input 2\n\n0 1\n\nSample Output 2\n\n0\n\nWe cannot make an apple pie in this case, unfortunately.\n\nSample Input 3\n\n32 21\n\nSample Output 3\n\n58", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 270, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s585740233", "group_id": "codeNet:p03030", "input_text": "'use strict'\nconst Main = (arg) => {\n let input = arg.trim().split('\\n');\n let N = input[0].split(' ').map(Number)[0];\n // let Arr1 = input[1].split(' ').map(Number);\n let Res = [];\n\n // 連想配列(Dictionary)に格納\n for (let i = 1; i <= N; i++) {\n Res[i - 1] = {\n souceOrder: i,\n city: input[i].split(' ')[0],\n score: parseInt(input[i].split(' ')[1]),\n printOrder: 1\n }\n }\n\n // console.log({ N, Res });\n // console.log(Res[0]);\n\n // city昇順 score降順 の順に並べ替え\n Res.sort((a, b) => {\n if (a.city < b.city) return -1;\n if (a.city > b.city) return 1;\n if (a.score < b.score) return 1;\n if (a.score > b.score) return -1;\n return 0;\n });\n // console.log({ Res });\n\n for (let i = 0; i < N; i++) {\n Res[i].printOrder = (i + 1);\n }\n\n // console.log({ Res });\n let Ans = [];\n for (let i = 0; i < N; i++) {\n Ans.push(Res[i].souceOrder);\n }\n\n\n console.log(Ans.join('\\n'));\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1577225698, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/JavaScript/s585740233.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s585740233", "user_id": "u880930934"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "'use strict'\nconst Main = (arg) => {\n let input = arg.trim().split('\\n');\n let N = input[0].split(' ').map(Number)[0];\n // let Arr1 = input[1].split(' ').map(Number);\n let Res = [];\n\n // 連想配列(Dictionary)に格納\n for (let i = 1; i <= N; i++) {\n Res[i - 1] = {\n souceOrder: i,\n city: input[i].split(' ')[0],\n score: parseInt(input[i].split(' ')[1]),\n printOrder: 1\n }\n }\n\n // console.log({ N, Res });\n // console.log(Res[0]);\n\n // city昇順 score降順 の順に並べ替え\n Res.sort((a, b) => {\n if (a.city < b.city) return -1;\n if (a.city > b.city) return 1;\n if (a.score < b.score) return 1;\n if (a.score > b.score) return -1;\n return 0;\n });\n // console.log({ Res });\n\n for (let i = 0; i < N; i++) {\n Res[i].printOrder = (i + 1);\n }\n\n // console.log({ Res });\n let Ans = [];\n for (let i = 0; i < N; i++) {\n Ans.push(Res[i].souceOrder);\n }\n\n\n console.log(Ans.join('\\n'));\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1010, "cpu_time_ms": 55, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s156227910", "group_id": "codeNet:p03030", "input_text": "function Main(input) {\n\n\tinput = input.split(\"\\n\");\n\tvar N = parseInt(input[0]);\n\tvar lists = [];\n\t\n\tfunction List(name,score,num){\n\t this.name = name;\n\t this.score = score;\n\t this.num = num;\n\t}\n\t\n\tList.prototype.show = function(){\n\t return this.num;\n\t}\n\t\n\tfor(var i = 0;i < N;i++){\n\t pass = input[i+1].split(\" \");\n\t lists[i] = new List(pass[0],parseInt(pass[1]),i+1);\n\t}\n\t\n lists.sort((a,b) => { return (a.score < b.score)? 1 : -1; });\n lists.sort((a,b) => { return (a.name > b.name)? 1 : -1; });\n \n for(var j = 0;j < N;j++){\n console.log(lists[j].show());\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1562125601, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/JavaScript/s156227910.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s156227910", "user_id": "u685568861"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "function Main(input) {\n\n\tinput = input.split(\"\\n\");\n\tvar N = parseInt(input[0]);\n\tvar lists = [];\n\t\n\tfunction List(name,score,num){\n\t this.name = name;\n\t this.score = score;\n\t this.num = num;\n\t}\n\t\n\tList.prototype.show = function(){\n\t return this.num;\n\t}\n\t\n\tfor(var i = 0;i < N;i++){\n\t pass = input[i+1].split(\" \");\n\t lists[i] = new List(pass[0],parseInt(pass[1]),i+1);\n\t}\n\t\n lists.sort((a,b) => { return (a.score < b.score)? 1 : -1; });\n lists.sort((a,b) => { return (a.name > b.name)? 1 : -1; });\n \n for(var j = 0;j < N;j++){\n console.log(lists[j].show());\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 660, "cpu_time_ms": 56, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s082168573", "group_id": "codeNet:p03030", "input_text": "'use strict';\n(function(input){\n input=input.trim().split(/\\n+/);\n input=input.map((str,i)=>str.split(/\\s+/).concat(i));\n input.shift();\n input.sort(function(a,b){\n if([a[0],b[0]].sort()[0]===a[0]){\n if(a[0]!==b[0])\n return -1;\n else\n return -(a[1]-b[1])\n }else return +1;\n });\n console.log(input.map(a=>a[2]).join('\\n').trim());\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "language": "JavaScript", "metadata": {"date": 1559094450, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/JavaScript/s082168573.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s082168573", "user_id": "u833932983"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "'use strict';\n(function(input){\n input=input.trim().split(/\\n+/);\n input=input.map((str,i)=>str.split(/\\s+/).concat(i));\n input.shift();\n input.sort(function(a,b){\n if([a[0],b[0]].sort()[0]===a[0]){\n if(a[0]!==b[0])\n return -1;\n else\n return -(a[1]-b[1])\n }else return +1;\n });\n console.log(input.map(a=>a[2]).join('\\n').trim());\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 419, "cpu_time_ms": 56, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s016953993", "group_id": "codeNet:p03030", "input_text": "'use strict'\n\nconst main = (INPUT) => {\n let input = INPUT.split('\\n')\n const N = input[0]\n input.shift()\n let ary = input.map(v => v.split(' '))\n ary.sort((a, b) => {\n if (a[0] > b[0]) return 1\n if (a[0] < b[0]) return -1\n if (Number(a[1]) > Number(b[1])) return -1\n if (Number(a[1]) < Number(b[1])) return 1\n })\n\n ary = ary.map(v => v.join(' '))\n\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n if (ary[i] == input[j]) {\n console.log(j + 1)\n break\n }\n }\n }\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1558924041, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03030.html", "problem_id": "p03030", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03030/input.txt", "sample_output_relpath": "derived/input_output/data/p03030/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03030/JavaScript/s016953993.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s016953993", "user_id": "u107881102"}, "prompt_components": {"gold_output": "3\n4\n6\n1\n5\n2\n", "input_to_evaluate": "'use strict'\n\nconst main = (INPUT) => {\n let input = INPUT.split('\\n')\n const N = input[0]\n input.shift()\n let ary = input.map(v => v.split(' '))\n ary.sort((a, b) => {\n if (a[0] > b[0]) return 1\n if (a[0] < b[0]) return -1\n if (Number(a[1]) > Number(b[1])) return -1\n if (Number(a[1]) < Number(b[1])) return 1\n })\n\n ary = ary.map(v => v.join(' '))\n\n for (let i = 0; i < N; i++) {\n for (let j = 0; j < N; j++) {\n if (ary[i] == input[j]) {\n console.log(j + 1)\n break\n }\n }\n }\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "sample_input": "6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n"}, "reference_outputs": ["3\n4\n6\n1\n5\n2\n"], "source_document_id": "p03030", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou have decided to write a book introducing good restaurants.\nThere are N restaurants that you want to introduce: Restaurant 1, Restaurant 2, ..., Restaurant N. Restaurant i is in city S_i, and your assessment score of that restaurant on a 100-point scale is P_i.\nNo two restaurants have the same score.\n\nYou want to introduce the restaurants in the following order:\n\nThe restaurants are arranged in lexicographical order of the names of their cities.\n\nIf there are multiple restaurants in the same city, they are arranged in descending order of score.\n\nPrint the identification numbers of the restaurants in the order they are introduced in the book.\n\nConstraints\n\n1 ≤ N ≤ 100\n\nS is a string of length between 1 and 10 (inclusive) consisting of lowercase English letters.\n\n0 ≤ P_i ≤ 100\n\nP_i is an integer.\n\nP_i ≠ P_j (1 ≤ i < j ≤ N)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS_1 P_1\n:\nS_N P_N\n\nOutput\n\nPrint N lines. The i-th line (1 ≤ i ≤ N) should contain the identification number of the restaurant that is introduced i-th in the book.\n\nSample Input 1\n\n6\nkhabarovsk 20\nmoscow 10\nkazan 50\nkazan 35\nmoscow 60\nkhabarovsk 40\n\nSample Output 1\n\n3\n4\n6\n1\n5\n2\n\nThe lexicographical order of the names of the three cities is kazan < khabarovsk < moscow. For each of these cities, the restaurants in it are introduced in descending order of score. Thus, the restaurants are introduced in the order 3,4,6,1,5,2.\n\nSample Input 2\n\n10\nyakutsk 10\nyakutsk 20\nyakutsk 30\nyakutsk 40\nyakutsk 50\nyakutsk 60\nyakutsk 70\nyakutsk 80\nyakutsk 90\nyakutsk 100\n\nSample Output 2\n\n10\n9\n8\n7\n6\n5\n4\n3\n2\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 583, "cpu_time_ms": 62, "memory_kb": 8184}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s467376994", "group_id": "codeNet:p03031", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n // 1行目がinput[0], 2行目がinput[1], …に入る\n input = input.split(\"\\n\");\n tmp0 = input[0].split(\" \");\n N = Number(tmp0[0]);\n M = Number(tmp0[1])\n\n var s = {}\n for(var i=1; i <= M; i++)\n {\n var tmp = input[i].split(\" \")\n var k = Number(tmp[0])\n var val = 0\n for(var j=1; j <= k; j++)\n {\n val += Math.pow(2,Number(tmp[j])-1)\n }\n // console.log((Array(N).join('0') + val.toString(2)).slice(-N))\n lamp_switch = val\n s[i] = lamp_switch\n }\n var tmpp = input[M+1].split(\" \")\n \n var ans =0\n for(var j=0; j node.key) {\n node.right = this._eraseRec(node.right, key);\n return node;\n }\n\n if (null == node.left && null == node.right) return null;\n\n if ((node.left ? node.left.priority : -1) > (node.right ? node.right.priority : -1)) {\n var newParent = node.left;\n var npRightChild = newParent.right;\n node.left = npRightChild;\n newParent.right = this._eraseRec(node, key);\n if (newParent.right && newParent.right.priority > newParent.priority) return this._rotateLeft(newParent);else return newParent;\n } else {\n var _newParent = node.right;\n var npLeftChild = _newParent.left;\n node.right = npLeftChild;\n _newParent.left = this._eraseRec(node, key);\n if (_newParent.left && _newParent.left.priority > _newParent.priority) return this._rotateRight(_newParent);else return _newParent;\n }\n }\n }, {\n key: \"_find\",\n value: function _find(value) {\n var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.root;\n if (null == root) return null;\n if (root.value === value) return root;\n if (value < root.value) return this._find(value, root.left);else return this._find(value, root.right);\n }\n }]);\n\n return Treap;\n }();\n\n !function () {\n function splitNum(line) {\n return (Array.isArray(line) ? line : line.split(/\\s+/)).map(function (n) {\n return parseInt(n);\n });\n }\n\n function sortByKey(arr, keys) {\n if (!Array.isArray(keys)) keys = [keys];\n return arr.sort(function (a, b) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var k = _step.value;\n\n if (\"string\" == typeof k) {\n var d = a[k] - b[k];\n if (0 !== d) return d;\n } else {\n var _d = a[k[0]] - b[k[0]];\n\n var sig = \"desc\" === k[1] ? -1 : \"asc\" === k[1] ? 1 : Number(k[1]);\n if (0 !== _d) return _d * sig;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return 0;\n });\n }\n\n !function (input) {\n var lines = input.split(\"\\n\");\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 2),\n N = _splitNum2[0],\n Q = _splitNum2[1];\n\n var kouji = lines.slice(1, N + 1).map(function (line, i) {\n var _splitNum3 = splitNum(line),\n _splitNum4 = _slicedToArray(_splitNum3, 3),\n S = _splitNum4[0],\n T = _splitNum4[1],\n X = _splitNum4[2];\n\n return {\n i: i,\n S: S,\n T: T,\n X: X,\n startTime: S - X - .5,\n endTime: T - X - .6\n };\n });\n var D = splitNum(lines.slice(N + 1)).slice(0, Q);\n var events = [];\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = kouji[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _step2$value = _step2.value,\n X = _step2$value.X,\n startTime = _step2$value.startTime,\n endTime = _step2$value.endTime;\n events.push({\n type: \"add\",\n time: startTime,\n X: X\n }, {\n type: \"delete\",\n time: endTime,\n X: X\n });\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var dindex = 0;\n sortByKey(events, [\"time\"]);\n var set = new Treap();\n\n for (var _i2 = 0; _i2 < events.length; _i2++) {\n var _events$_i = events[_i2],\n type = _events$_i.type,\n time = _events$_i.time,\n X = _events$_i.X;\n\n for (; dindex < D.length && time > D[dindex];) {\n var _stop = set.min();\n\n console.log(null == _stop ? -1 : _stop);\n dindex++;\n }\n\n if (\"add\" === type) set.insert(X);else if (\"delete\" === type) set.erase(X);\n }\n\n for (; dindex < D.length; dindex++) {\n var stop = set.min();\n console.log(null == stop ? -1 : stop);\n }\n }(fs.readFileSync(\"/dev/stdin\", \"utf8\"));\n }();\n}(require(\"fs\"));\n", "language": "JavaScript", "metadata": {"date": 1560666499, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03033.html", "problem_id": "p03033", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03033/input.txt", "sample_output_relpath": "derived/input_output/data/p03033/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03033/JavaScript/s163949223.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s163949223", "user_id": "u251786347"}, "prompt_components": {"gold_output": "2\n2\n10\n-1\n13\n-1\n", "input_to_evaluate": "\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n!function (fs) {\n \"use strict\";\n\n var Treap =\n /*#__PURE__*/\n function () {\n function Treap(getSortKey) {\n _classCallCheck(this, Treap);\n\n this.getSortKey = getSortKey || function (x) {\n return x;\n };\n\n this.root = null;\n }\n\n _createClass(Treap, [{\n key: \"insert\",\n value: function insert(value) {\n var priority = Math.random();\n var node = {\n value: value,\n key: this.getSortKey(value),\n priority: priority,\n left: null,\n right: null\n };\n this.root = this._insertRec(this.root, node);\n }\n }, {\n key: \"erase\",\n value: function erase(value) {\n var key = this.getSortKey(value);\n this.root = this._eraseRec(this.root, key);\n }\n }, {\n key: \"contains\",\n value: function contains(value) {\n return null != this._find(value);\n }\n }, {\n key: \"min\",\n value: function min() {\n var root = this.root;\n\n for (; null != root;) {\n if (null == root.left) return root.value;\n root = root.left;\n }\n\n return null;\n }\n }, {\n key: \"_insertRec\",\n value: function _insertRec(target, node) {\n if (null == target) return node;\n if (node.key === target.key) return target;else if (node.key < target.key) {\n var newChild = this._insertRec(target.left, node);\n\n target.left = newChild;\n if (newChild.priority < target.priority) return target;else return this._rotateRight(target);\n } else {\n var _newChild = this._insertRec(target.right, node);\n\n target.right = _newChild;\n if (_newChild.priority < target.priority) return target;else return this._rotateLeft(target);\n }\n }\n }, {\n key: \"_rotateRight\",\n value: function _rotateRight(parent) {\n var child = parent.left;\n if (null == child) return parent;\n parent.left = child.right;\n child.right = parent;\n return child;\n }\n }, {\n key: \"_rotateLeft\",\n value: function _rotateLeft(parent) {\n var child = parent.right;\n if (null == child) return parent;\n parent.right = child.left;\n child.left = parent;\n return child;\n }\n }, {\n key: \"_eraseRec\",\n value: function _eraseRec(node, key) {\n if (null == node) return null;\n\n if (key < node.key) {\n node.left = this._eraseRec(node.left, key);\n return node;\n } else if (key > node.key) {\n node.right = this._eraseRec(node.right, key);\n return node;\n }\n\n if (null == node.left && null == node.right) return null;\n\n if ((node.left ? node.left.priority : -1) > (node.right ? node.right.priority : -1)) {\n var newParent = node.left;\n var npRightChild = newParent.right;\n node.left = npRightChild;\n newParent.right = this._eraseRec(node, key);\n if (newParent.right && newParent.right.priority > newParent.priority) return this._rotateLeft(newParent);else return newParent;\n } else {\n var _newParent = node.right;\n var npLeftChild = _newParent.left;\n node.right = npLeftChild;\n _newParent.left = this._eraseRec(node, key);\n if (_newParent.left && _newParent.left.priority > _newParent.priority) return this._rotateRight(_newParent);else return _newParent;\n }\n }\n }, {\n key: \"_find\",\n value: function _find(value) {\n var root = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.root;\n if (null == root) return null;\n if (root.value === value) return root;\n if (value < root.value) return this._find(value, root.left);else return this._find(value, root.right);\n }\n }]);\n\n return Treap;\n }();\n\n !function () {\n function splitNum(line) {\n return (Array.isArray(line) ? line : line.split(/\\s+/)).map(function (n) {\n return parseInt(n);\n });\n }\n\n function sortByKey(arr, keys) {\n if (!Array.isArray(keys)) keys = [keys];\n return arr.sort(function (a, b) {\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var k = _step.value;\n\n if (\"string\" == typeof k) {\n var d = a[k] - b[k];\n if (0 !== d) return d;\n } else {\n var _d = a[k[0]] - b[k[0]];\n\n var sig = \"desc\" === k[1] ? -1 : \"asc\" === k[1] ? 1 : Number(k[1]);\n if (0 !== _d) return _d * sig;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return 0;\n });\n }\n\n !function (input) {\n var lines = input.split(\"\\n\");\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 2),\n N = _splitNum2[0],\n Q = _splitNum2[1];\n\n var kouji = lines.slice(1, N + 1).map(function (line, i) {\n var _splitNum3 = splitNum(line),\n _splitNum4 = _slicedToArray(_splitNum3, 3),\n S = _splitNum4[0],\n T = _splitNum4[1],\n X = _splitNum4[2];\n\n return {\n i: i,\n S: S,\n T: T,\n X: X,\n startTime: S - X - .5,\n endTime: T - X - .6\n };\n });\n var D = splitNum(lines.slice(N + 1)).slice(0, Q);\n var events = [];\n var _iteratorNormalCompletion2 = true;\n var _didIteratorError2 = false;\n var _iteratorError2 = undefined;\n\n try {\n for (var _iterator2 = kouji[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n var _step2$value = _step2.value,\n X = _step2$value.X,\n startTime = _step2$value.startTime,\n endTime = _step2$value.endTime;\n events.push({\n type: \"add\",\n time: startTime,\n X: X\n }, {\n type: \"delete\",\n time: endTime,\n X: X\n });\n }\n } catch (err) {\n _didIteratorError2 = true;\n _iteratorError2 = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion2 && _iterator2.return != null) {\n _iterator2.return();\n }\n } finally {\n if (_didIteratorError2) {\n throw _iteratorError2;\n }\n }\n }\n\n var dindex = 0;\n sortByKey(events, [\"time\"]);\n var set = new Treap();\n\n for (var _i2 = 0; _i2 < events.length; _i2++) {\n var _events$_i = events[_i2],\n type = _events$_i.type,\n time = _events$_i.time,\n X = _events$_i.X;\n\n for (; dindex < D.length && time > D[dindex];) {\n var _stop = set.min();\n\n console.log(null == _stop ? -1 : _stop);\n dindex++;\n }\n\n if (\"add\" === type) set.insert(X);else if (\"delete\" === type) set.erase(X);\n }\n\n for (; dindex < D.length; dindex++) {\n var stop = set.min();\n console.log(null == stop ? -1 : stop);\n }\n }(fs.readFileSync(\"/dev/stdin\", \"utf8\"));\n }();\n}(require(\"fs\"));\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is an infinitely long street that runs west to east, which we consider as a number line.\n\nThere are N roadworks scheduled on this street.\nThe i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.\n\nQ people are standing at coordinate 0. The i-th person will start the coordinate 0 at time D_i, continue to walk with speed 1 in the positive direction and stop walking when reaching a blocked point.\n\nFind the distance each of the Q people will walk.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q \\leq 2 \\times 10^5\n\n0 \\leq S_i < T_i \\leq 10^9\n\n1 \\leq X_i \\leq 10^9\n\n0 \\leq D_1 < D_2 < ... < D_Q \\leq 10^9\n\nIf i \\neq j and X_i = X_j, the intervals [S_i, T_i) and [S_j, T_j) do not overlap.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS_1 T_1 X_1\n:\nS_N T_N X_N\nD_1\n:\nD_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the distance the i-th person will walk or -1 if that person walks forever.\n\nSample Input 1\n\n4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n\nSample Output 1\n\n2\n2\n10\n-1\n13\n-1\n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate 2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at time 3. The first roadwork has ended, but the fourth roadwork has begun, so this person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they walk forever. The output for these cases is -1.", "sample_input": "4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n"}, "reference_outputs": ["2\n2\n10\n-1\n13\n-1\n"], "source_document_id": "p03033", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is an infinitely long street that runs west to east, which we consider as a number line.\n\nThere are N roadworks scheduled on this street.\nThe i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.\n\nQ people are standing at coordinate 0. The i-th person will start the coordinate 0 at time D_i, continue to walk with speed 1 in the positive direction and stop walking when reaching a blocked point.\n\nFind the distance each of the Q people will walk.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q \\leq 2 \\times 10^5\n\n0 \\leq S_i < T_i \\leq 10^9\n\n1 \\leq X_i \\leq 10^9\n\n0 \\leq D_1 < D_2 < ... < D_Q \\leq 10^9\n\nIf i \\neq j and X_i = X_j, the intervals [S_i, T_i) and [S_j, T_j) do not overlap.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS_1 T_1 X_1\n:\nS_N T_N X_N\nD_1\n:\nD_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the distance the i-th person will walk or -1 if that person walks forever.\n\nSample Input 1\n\n4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n\nSample Output 1\n\n2\n2\n10\n-1\n13\n-1\n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate 2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at time 3. The first roadwork has ended, but the fourth roadwork has begun, so this person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they walk forever. The output for these cases is -1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 9183, "cpu_time_ms": 2112, "memory_kb": 115196}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s378066143", "group_id": "codeNet:p03033", "input_text": "\"use strict\";\nfunction I(t,i){this._s=t.split(\"\\n\"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(\" \"),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(\" \").map(t||this._f)},module.exports=I;\n\nfunction main(input) {\n var o = new I(input);\n\n var n = o.a();\n var q = o.a();\n\n var s = [], t = [], x = [];\n for ( var i = 0; i < n; i++ ) {\n s.push(o.a());\n t.push(o.a());\n x.push(o.a());\n }\n\n var d = [];\n for ( var i = 0; i < q; i++ ) {\n d.push(o.a());\n }\n\n var arr = [];\n arr.push({s: -Infinity, t: -Infinity, x: Infinity});\n\n var temp = [];\n for (var i = 0; i < n; i++) {\n temp.push(s[i] - x[i]);\n temp.push(t[i] - x[i]);\n }\n\n temp.sort((a, b) => a - b);\n for (var i = 0; i < temp.length - 1; i++) {\n if (temp[i] !== temp[i+1]) {\n arr.push({s: temp[i], t: temp[i + 1], x: Infinity});\n }\n }\n arr.push({s: Infinity, t: Infinity, x: Infinity});\n\n var temp = [];\n for ( var i = 0; i < n; i++ ) {\n temp.push({s: s[i] - x[i], t:t[i] - x[i], x:x[i]});\n }\n temp.sort((a, b) => a.x - b.x);\n\n for (var i = 0; i < temp.length; i++) {\n var low = 0, high = arr.length - 1;\n while (low < high - 1) {\n var mid = Math.floor((low + high) / 2);\n if (temp[i].s < arr[mid].s) {\n high = mid;\n } else {\n low = mid;\n }\n }\n var cur = low;\n // console.log({cur, arr, temp:temp[i]})\n while (arr[cur].t <= temp[i].t) {\n if (arr[cur].x > temp[i].x) arr[cur].x = temp[i].x;\n cur += 1;\n }\n }\n // console.log({arr});\n\n for (var i = 0; i < q; i++) {\n var low = 0, high = arr.length - 1;\n while (low < high - 1) {\n var mid = Math.floor((low + high) / 2);\n if (d[i] < arr[mid].s) {\n high = mid;\n } else {\n low = mid;\n }\n }\n\n // console.log({di: d[i], low})\n if (arr[low].t >= d[i]) {\n if (Number.isFinite(arr[low].x)) {\n console.log(arr[low].x);\n } else {\n console.log(-1);\n }\n } else {\n console.log(-1);\n }\n }\n // console.log({n, q, s, t, x, d})\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1558924248, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03033.html", "problem_id": "p03033", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03033/input.txt", "sample_output_relpath": "derived/input_output/data/p03033/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03033/JavaScript/s378066143.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s378066143", "user_id": "u439911726"}, "prompt_components": {"gold_output": "2\n2\n10\n-1\n13\n-1\n", "input_to_evaluate": "\"use strict\";\nfunction I(t,i){this._s=t.split(\"\\n\"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(\" \"),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(\" \").map(t||this._f)},module.exports=I;\n\nfunction main(input) {\n var o = new I(input);\n\n var n = o.a();\n var q = o.a();\n\n var s = [], t = [], x = [];\n for ( var i = 0; i < n; i++ ) {\n s.push(o.a());\n t.push(o.a());\n x.push(o.a());\n }\n\n var d = [];\n for ( var i = 0; i < q; i++ ) {\n d.push(o.a());\n }\n\n var arr = [];\n arr.push({s: -Infinity, t: -Infinity, x: Infinity});\n\n var temp = [];\n for (var i = 0; i < n; i++) {\n temp.push(s[i] - x[i]);\n temp.push(t[i] - x[i]);\n }\n\n temp.sort((a, b) => a - b);\n for (var i = 0; i < temp.length - 1; i++) {\n if (temp[i] !== temp[i+1]) {\n arr.push({s: temp[i], t: temp[i + 1], x: Infinity});\n }\n }\n arr.push({s: Infinity, t: Infinity, x: Infinity});\n\n var temp = [];\n for ( var i = 0; i < n; i++ ) {\n temp.push({s: s[i] - x[i], t:t[i] - x[i], x:x[i]});\n }\n temp.sort((a, b) => a.x - b.x);\n\n for (var i = 0; i < temp.length; i++) {\n var low = 0, high = arr.length - 1;\n while (low < high - 1) {\n var mid = Math.floor((low + high) / 2);\n if (temp[i].s < arr[mid].s) {\n high = mid;\n } else {\n low = mid;\n }\n }\n var cur = low;\n // console.log({cur, arr, temp:temp[i]})\n while (arr[cur].t <= temp[i].t) {\n if (arr[cur].x > temp[i].x) arr[cur].x = temp[i].x;\n cur += 1;\n }\n }\n // console.log({arr});\n\n for (var i = 0; i < q; i++) {\n var low = 0, high = arr.length - 1;\n while (low < high - 1) {\n var mid = Math.floor((low + high) / 2);\n if (d[i] < arr[mid].s) {\n high = mid;\n } else {\n low = mid;\n }\n }\n\n // console.log({di: d[i], low})\n if (arr[low].t >= d[i]) {\n if (Number.isFinite(arr[low].x)) {\n console.log(arr[low].x);\n } else {\n console.log(-1);\n }\n } else {\n console.log(-1);\n }\n }\n // console.log({n, q, s, t, x, d})\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is an infinitely long street that runs west to east, which we consider as a number line.\n\nThere are N roadworks scheduled on this street.\nThe i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.\n\nQ people are standing at coordinate 0. The i-th person will start the coordinate 0 at time D_i, continue to walk with speed 1 in the positive direction and stop walking when reaching a blocked point.\n\nFind the distance each of the Q people will walk.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q \\leq 2 \\times 10^5\n\n0 \\leq S_i < T_i \\leq 10^9\n\n1 \\leq X_i \\leq 10^9\n\n0 \\leq D_1 < D_2 < ... < D_Q \\leq 10^9\n\nIf i \\neq j and X_i = X_j, the intervals [S_i, T_i) and [S_j, T_j) do not overlap.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS_1 T_1 X_1\n:\nS_N T_N X_N\nD_1\n:\nD_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the distance the i-th person will walk or -1 if that person walks forever.\n\nSample Input 1\n\n4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n\nSample Output 1\n\n2\n2\n10\n-1\n13\n-1\n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate 2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at time 3. The first roadwork has ended, but the fourth roadwork has begun, so this person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they walk forever. The output for these cases is -1.", "sample_input": "4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n"}, "reference_outputs": ["2\n2\n10\n-1\n13\n-1\n"], "source_document_id": "p03033", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is an infinitely long street that runs west to east, which we consider as a number line.\n\nThere are N roadworks scheduled on this street.\nThe i-th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5.\n\nQ people are standing at coordinate 0. The i-th person will start the coordinate 0 at time D_i, continue to walk with speed 1 in the positive direction and stop walking when reaching a blocked point.\n\nFind the distance each of the Q people will walk.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, Q \\leq 2 \\times 10^5\n\n0 \\leq S_i < T_i \\leq 10^9\n\n1 \\leq X_i \\leq 10^9\n\n0 \\leq D_1 < D_2 < ... < D_Q \\leq 10^9\n\nIf i \\neq j and X_i = X_j, the intervals [S_i, T_i) and [S_j, T_j) do not overlap.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\nS_1 T_1 X_1\n:\nS_N T_N X_N\nD_1\n:\nD_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the distance the i-th person will walk or -1 if that person walks forever.\n\nSample Input 1\n\n4 6\n1 3 2\n7 13 10\n18 20 13\n3 4 2\n0\n1\n2\n3\n5\n8\n\nSample Output 1\n\n2\n2\n10\n-1\n13\n-1\n\nThe first person starts coordinate 0 at time 0 and stops walking at coordinate 2 when reaching a point blocked by the first roadwork at time 2.\n\nThe second person starts coordinate 0 at time 1 and reaches coordinate 2 at time 3. The first roadwork has ended, but the fourth roadwork has begun, so this person also stops walking at coordinate 2.\n\nThe fourth and sixth persons encounter no roadworks while walking, so they walk forever. The output for these cases is -1.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2285, "cpu_time_ms": 2113, "memory_kb": 141608}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s338143631", "group_id": "codeNet:p03035", "input_text": "function Main(input) {\n\tinput = input.split(\" \");\n var A = parseInt(input[0], 10);\n var B = parseInt(input[1], 10);\n var result;\n\n if(13<=A && A<=100) {\n result = B;\n console.log(result);\n } else if (6<=A && A<=12){\n result = B/2; \n console.log(result);\n } else if (0<=A && A<=5) {\n result = 0;\n console.log(result);\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "language": "JavaScript", "metadata": {"date": 1559707407, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03035.html", "problem_id": "p03035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03035/input.txt", "sample_output_relpath": "derived/input_output/data/p03035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03035/JavaScript/s338143631.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s338143631", "user_id": "u417710475"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "function Main(input) {\n\tinput = input.split(\" \");\n var A = parseInt(input[0], 10);\n var B = parseInt(input[1], 10);\n var result;\n\n if(13<=A && A<=100) {\n result = B;\n console.log(result);\n } else if (6<=A && A<=12){\n result = B/2; \n console.log(result);\n } else if (0<=A && A<=5) {\n result = 0;\n console.log(result);\n }\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "sample_input": "30 100\n"}, "reference_outputs": ["100\n"], "source_document_id": "p03035", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 412, "cpu_time_ms": 57, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s917123228", "group_id": "codeNet:p03035", "input_text": "function Main(input) {\n\t\n input = input.split(\" \");\n \n var a = parseInt(input[0],10);\n var b = parseInt(input[1],10);\n var res;\n\n if(a >= 13){\n res = b;\n }\n if(a >= 6 && a <= 12){\n res = b / 2;\n }\n if(a <= 5){\n res = 0;\n }\n console.log(res);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1558835623, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03035.html", "problem_id": "p03035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03035/input.txt", "sample_output_relpath": "derived/input_output/data/p03035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03035/JavaScript/s917123228.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s917123228", "user_id": "u803040570"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "function Main(input) {\n\t\n input = input.split(\" \");\n \n var a = parseInt(input[0],10);\n var b = parseInt(input[1],10);\n var res;\n\n if(a >= 13){\n res = b;\n }\n if(a >= 6 && a <= 12){\n res = b / 2;\n }\n if(a <= 5){\n res = 0;\n }\n console.log(res);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "sample_input": "30 100\n"}, "reference_outputs": ["100\n"], "source_document_id": "p03035", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 356, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s678125516", "group_id": "codeNet:p03035", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.split(\"\\n\");\n const A = parseInt(arg[0].split(\" \")[0]);\n const B = parseInt(arg[0].split(\" \")[1]);\n \n if(A >= 13) {\n console.log(B);\n } else if(13 > A && A >= 6) {\n console.log(B / 2);\n } else {\n console.log(0);\n }\n \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1558832570, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03035.html", "problem_id": "p03035", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03035/input.txt", "sample_output_relpath": "derived/input_output/data/p03035/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03035/JavaScript/s678125516.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s678125516", "user_id": "u598795006"}, "prompt_components": {"gold_output": "100\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.split(\"\\n\");\n const A = parseInt(arg[0].split(\" \")[0]);\n const B = parseInt(arg[0].split(\" \")[1]);\n \n if(A >= 13) {\n console.log(B);\n } else if(13 > A && A >= 6) {\n console.log(B / 2);\n } else {\n console.log(0);\n }\n \n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "sample_input": "30 100\n"}, "reference_outputs": ["100\n"], "source_document_id": "p03035", "source_text": "Score : 100 points\n\nProblem Statement\n\nTakahashi, who is A years old, is riding a Ferris wheel.\n\nIt costs B yen (B is an even number) to ride the Ferris wheel if you are 13 years old or older, but children between 6 and 12 years old (inclusive) can ride it for half the cost, and children who are 5 years old or younger are free of charge. (Yen is the currency of Japan.)\n\nFind the cost of the Ferris wheel for Takahashi.\n\nConstraints\n\n0 ≤ A ≤ 100\n\n2 ≤ B ≤ 1000\n\nB is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the cost of the Ferris wheel for Takahashi.\n\nSample Input 1\n\n30 100\n\nSample Output 1\n\n100\n\nTakahashi is 30 years old now, and the cost of the Ferris wheel is 100 yen.\n\nSample Input 2\n\n12 100\n\nSample Output 2\n\n50\n\nTakahashi is 12 years old, and the cost of the Ferris wheel is the half of 100 yen, that is, 50 yen.\n\nSample Input 3\n\n0 100\n\nSample Output 3\n\n0\n\nTakahashi is 0 years old, and he can ride the Ferris wheel for free.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 374, "cpu_time_ms": 663, "memory_kb": 22080}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s650249729", "group_id": "codeNet:p03036", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n \n input = input.split(\" \");\n var r= parseInt(input[0], 10);\n var D= parseInt(input[1], 10);\n var X= parseInt(input[2], 10);\n \n var c = [];\nfor (var i = 0; i <10 ; i++){\n var X = r * X - D;\n console.log(X)\n c[i] = X;}\n \n \n \n \n \n}\n \n \n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n ", "language": "JavaScript", "metadata": {"date": 1567300431, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03036.html", "problem_id": "p03036", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03036/input.txt", "sample_output_relpath": "derived/input_output/data/p03036/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03036/JavaScript/s650249729.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s650249729", "user_id": "u362031378"}, "prompt_components": {"gold_output": "30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n \n input = input.split(\" \");\n var r= parseInt(input[0], 10);\n var D= parseInt(input[1], 10);\n var X= parseInt(input[2], 10);\n \n var c = [];\nfor (var i = 0; i <10 ; i++){\n var X = r * X - D;\n console.log(X)\n c[i] = X;}\n \n \n \n \n \n}\n \n \n //*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n ", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "sample_input": "2 10 20\n"}, "reference_outputs": ["30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n"], "source_document_id": "p03036", "source_text": "Score : 200 points\n\nProblem Statement\n\nThe development of algae in a pond is as follows.\n\nLet the total weight of the algae at the beginning of the year i be x_i gram. For i≥2000, the following formula holds:\n\nx_{i+1} = rx_i - D\n\nYou are given r, D and x_{2000}. Calculate x_{2001}, ..., x_{2010} and print them in order.\n\nConstraints\n\n2 ≤ r ≤ 5\n\n1 ≤ D ≤ 100\n\nD < x_{2000} ≤ 200\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nr D x_{2000}\n\nOutput\n\nPrint 10 lines. The i-th line (1 ≤ i ≤ 10) should contain x_{2000+i} as an integer.\n\nSample Input 1\n\n2 10 20\n\nSample Output 1\n\n30\n50\n90\n170\n330\n650\n1290\n2570\n5130\n10250\n\nFor example, x_{2001} = rx_{2000} - D = 2 \\times 20 - 10 = 30 and x_{2002} = rx_{2001} - D = 2 \\times 30 - 10 = 50.\n\nSample Input 2\n\n4 40 60\n\nSample Output 2\n\n200\n760\n3000\n11960\n47800\n191160\n764600\n3058360\n12233400\n48933560", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 543, "cpu_time_ms": 195, "memory_kb": 21320}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s001234015", "group_id": "codeNet:p03037", "input_text": "function Main(input) {\n var N = parseInt(input.split(\"\\n\")[0].split(\" \")[0]);//IDカード\n var M = parseInt(input.split(\"\\n\")[0].split(\" \")[1]);//ゲート\n var left = 1;\n var right = N;\n \n for(var i = 1; i <= M; i++){\n var tmp = input.split(\"\\n\")[i].split(\" \").map((tmp)=>Number(tmp));\n var tmpMin = tmp[0];\n var tmpMax = tmp[1];\n left = Math.max(tmpMin,left);\n right = Math.min(tmpMax,right);\n }\n \n console.log(Math.max((right - left + 1),0));\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1567041186, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03037/input.txt", "sample_output_relpath": "derived/input_output/data/p03037/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03037/JavaScript/s001234015.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s001234015", "user_id": "u222822036"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n var N = parseInt(input.split(\"\\n\")[0].split(\" \")[0]);//IDカード\n var M = parseInt(input.split(\"\\n\")[0].split(\" \")[1]);//ゲート\n var left = 1;\n var right = N;\n \n for(var i = 1; i <= M; i++){\n var tmp = input.split(\"\\n\")[i].split(\" \").map((tmp)=>Number(tmp));\n var tmpMin = tmp[0];\n var tmpMax = tmp[1];\n left = Math.max(tmpMin,left);\n right = Math.min(tmpMax,right);\n }\n \n console.log(Math.max((right - left + 1),0));\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "sample_input": "4 2\n1 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03037", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 536, "cpu_time_ms": 2109, "memory_kb": 50508}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s444268838", "group_id": "codeNet:p03037", "input_text": "'use strict'\nfunction main(input) {\n input = input.trim().split('\\n')\n input.shift()\n let min = 0\n let max = 1000000\n input.forEach(val => {\n let temp = val.split(' ').map(val => Number(val))\n if (temp[0] > min) min = temp[0]\n if (temp[1] < max) max = temp[1]\n })\n let ans = max - min + 1\n console.log(ans > 0 ? ans : 0)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1558834314, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03037.html", "problem_id": "p03037", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03037/input.txt", "sample_output_relpath": "derived/input_output/data/p03037/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03037/JavaScript/s444268838.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s444268838", "user_id": "u621374656"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "'use strict'\nfunction main(input) {\n input = input.trim().split('\\n')\n input.shift()\n let min = 0\n let max = 1000000\n input.forEach(val => {\n let temp = val.split(' ').map(val => Number(val))\n if (temp[0] > min) min = temp[0]\n if (temp[1] < max) max = temp[1]\n })\n let ans = max - min + 1\n console.log(ans > 0 ? ans : 0)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "sample_input": "4 2\n1 3\n2 4\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03037", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe have N ID cards, and there are M gates.\n\nWe can pass the i-th gate if we have one of the following ID cards: the L_i-th, (L_i+1)-th, ..., and R_i-th ID cards.\n\nHow many of the ID cards allow us to pass all the gates alone?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq L_i \\leq R_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nL_1 R_1\nL_2 R_2\n\\vdots\nL_M R_M\n\nOutput\n\nPrint the number of ID cards that allow us to pass all the gates alone.\n\nSample Input 1\n\n4 2\n1 3\n2 4\n\nSample Output 1\n\n2\n\nTwo ID cards allow us to pass all the gates alone, as follows:\n\nThe first ID card does not allow us to pass the second gate.\n\nThe second ID card allows us to pass all the gates.\n\nThe third ID card allows us to pass all the gates.\n\nThe fourth ID card does not allow us to pass the first gate.\n\nSample Input 2\n\n10 3\n3 6\n5 7\n6 9\n\nSample Output 2\n\n1\n\nSample Input 3\n\n100000 1\n1 100000\n\nSample Output 3\n\n100000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 396, "cpu_time_ms": 166, "memory_kb": 29072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s861101563", "group_id": "codeNet:p03038", "input_text": "function Main(input) {\n input = input.trim().split(\"\\n\");\n tmp = input[0].split(\" \");\n var N = parseInt(tmp[0],10);\n var M = parseInt(tmp[1],10);\n var A = [];\n for(var i = 0; i < N; i++){\n A[i] = parseInt(input[1].split(\" \")[i],10);\n }\n\n for(var j = 2; j <= M+1; j++){\n var B = parseInt(input[j].split(\" \")[0],10);\n var C = parseInt(input[j].split(\" \")[1],10);\n\n for(var i = 0; i < B; i++){\n A.push(C);\n }\n }\n\n A.sort(function(a,b){\n return (a < b ? 1 : -1);\n });\n\n var output = 0;\n for(var i = 0; i < N; i++){\n output += A[i];\n }\n console.log(output);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1558836390, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03038.html", "problem_id": "p03038", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03038/input.txt", "sample_output_relpath": "derived/input_output/data/p03038/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03038/JavaScript/s861101563.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s861101563", "user_id": "u047662730"}, "prompt_components": {"gold_output": "14\n", "input_to_evaluate": "function Main(input) {\n input = input.trim().split(\"\\n\");\n tmp = input[0].split(\" \");\n var N = parseInt(tmp[0],10);\n var M = parseInt(tmp[1],10);\n var A = [];\n for(var i = 0; i < N; i++){\n A[i] = parseInt(input[1].split(\" \")[i],10);\n }\n\n for(var j = 2; j <= M+1; j++){\n var B = parseInt(input[j].split(\" \")[0],10);\n var C = parseInt(input[j].split(\" \")[1],10);\n\n for(var i = 0; i < B; i++){\n A.push(C);\n }\n }\n\n A.sort(function(a,b){\n return (a < b ? 1 : -1);\n });\n\n var output = 0;\n for(var i = 0; i < N; i++){\n output += A[i];\n }\n console.log(output);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "3 2\n5 1 4\n2 3\n1 5\n"}, "reference_outputs": ["14\n"], "source_document_id": "p03038", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou have N cards. On the i-th card, an integer A_i is written.\n\nFor each j = 1, 2, ..., M in this order, you will perform the following operation once:\n\nOperation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j.\n\nFind the maximum possible sum of the integers written on the N cards after the M operations.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i, C_i \\leq 10^9\n\n1 \\leq B_i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 A_2 ... A_N\nB_1 C_1\nB_2 C_2\n\\vdots\nB_M C_M\n\nOutput\n\nPrint the maximum possible sum of the integers written on the N cards after the M operations.\n\nSample Input 1\n\n3 2\n5 1 4\n2 3\n1 5\n\nSample Output 1\n\n14\n\nBy replacing the integer on the second card with 5, the sum of the integers written on the three cards becomes 5 + 5 + 4 = 14, which is the maximum result.\n\nSample Input 2\n\n10 3\n1 8 5 7 100 4 52 33 13 5\n3 10\n4 30\n1 4\n\nSample Output 2\n\n338\n\nSample Input 3\n\n3 2\n100 100 100\n3 99\n3 99\n\nSample Output 3\n\n300\n\nSample Input 4\n\n11 3\n1 1 1 1 1 1 1 1 1 1 1\n3 1000000000\n4 1000000000\n3 1000000000\n\nSample Output 4\n\n10000000001\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 715, "cpu_time_ms": 2109, "memory_kb": 53376}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s329519038", "group_id": "codeNet:p03040", "input_text": "\"use strict\";\nfunction I(t,i){this._s=t.split(\"\\n\"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(\" \"),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(\" \").map(t||this._f)},module.exports=I;\n\nfunction main(input) {\n var o = new I(input);\n\n var q = o.a();\n\n var c = 0;\n var sorted = [];\n\n for (var i = 0; i < q; i ++) {\n var q1 = o.a();\n if (q1 === 1) {\n var a = o.a();\n var b = o.a();\n c += b;\n \n sorted.push(a);\n } else {\n sorted = sorted.sort((a, b) => a - b);\n var mid = sorted[Math.floor((sorted.length - 1) / 2)];\n var ans = sorted.map(x => Math.abs(x - mid)).reduce((acc, cur) => acc + cur) + c;\n console.log(mid, ans);\n }\n }\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1558835837, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03040.html", "problem_id": "p03040", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03040/input.txt", "sample_output_relpath": "derived/input_output/data/p03040/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03040/JavaScript/s329519038.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s329519038", "user_id": "u439911726"}, "prompt_components": {"gold_output": "4 2\n1 -3\n", "input_to_evaluate": "\"use strict\";\nfunction I(t,i){this._s=t.split(\"\\n\"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(\" \"),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(\" \").map(t||this._f)},module.exports=I;\n\nfunction main(input) {\n var o = new I(input);\n\n var q = o.a();\n\n var c = 0;\n var sorted = [];\n\n for (var i = 0; i < q; i ++) {\n var q1 = o.a();\n if (q1 === 1) {\n var a = o.a();\n var b = o.a();\n c += b;\n \n sorted.push(a);\n } else {\n sorted = sorted.sort((a, b) => a - b);\n var mid = sorted[Math.floor((sorted.length - 1) / 2)];\n var ans = sorted.map(x => Math.abs(x - mid)).reduce((acc, cur) => acc + cur) + c;\n console.log(mid, ans);\n }\n }\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nThere is a function f(x), which is initially a constant function f(x) = 0.\n\nWe will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:\n\nAn update query 1 a b: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).\n\nAn evaluation query 2: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.\n\nWe can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n-10^9 \\leq a, b \\leq 10^9\n\nThe first query is an update query.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nQuery_1\n:\nQuery_Q\n\nSee Sample Input 1 for an example.\n\nOutput\n\nFor each evaluation query, print a line containing the response, in the order in which the queries are given.\n\nThe response to each evaluation query should be the minimum value of x that minimizes f(x), and the minimum value of f(x), in this order, with space in between.\n\nSample Input 1\n\n4\n1 4 2\n2\n1 1 -8\n2\n\nSample Output 1\n\n4 2\n1 -3\n\nIn the first evaluation query, f(x) = |x - 4| + 2, which attains the minimum value of 2 at x = 4.\n\nIn the second evaluation query, f(x) = |x - 1| + |x - 4| - 6, which attains the minimum value of -3 when 1 \\leq x \\leq 4. Among the multiple values of x that minimize f(x), we ask you to print the minimum, that is, 1.\n\nSample Input 2\n\n4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n2\n\nSample Output 2\n\n-1000000000 3000000000", "sample_input": "4\n1 4 2\n2\n1 1 -8\n2\n"}, "reference_outputs": ["4 2\n1 -3\n"], "source_document_id": "p03040", "source_text": "Score : 600 points\n\nProblem Statement\n\nThere is a function f(x), which is initially a constant function f(x) = 0.\n\nWe will ask you to process Q queries in order. There are two kinds of queries, update queries and evaluation queries, as follows:\n\nAn update query 1 a b: Given two integers a and b, let g(x) = f(x) + |x - a| + b and replace f(x) with g(x).\n\nAn evaluation query 2: Print x that minimizes f(x), and the minimum value of f(x). If there are multiple such values of x, choose the minimum such value.\n\nWe can show that the values to be output in an evaluation query are always integers, so we ask you to print those values as integers without decimal points.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq Q \\leq 2 \\times 10^5\n\n-10^9 \\leq a, b \\leq 10^9\n\nThe first query is an update query.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nQ\nQuery_1\n:\nQuery_Q\n\nSee Sample Input 1 for an example.\n\nOutput\n\nFor each evaluation query, print a line containing the response, in the order in which the queries are given.\n\nThe response to each evaluation query should be the minimum value of x that minimizes f(x), and the minimum value of f(x), in this order, with space in between.\n\nSample Input 1\n\n4\n1 4 2\n2\n1 1 -8\n2\n\nSample Output 1\n\n4 2\n1 -3\n\nIn the first evaluation query, f(x) = |x - 4| + 2, which attains the minimum value of 2 at x = 4.\n\nIn the second evaluation query, f(x) = |x - 1| + |x - 4| - 6, which attains the minimum value of -3 when 1 \\leq x \\leq 4. Among the multiple values of x that minimize f(x), we ask you to print the minimum, that is, 1.\n\nSample Input 2\n\n4\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n1 -1000000000 1000000000\n2\n\nSample Output 2\n\n-1000000000 3000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 956, "cpu_time_ms": 2109, "memory_kb": 65492}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s034620215", "group_id": "codeNet:p03041", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n const K = parseInt(arg[0].split(\" \")[1]);\n \n let answer = 0;\n \n for(let i=1; i<=N; i++) {\n let temp;\n \n if(i >= K) {\n answer += (1 / N);\n } else {\n for(let j=1; j<100000; j++) {\n if(i * Math.pow(2, j) > K) {\n temp = j;\n break;\n }\n }\n \n answer += (1 / N) * Math.pow((1 / 2), temp);\n }\n }\n \n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1558321821, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03041.html", "problem_id": "p03041", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03041/input.txt", "sample_output_relpath": "derived/input_output/data/p03041/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03041/JavaScript/s034620215.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s034620215", "user_id": "u598795006"}, "prompt_components": {"gold_output": "aBC\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n const K = parseInt(arg[0].split(\" \")[1]);\n \n let answer = 0;\n \n for(let i=1; i<=N; i++) {\n let temp;\n \n if(i >= K) {\n answer += (1 / N);\n } else {\n for(let j=1; j<100000; j++) {\n if(i * Math.pow(2, j) > K) {\n temp = j;\n break;\n }\n }\n \n answer += (1 / N) * Math.pow((1 / 2), temp);\n }\n }\n \n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "sample_input": "3 1\nABC\n"}, "reference_outputs": ["aBC\n"], "source_document_id": "p03041", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of A, B and C, and an integer K which is between 1 and N (inclusive).\nPrint the string S after lowercasing the K-th character in it.\n\nConstraints\n\n1 ≤ N ≤ 50\n\n1 ≤ K ≤ N\n\nS is a string of length N consisting of A, B and C.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nS\n\nOutput\n\nPrint the string S after lowercasing the K-th character in it.\n\nSample Input 1\n\n3 1\nABC\n\nSample Output 1\n\naBC\n\nSample Input 2\n\n4 3\nCABA\n\nSample Output 2\n\nCAbA", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 665, "cpu_time_ms": 1664, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s940130386", "group_id": "codeNet:p03043", "input_text": "'use strict'\n\nfunction Main(input) {\n input = input.split(' ');\n let N = parseInt(input [0]);\n let K = parseInt(input [1]);\n let result = 0;\n for(let i=1;i parseInt(e));\n \n const K = S.pop()\n const N = S.pop()\n\n const Ps = [];\n for (let i=0; i < 17; i++) {\n Ps.push(Math.pow(2, i+1))\n }\n\n const Pr = Ps.map( n => 1/n)\n const L = Ps.length;\n\n let ans = 0;\n for (let i=1; i= K) {\n ans += 1/N;\n continue\n }\n let idx = 0;\n prb:\n for(let j =0; j < L ; j++) {\n if (i*Ps[j] >= K) {\n idx = j;\n break prb;\n }\n }\n ans += Pr[idx] / N\n\n\n }\n console.log(ans)\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1558319353, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03043/input.txt", "sample_output_relpath": "derived/input_output/data/p03043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03043/JavaScript/s033635545.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s033635545", "user_id": "u538103409"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": "function Main(input) {\n \"use strict\";\n\tconst lines = input.split(\"\\n\");\n let S = lines[0].split(\" \").map(e => parseInt(e));\n \n const K = S.pop()\n const N = S.pop()\n\n const Ps = [];\n for (let i=0; i < 17; i++) {\n Ps.push(Math.pow(2, i+1))\n }\n\n const Pr = Ps.map( n => 1/n)\n const L = Ps.length;\n\n let ans = 0;\n for (let i=1; i= K) {\n ans += 1/N;\n continue\n }\n let idx = 0;\n prb:\n for(let j =0; j < L ; j++) {\n if (i*Ps[j] >= K) {\n idx = j;\n break prb;\n }\n }\n ans += Pr[idx] / N\n\n\n }\n console.log(ans)\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "sample_input": "3 10\n"}, "reference_outputs": ["0.145833333333\n"], "source_document_id": "p03043", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 651, "cpu_time_ms": 322, "memory_kb": 23092}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s274747178", "group_id": "codeNet:p03043", "input_text": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\")\n .readFileSync(\"/dev/stdin\", \"utf8\")\n .split(\" \").map((v) => parseInt(v, 10));\n\nconst N = input[0];\nconst K = input[1];\n\nlet borders = [];\n\nfor (let i = 1; ; i++) {\n const border = K / Math.pow(2, i);\n borders.push(Math.ceil(border));\n\n if (border < 1) { break; }\n}\n\nlet ans = (K < N) ? (N - K + 1) / N : 0;\n\nfor (let i = 0; i < borders.length; i++) {\n if (borders[i] > N) {\n borders[i] = N + 1;\n continue;\n }\n\n ans += ((borders[i - 1] || K) - borders[i]) / (N * Math.pow(2, i + 1));\n}\n\nconsole.log(ans);\n", "language": "JavaScript", "metadata": {"date": 1558317624, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03043.html", "problem_id": "p03043", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03043/input.txt", "sample_output_relpath": "derived/input_output/data/p03043/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03043/JavaScript/s274747178.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s274747178", "user_id": "u445747215"}, "prompt_components": {"gold_output": "0.145833333333\n", "input_to_evaluate": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\")\n .readFileSync(\"/dev/stdin\", \"utf8\")\n .split(\" \").map((v) => parseInt(v, 10));\n\nconst N = input[0];\nconst K = input[1];\n\nlet borders = [];\n\nfor (let i = 1; ; i++) {\n const border = K / Math.pow(2, i);\n borders.push(Math.ceil(border));\n\n if (border < 1) { break; }\n}\n\nlet ans = (K < N) ? (N - K + 1) / N : 0;\n\nfor (let i = 0; i < borders.length; i++) {\n if (borders[i] > N) {\n borders[i] = N + 1;\n continue;\n }\n\n ans += ((borders[i - 1] || K) - borders[i]) / (N * Math.pow(2, i + 1));\n}\n\nconsole.log(ans);\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "sample_input": "3 10\n"}, "reference_outputs": ["0.145833333333\n"], "source_document_id": "p03043", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has a fair N-sided die that shows the integers from 1 to N with equal probability and a fair coin. He will play the following game with them:\n\nThrow the die. The current score is the result of the die.\n\nAs long as the score is between 1 and K-1 (inclusive), keep flipping the coin. The score is doubled each time the coin lands heads up, and the score becomes 0 if the coin lands tails up.\n\nThe game ends when the score becomes 0 or becomes K or above. Snuke wins if the score is K or above, and loses if the score is 0.\n\nYou are given N and K. Find the probability that Snuke wins the game.\n\nConstraints\n\n1 ≤ N ≤ 10^5\n\n1 ≤ K ≤ 10^5\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the probability that Snuke wins the game. The output is considered correct when the absolute or relative error is at most 10^{-9}.\n\nSample Input 1\n\n3 10\n\nSample Output 1\n\n0.145833333333\n\nIf the die shows 1, Snuke needs to get four consecutive heads from four coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^4 = \\frac{1}{48}.\n\nIf the die shows 2, Snuke needs to get three consecutive heads from three coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^3 = \\frac{1}{24}.\n\nIf the die shows 3, Snuke needs to get two consecutive heads from two coin flips to obtain a score of 10 or above. The probability of this happening is \\frac{1}{3} \\times (\\frac{1}{2})^2 = \\frac{1}{12}.\n\nThus, the probability that Snuke wins is \\frac{1}{48} + \\frac{1}{24} + \\frac{1}{12} = \\frac{7}{48} \\simeq 0.1458333333.\n\nSample Input 2\n\n100000 5\n\nSample Output 2\n\n0.999973749998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 587, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s987300819", "group_id": "codeNet:p03044", "input_text": "'use strict';\n(function(input){\n input=input.trim().split(/\\n/);\n const N=input.shift()-0;\n input=input.map(str=>str.split(/\\s+/).map(x=>x-0));\n \n function Node(){\n var t=this;\n t.connected=[];\n t.group='none';\n }\n \n const nodes=new Array(N+1);\n \n for(let i=1;i<=N;i++){\n nodes[i]=new Node();\n }\n \n input.forEach(function(a){\n var odd=a[2]%2;\n nodes[a[0]].connected.push([a[1],odd]);\n nodes[a[1]].connected.push([a[0],odd]);\n });\n \n const stack=[1];\n \n nodes[1].group=0;\n \n while(stack.length>0){\n let i=stack[stack.length-1];\n let t=nodes[i];\n if(t.connected.length===0){\n stack.pop();\n }else{\n let c=t.connected[t.connected.length-1];\n let n=nodes[c[0]];\n if(n.group==='none'){\n n.group=(t.group+c[1])%2;\n stack.push(c[0]);\n }else{\n t.connected.pop();\n }\n }\n }\n \n const ans=[];\n for(let i=1;i<=N;i++){\n ans.push(nodes[i].group);\n }\n console.log(ans.join('\\n'));\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "language": "JavaScript", "metadata": {"date": 1558328527, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03044.html", "problem_id": "p03044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03044/input.txt", "sample_output_relpath": "derived/input_output/data/p03044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03044/JavaScript/s987300819.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s987300819", "user_id": "u833932983"}, "prompt_components": {"gold_output": "0\n0\n1\n", "input_to_evaluate": "'use strict';\n(function(input){\n input=input.trim().split(/\\n/);\n const N=input.shift()-0;\n input=input.map(str=>str.split(/\\s+/).map(x=>x-0));\n \n function Node(){\n var t=this;\n t.connected=[];\n t.group='none';\n }\n \n const nodes=new Array(N+1);\n \n for(let i=1;i<=N;i++){\n nodes[i]=new Node();\n }\n \n input.forEach(function(a){\n var odd=a[2]%2;\n nodes[a[0]].connected.push([a[1],odd]);\n nodes[a[1]].connected.push([a[0],odd]);\n });\n \n const stack=[1];\n \n nodes[1].group=0;\n \n while(stack.length>0){\n let i=stack[stack.length-1];\n let t=nodes[i];\n if(t.connected.length===0){\n stack.pop();\n }else{\n let c=t.connected[t.connected.length-1];\n let n=nodes[c[0]];\n if(n.group==='none'){\n n.group=(t.group+c[1])%2;\n stack.push(c[0]);\n }else{\n t.connected.pop();\n }\n }\n }\n \n const ans=[];\n for(let i=1;i<=N;i++){\n ans.push(nodes[i].group);\n }\n console.log(ans.join('\\n'));\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "sample_input": "3\n1 2 2\n2 3 1\n"}, "reference_outputs": ["0\n0\n1\n"], "source_document_id": "p03044", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1033, "cpu_time_ms": 540, "memory_kb": 80128}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s221571854", "group_id": "codeNet:p03044", "input_text": "\"use strict\";\nconst stringToIntDecimal = s => parseInt(s);\n\nconst readEdgeDataLine = line => {\n const numberArray = line.split(\" \").map(stringToIntDecimal);\n\n return {\n vertexNumberA: numberArray[0],\n vertexNumberB: numberArray[1],\n distance: numberArray[2]\n };\n};\n\nconst readData = input => {\n const lines = input.split(\"\\n\");\n\n return {\n n: parseInt(lines[0]),\n edges: lines.slice(1).map(readEdgeDataLine)\n };\n};\n\nconst getVertices = data => {\n const n = data.n;\n const edges = data.edges;\n const vertices = new Array(n + 1);\n for (let i = 1; i <= n; i += 1)\n vertices[i] = {\n color: 0,\n adjacentVertices: []\n };\n const edgeCount = n - 1;\n\n for (let i = 0; i < edgeCount; i += 1) {\n const edge = edges[i];\n vertices[edge.vertexNumberA].adjacentVertices.push({\n vertex: vertices[edge.vertexNumberB],\n distance: edge.distance\n });\n vertices[edge.vertexNumberB].adjacentVertices.push({\n vertex: vertices[edge.vertexNumberA],\n distance: edge.distance\n });\n }\n\n return vertices;\n};\n\nfunction colorVertex(vertex, excludingVertex) {\n const neighbors = vertex.adjacentVertices;\n const len = neighbors.length;\n\n for (let i = 0; i < len; i += 1) {\n const neighbor = neighbors[i];\n const neighborVertex = neighbor.vertex;\n if (neighborVertex === excludingVertex) continue;\n neighborVertex.color = neighbor.distance % 2;\n colorVertex(neighborVertex, vertex);\n }\n}\n\nfunction Main(input) {\n const data = readData(input);\n const vertices = getVertices(data);\n colorVertex(vertices[1]);\n const n = data.n;\n for (let i = 1; i <= n; i += 1) console.log(vertices[i].color);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1558319919, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03044.html", "problem_id": "p03044", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03044/input.txt", "sample_output_relpath": "derived/input_output/data/p03044/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03044/JavaScript/s221571854.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s221571854", "user_id": "u505450128"}, "prompt_components": {"gold_output": "0\n0\n1\n", "input_to_evaluate": "\"use strict\";\nconst stringToIntDecimal = s => parseInt(s);\n\nconst readEdgeDataLine = line => {\n const numberArray = line.split(\" \").map(stringToIntDecimal);\n\n return {\n vertexNumberA: numberArray[0],\n vertexNumberB: numberArray[1],\n distance: numberArray[2]\n };\n};\n\nconst readData = input => {\n const lines = input.split(\"\\n\");\n\n return {\n n: parseInt(lines[0]),\n edges: lines.slice(1).map(readEdgeDataLine)\n };\n};\n\nconst getVertices = data => {\n const n = data.n;\n const edges = data.edges;\n const vertices = new Array(n + 1);\n for (let i = 1; i <= n; i += 1)\n vertices[i] = {\n color: 0,\n adjacentVertices: []\n };\n const edgeCount = n - 1;\n\n for (let i = 0; i < edgeCount; i += 1) {\n const edge = edges[i];\n vertices[edge.vertexNumberA].adjacentVertices.push({\n vertex: vertices[edge.vertexNumberB],\n distance: edge.distance\n });\n vertices[edge.vertexNumberB].adjacentVertices.push({\n vertex: vertices[edge.vertexNumberA],\n distance: edge.distance\n });\n }\n\n return vertices;\n};\n\nfunction colorVertex(vertex, excludingVertex) {\n const neighbors = vertex.adjacentVertices;\n const len = neighbors.length;\n\n for (let i = 0; i < len; i += 1) {\n const neighbor = neighbors[i];\n const neighborVertex = neighbor.vertex;\n if (neighborVertex === excludingVertex) continue;\n neighborVertex.color = neighbor.distance % 2;\n colorVertex(neighborVertex, vertex);\n }\n}\n\nfunction Main(input) {\n const data = readData(input);\n const vertices = getVertices(data);\n colorVertex(vertices[1]);\n const n = data.n;\n for (let i = 1; i <= n; i += 1) console.log(vertices[i].color);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "sample_input": "3\n1 2 2\n2 3 1\n"}, "reference_outputs": ["0\n0\n1\n"], "source_document_id": "p03044", "source_text": "Score : 400 points\n\nProblem Statement\n\nWe have a tree with N vertices numbered 1 to N.\nThe i-th edge in the tree connects Vertex u_i and Vertex v_i, and its length is w_i.\nYour objective is to paint each vertex in the tree white or black (it is fine to paint all vertices the same color) so that the following condition is satisfied:\n\nFor any two vertices painted in the same color, the distance between them is an even number.\n\nFind a coloring of the vertices that satisfies the condition and print it. It can be proved that at least one such coloring exists under the constraints of this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq u_i < v_i \\leq N\n\n1 \\leq w_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nu_1 v_1 w_1\nu_2 v_2 w_2\n.\n.\n.\nu_{N - 1} v_{N - 1} w_{N - 1}\n\nOutput\n\nPrint a coloring of the vertices that satisfies the condition, in N lines.\nThe i-th line should contain 0 if Vertex i is painted white and 1 if it is painted black.\n\nIf there are multiple colorings that satisfy the condition, any of them will be accepted.\n\nSample Input 1\n\n3\n1 2 2\n2 3 1\n\nSample Output 1\n\n0\n0\n1\n\nSample Input 2\n\n5\n2 5 2\n2 3 10\n1 3 8\n3 4 2\n\nSample Output 2\n\n1\n0\n1\n0\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1719, "cpu_time_ms": 1567, "memory_kb": 87540}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s304671202", "group_id": "codeNet:p03045", "input_text": "\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n!function () {\n function splitNum(line) {\n return (Array.isArray(line) ? line : line.split(/\\s+/)).map(function (n) {\n return parseInt(n);\n });\n }\n\n var UnionFind =\n /*#__PURE__*/\n function () {\n function UnionFind(N) {\n _classCallCheck(this, UnionFind);\n\n this.nodes = new Array(N).fill(null).map(function () {\n return {\n parent: null,\n size: 1\n };\n });\n }\n\n _createClass(UnionFind, [{\n key: \"find\",\n value: function find(elm) {\n var node = this.nodes[elm];\n var route = [];\n\n for (; null != node.parent;) {\n route.push(node);\n node = node.parent;\n }\n\n for (var _i = 0; _i < route.length; _i++) {\n var r = route[_i];\n r.parent = node;\n }\n\n return node;\n }\n }, {\n key: \"union\",\n value: function union(elm1, elm2) {\n var node1 = this.find(elm1);\n var node2 = this.find(elm2);\n\n if (node1 !== node2) {\n node2.parent = node1;\n node1.size += node2.size;\n return node1;\n }\n }\n }, {\n key: \"getRootNumber\",\n value: function getRootNumber() {\n return this.nodes.filter(function (node) {\n return null == node.parent;\n }).length;\n }\n }]);\n\n return UnionFind;\n }();\n\n !function (input) {\n var lines = input.split(\"\\n\");\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 2),\n N = _splitNum2[0],\n M = _splitNum2[1];\n\n var infos = lines.slice(1, M + 1).map(function (line) {\n var _splitNum3 = splitNum(line),\n _splitNum4 = _slicedToArray(_splitNum3, 3),\n X = _splitNum4[0],\n Y = _splitNum4[1],\n Z = _splitNum4[2];\n\n return {\n X: X,\n Y: Y,\n Z: Z\n };\n });\n var uf = new UnionFind(N);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = infos[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _step.value,\n X = _step$value.X,\n Y = _step$value.Y;\n uf.union(X - 1, Y - 1);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n console.log(uf.getRootNumber());\n }(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n}();\n", "language": "JavaScript", "metadata": {"date": 1558316190, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03045.html", "problem_id": "p03045", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03045/input.txt", "sample_output_relpath": "derived/input_output/data/p03045/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03045/JavaScript/s304671202.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s304671202", "user_id": "u251786347"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\n!function () {\n function splitNum(line) {\n return (Array.isArray(line) ? line : line.split(/\\s+/)).map(function (n) {\n return parseInt(n);\n });\n }\n\n var UnionFind =\n /*#__PURE__*/\n function () {\n function UnionFind(N) {\n _classCallCheck(this, UnionFind);\n\n this.nodes = new Array(N).fill(null).map(function () {\n return {\n parent: null,\n size: 1\n };\n });\n }\n\n _createClass(UnionFind, [{\n key: \"find\",\n value: function find(elm) {\n var node = this.nodes[elm];\n var route = [];\n\n for (; null != node.parent;) {\n route.push(node);\n node = node.parent;\n }\n\n for (var _i = 0; _i < route.length; _i++) {\n var r = route[_i];\n r.parent = node;\n }\n\n return node;\n }\n }, {\n key: \"union\",\n value: function union(elm1, elm2) {\n var node1 = this.find(elm1);\n var node2 = this.find(elm2);\n\n if (node1 !== node2) {\n node2.parent = node1;\n node1.size += node2.size;\n return node1;\n }\n }\n }, {\n key: \"getRootNumber\",\n value: function getRootNumber() {\n return this.nodes.filter(function (node) {\n return null == node.parent;\n }).length;\n }\n }]);\n\n return UnionFind;\n }();\n\n !function (input) {\n var lines = input.split(\"\\n\");\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 2),\n N = _splitNum2[0],\n M = _splitNum2[1];\n\n var infos = lines.slice(1, M + 1).map(function (line) {\n var _splitNum3 = splitNum(line),\n _splitNum4 = _slicedToArray(_splitNum3, 3),\n X = _splitNum4[0],\n Y = _splitNum4[1],\n Z = _splitNum4[2];\n\n return {\n X: X,\n Y: Y,\n Z: Z\n };\n });\n var uf = new UnionFind(N);\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = infos[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _step$value = _step.value,\n X = _step$value.X,\n Y = _step$value.Y;\n uf.union(X - 1, Y - 1);\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n console.log(uf.getRootNumber());\n }(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n}();\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\n\nLet A_i be the integer written on the i-th card.\n\nYour objective is to guess A_1, A_2, ..., A_N correctly.\n\nYou know the following facts:\n\nFor each i = 1, 2, ..., M, the value A_{X_i} + A_{Y_i} + Z_i is an even number.\n\nYou are a magician and can use the following magic any number of times:\n\nMagic: Choose one card and know the integer A_i written on it. The cost of using this magic is 1.\n\nWhat is the minimum cost required to determine all of A_1, A_2, ..., A_N?\n\nIt is guaranteed that there is no contradiction in given input.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq X_i < Y_i \\leq N\n\n1 \\leq Z_i \\leq 100\n\nThe pairs (X_i, Y_i) are distinct.\n\nThere is no contradiction in input. (That is, there exist integers A_1, A_2, ..., A_N that satisfy the conditions.)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 Y_1 Z_1\nX_2 Y_2 Z_2\n\\vdots\nX_M Y_M Z_M\n\nOutput\n\nPrint the minimum total cost required to determine all of A_1, A_2, ..., A_N.\n\nSample Input 1\n\n3 1\n1 2 1\n\nSample Output 1\n\n2\n\nYou can determine all of A_1, A_2, A_3 by using the magic for the first and third cards.\n\nSample Input 2\n\n6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1\n1 100000 100\n\nSample Output 3\n\n99999", "sample_input": "3 1\n1 2 1\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03045", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N cards placed face down in a row. On each card, an integer 1 or 2 is written.\n\nLet A_i be the integer written on the i-th card.\n\nYour objective is to guess A_1, A_2, ..., A_N correctly.\n\nYou know the following facts:\n\nFor each i = 1, 2, ..., M, the value A_{X_i} + A_{Y_i} + Z_i is an even number.\n\nYou are a magician and can use the following magic any number of times:\n\nMagic: Choose one card and know the integer A_i written on it. The cost of using this magic is 1.\n\nWhat is the minimum cost required to determine all of A_1, A_2, ..., A_N?\n\nIt is guaranteed that there is no contradiction in given input.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq X_i < Y_i \\leq N\n\n1 \\leq Z_i \\leq 100\n\nThe pairs (X_i, Y_i) are distinct.\n\nThere is no contradiction in input. (That is, there exist integers A_1, A_2, ..., A_N that satisfy the conditions.)\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 Y_1 Z_1\nX_2 Y_2 Z_2\n\\vdots\nX_M Y_M Z_M\n\nOutput\n\nPrint the minimum total cost required to determine all of A_1, A_2, ..., A_N.\n\nSample Input 1\n\n3 1\n1 2 1\n\nSample Output 1\n\n2\n\nYou can determine all of A_1, A_2, A_3 by using the magic for the first and third cards.\n\nSample Input 2\n\n6 5\n1 2 1\n2 3 2\n1 3 3\n4 5 4\n5 6 5\n\nSample Output 2\n\n2\n\nSample Input 3\n\n100000 1\n1 100000 100\n\nSample Output 3\n\n99999", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 4165, "cpu_time_ms": 346, "memory_kb": 58640}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s790877778", "group_id": "codeNet:p03047", "input_text": "\"use strict\";\nfunction Main(input) {\n const args = input.split(' ').map(m => parseInt(m));\n const n = args.shift();\n const k = args.shift();\nconsole.log(n - k + 1);\n\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557623901, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03047.html", "problem_id": "p03047", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03047/input.txt", "sample_output_relpath": "derived/input_output/data/p03047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03047/JavaScript/s790877778.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s790877778", "user_id": "u456515457"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\nfunction Main(input) {\n const args = input.split(' ').map(m => parseInt(m));\n const n = args.shift();\n const k = args.shift();\nconsole.log(n - k + 1);\n\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has N integers: 1,2,\\ldots,N.\nHe will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K \\leq N \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are two ways to choose two consecutive integers: (1,2) and (2,3).\n\nSample Input 2\n\n13 3\n\nSample Output 2\n\n11", "sample_input": "3 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03047", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has N integers: 1,2,\\ldots,N.\nHe will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K \\leq N \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are two ways to choose two consecutive integers: (1,2) and (2,3).\n\nSample Input 2\n\n13 3\n\nSample Output 2\n\n11", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 224, "cpu_time_ms": 572, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s974545337", "group_id": "codeNet:p03047", "input_text": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0].split(\" \")[0]);\n var K = parseInt(input[0].split(\" \")[1]);\n var ans=N-K+1;\n\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557623900, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03047.html", "problem_id": "p03047", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03047/input.txt", "sample_output_relpath": "derived/input_output/data/p03047/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03047/JavaScript/s974545337.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s974545337", "user_id": "u221230011"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0].split(\" \")[0]);\n var K = parseInt(input[0].split(\" \")[1]);\n var ans=N-K+1;\n\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nSnuke has N integers: 1,2,\\ldots,N.\nHe will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K \\leq N \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are two ways to choose two consecutive integers: (1,2) and (2,3).\n\nSample Input 2\n\n13 3\n\nSample Output 2\n\n11", "sample_input": "3 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03047", "source_text": "Score : 100 points\n\nProblem Statement\n\nSnuke has N integers: 1,2,\\ldots,N.\nHe will choose K of them and give those to Takahashi.\n\nHow many ways are there to choose K consecutive integers?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq K \\leq N \\leq 50\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n2\n\nThere are two ways to choose two consecutive integers: (1,2) and (2,3).\n\nSample Input 2\n\n13 3\n\nSample Output 2\n\n11", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 523, "cpu_time_ms": 939, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s923052492", "group_id": "codeNet:p03048", "input_text": "var lines = [];\nvar readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var R = Number(lines[0].split(\" \")[0]);\n var G = Number(lines[0].split(\" \")[1]);\n var B = Number(lines[0].split(\" \")[2]);\n var N = Number(lines[0].split(\" \")[3]);\n\n var ans = 0;\n for (var r = 0; r <= 3000; r++) {\n for (var g = 0; g <= 3000; g++) {\n var b = N - r * R - g * G;\n\n if (b < 0 || b % B !== 0) { continue; }\n ans++;\n }\n }\n\n console.log(ans);\n\n});", "language": "JavaScript", "metadata": {"date": 1557625549, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03048.html", "problem_id": "p03048", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03048/input.txt", "sample_output_relpath": "derived/input_output/data/p03048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03048/JavaScript/s923052492.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s923052492", "user_id": "u266742706"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "var lines = [];\nvar readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var R = Number(lines[0].split(\" \")[0]);\n var G = Number(lines[0].split(\" \")[1]);\n var B = Number(lines[0].split(\" \")[2]);\n var N = Number(lines[0].split(\" \")[3]);\n\n var ans = 0;\n for (var r = 0; r <= 3000; r++) {\n for (var g = 0; g <= 3000; g++) {\n var b = N - r * R - g * G;\n\n if (b < 0 || b % B !== 0) { continue; }\n ans++;\n }\n }\n\n console.log(ans);\n\n});", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "sample_input": "1 2 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03048", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 658, "cpu_time_ms": 745, "memory_kb": 21320}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s769756878", "group_id": "codeNet:p03048", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n input = input.trim();\n input = input.split(\" \");\n var R = input[0];\n var G = input[1];\n var B = input[2];\n var N = input[3];\n var tmpR;\n var tmpG;\n var tmpB;\n var count = 0;\n\n for(var i = 0; i < N/R+1; i++){\n tmpR = N - R*i;\n for(var j = 0; j < tmpR/G+1; j++){\n tmpG = tmpR - G*j;\n for(var k = 0; k < tmpG/B+1; k++){\n tmpB = tmpG - B*k;\n if(tmpB == 0){\n count++;\n }\n }\n }\n }\n\n console.log(count);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557624778, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03048.html", "problem_id": "p03048", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03048/input.txt", "sample_output_relpath": "derived/input_output/data/p03048/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03048/JavaScript/s769756878.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s769756878", "user_id": "u047662730"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n input = input.trim();\n input = input.split(\" \");\n var R = input[0];\n var G = input[1];\n var B = input[2];\n var N = input[3];\n var tmpR;\n var tmpG;\n var tmpB;\n var count = 0;\n\n for(var i = 0; i < N/R+1; i++){\n tmpR = N - R*i;\n for(var j = 0; j < tmpR/G+1; j++){\n tmpG = tmpR - G*j;\n for(var k = 0; k < tmpG/B+1; k++){\n tmpB = tmpG - B*k;\n if(tmpB == 0){\n count++;\n }\n }\n }\n }\n\n console.log(count);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "sample_input": "1 2 3 4\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03048", "source_text": "Score : 200 points\n\nProblem Statement\n\nSnuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes:\n\nRed boxes, each containing R red balls\n\nGreen boxes, each containing G green balls\n\nBlue boxes, each containing B blue balls\n\nSnuke wants to get a total of exactly N balls by buying r red boxes, g green boxes and b blue boxes.\nHow many triples of non-negative integers (r,g,b) achieve this?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq R,G,B,N \\leq 3000\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR G B N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n1 2 3 4\n\nSample Output 1\n\n4\n\nFour triples achieve the objective, as follows:\n\n(4,0,0)\n\n(2,1,0)\n\n(1,0,1)\n\n(0,2,0)\n\nSample Input 2\n\n13 1 4 3000\n\nSample Output 2\n\n87058", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 805, "cpu_time_ms": 2108, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s615433619", "group_id": "codeNet:p03049", "input_text": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var s = new Array(N);\n var a=0;\n var b=0;\n var c=0;\n var ba=0;\n var ans=0;\n for(var i=0;i0){\n if(s[i][j-1]==\"A\"){\n ans++;\n }\n }\n if(c==2){\n ba++;\n }\n }\n c=0;\n }\n ans=ans+Math.min(a,b);\n if(b==ba&&a==ba&&ba!=0){\n ans--;\n }\n \n\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557638188, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/JavaScript/s615433619.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s615433619", "user_id": "u221230011"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var s = new Array(N);\n var a=0;\n var b=0;\n var c=0;\n var ba=0;\n var ans=0;\n for(var i=0;i0){\n if(s[i][j-1]==\"A\"){\n ans++;\n }\n }\n if(c==2){\n ba++;\n }\n }\n c=0;\n }\n ans=ans+Math.min(a,b);\n if(b==ba&&a==ba&&ba!=0){\n ans--;\n }\n \n\n console.log('%s', ans);\n return ans;\n}\n\nfunction debug(n){\n var input = document.getElementById(\"input\"+n).value;\n var ans=Main(input);\n var result=\"WA\";\n if(ans==document.getElementById(\"output\"+n).value.split(\"\\n\")[0]){\n result=\"AC\";\n }\n document.getElementById(\"result\"+n).innerHTML=result;\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 980, "cpu_time_ms": 224, "memory_kb": 23352}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s337182305", "group_id": "codeNet:p03049", "input_text": "\"use strict\";\nfunction main(input) {\n const args = input.split(\"\\n\");\n\n const N = parseInt(args[0]);\n\n const p = /(AB)+/g;\n\n let testStr;\n let testStrLen;\n let countAB = 0;\n\n let BA = 0;\n let firstB = 0;\n let lastA = 0;\n\n for(let i = 0; i < N; i++) {\n testStr = args[i + 1];\n testStrLen = testStr.length;\n while(p.exec(testStr)) {\n countAB ++;\n }\n if (testStr.charAt(0) == \"B\") {\n if (testStr.charAt(testStrLen - 1) == \"A\") {\n BA++;\n } else {\n firstB++;\n }\n } else if (testStr.charAt(testStrLen - 1) == \"A\") {\n lastA++;\n }\n }\n\n\n countAB += BA - 1;\n if(firstB > 0) {\n countAB ++;\n firstB --;\n }\n\n if(lastA < firstB) {\n countAB += lastA;\n } else {\n countAB += firstB\n }\n\n console.log(countAB);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1557630141, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/JavaScript/s337182305.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s337182305", "user_id": "u044133843"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\nfunction main(input) {\n const args = input.split(\"\\n\");\n\n const N = parseInt(args[0]);\n\n const p = /(AB)+/g;\n\n let testStr;\n let testStrLen;\n let countAB = 0;\n\n let BA = 0;\n let firstB = 0;\n let lastA = 0;\n\n for(let i = 0; i < N; i++) {\n testStr = args[i + 1];\n testStrLen = testStr.length;\n while(p.exec(testStr)) {\n countAB ++;\n }\n if (testStr.charAt(0) == \"B\") {\n if (testStr.charAt(testStrLen - 1) == \"A\") {\n BA++;\n } else {\n firstB++;\n }\n } else if (testStr.charAt(testStrLen - 1) == \"A\") {\n lastA++;\n }\n }\n\n\n countAB += BA - 1;\n if(firstB > 0) {\n countAB ++;\n firstB --;\n }\n\n if(lastA < firstB) {\n countAB += lastA;\n } else {\n countAB += firstB\n }\n\n console.log(countAB);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 878, "cpu_time_ms": 58, "memory_kb": 9636}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s078781610", "group_id": "codeNet:p03049", "input_text": "'use strict'\nfunction Main(input){\n input=input.trim().split(/\\s+/);\n var N=input.shift()-0;\n var rightA=input.reduce((acc,str)=>acc+(str[str.length-1]==='A'?1:0), 0);\n var leftB=input.reduce((acc,str)=>acc+(str[0]==='B'?1:0), 0);\n var AB=input.reduce((acc,str)=>acc+str.split('AB').length-1, 0);\n console.log(AB+Math.min(rightA,leftB,N-1));\n}\n\nMain(require('fs').readFileSync('/dev/stdin','utf8'));\n", "language": "JavaScript", "metadata": {"date": 1557627552, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03049.html", "problem_id": "p03049", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03049/input.txt", "sample_output_relpath": "derived/input_output/data/p03049/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03049/JavaScript/s078781610.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s078781610", "user_id": "u833932983"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "'use strict'\nfunction Main(input){\n input=input.trim().split(/\\s+/);\n var N=input.shift()-0;\n var rightA=input.reduce((acc,str)=>acc+(str[str.length-1]==='A'?1:0), 0);\n var leftB=input.reduce((acc,str)=>acc+(str[0]==='B'?1:0), 0);\n var AB=input.reduce((acc,str)=>acc+str.split('AB').length-1, 0);\n console.log(AB+Math.min(rightA,leftB,N-1));\n}\n\nMain(require('fs').readFileSync('/dev/stdin','utf8'));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "sample_input": "3\nABCA\nXBAZ\nBAD\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03049", "source_text": "Score : 400 points\n\nProblem Statement\n\nSnuke has N strings. The i-th string is s_i.\n\nLet us concatenate these strings into one string after arranging them in some order.\nFind the maximum possible number of occurrences of AB in the resulting string.\n\nConstraints\n\n1 \\leq N \\leq 10^{4}\n\n2 \\leq |s_i| \\leq 10\n\ns_i consists of uppercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns_1\n\\vdots\ns_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3\nABCA\nXBAZ\nBAD\n\nSample Output 1\n\n2\n\nFor example, if we concatenate ABCA, BAD and XBAZ in this order, the resulting string ABCABADXBAZ has two occurrences of AB.\n\nSample Input 2\n\n9\nBEWPVCRWH\nZZNQYIJX\nBAVREA\nPA\nHJMYITEOX\nBCJHMRMNK\nBP\nQVFABZ\nPRGKSPUNA\n\nSample Output 2\n\n4\n\nSample Input 3\n\n7\nRABYBBE\nJOZ\nBMHQUVA\nBPA\nISU\nMCMABAOBHZ\nSZMEHMA\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 406, "cpu_time_ms": 62, "memory_kb": 8600}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s234743632", "group_id": "codeNet:p03049", "input_text": "function ab_count(array){\n var result=0;\n for(var i=0;i parseInt(x))[0];\n lines.shift();\n const S = lines;\n\n var result = 0;\n var head=0;\n var tail=0;\n var sum=0;\n for(var i=0;i parseInt(x))[0];\n lines.shift();\n const S = lines;\n\n var result = 0;\n var head=0;\n var tail=0;\n var sum=0;\n for(var i=0;i 0) {\n result.data[idx] = carry;\n }\n\n return result;\n }\n }, {\n key: \"mul\",\n value: function mul(right) {\n var result = new Longer(0);\n\n for (var lidx = 0; lidx < this.data.length; lidx++) {\n for (var ridx = 0; ridx < right.data.length; ridx++) {\n var me = this.data[lidx] * right.data[ridx];\n var tidx = lidx + ridx;\n var value = me;\n\n while (value > 0) {\n var sum = (result.data[tidx] || 0) + value;\n result.data[tidx] = sum % Longer.border;\n value = Math.floor(sum / Longer.border);\n tidx++;\n }\n }\n }\n\n return result;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var d = this.data.concat().reverse(); // let fsti = d.findIndex(v => v !== 0);\n\n var fsti = function (arr, pred) {\n for (var i = 0; i < arr.length; i++) {\n if (pred(arr[i], i)) {\n return i;\n }\n }\n\n return null;\n } // not full polyfill!\n (d, function (v) {\n return v !== 0;\n });\n\n if (fsti == null) {\n return \"0\";\n }\n\n return d.slice(fsti).map(function (v, i) {\n if (i === 0) {\n return String(v);\n } else {\n // return String(v).padStart(Longer.digits, \"0\");\n return padStart(String(v), Longer.digits, \"0\");\n }\n }).join(\"\");\n\n function padStart(str, num, pad) {\n var n = num - str.length;\n var result = \"\";\n\n for (var i = 0; i < n; i++) {\n result += pad;\n }\n\n return result + str;\n }\n }\n }]);\n\n return Longer;\n }();\n /** digits per element. */\n\n\n Longer.digits = 7;\n Longer.border = Math.pow(10, Longer.digits);\n /**\n * UnionFind of integers in [0, N).\n * */\n\n /*#__PURE__*/\n (function () {\n function UnionFind(N) {\n _classCallCheck(this, UnionFind);\n\n this.nodes = new Array(N).fill(null).map(function () {\n return {\n parent: null,\n\n /**\n * size of set.\n * meaningless if not root\n */\n size: 1\n };\n });\n }\n /**\n * Find the root of element.\n */\n\n\n _createClass(UnionFind, [{\n key: \"find\",\n value: function find(elm) {\n var node = this.nodes[elm];\n var route = [];\n\n while (node.parent != null) {\n route.push(node);\n node = node.parent;\n }\n\n for (var _i2 = 0; _i2 < route.length; _i2++) {\n var r = route[_i2];\n r.parent = node;\n }\n\n return node;\n }\n /**\n * Union two sets.\n * @returns new root of merged set.\n */\n\n }, {\n key: \"union\",\n value: function union(elm1, elm2) {\n var node1 = this.find(elm1);\n var node2 = this.find(elm2);\n\n if (node1 === node2) {\n return;\n }\n\n node2.parent = node1;\n node1.size += node2.size;\n return node1;\n }\n }]);\n\n return UnionFind;\n })();\n /**\n * Runs a recursive function expressed as a generator function.\n */\n\n\n // ----------\n (function (input) {\n var lines = input.split(\"\\n\");\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 3),\n A = _splitNum2[0],\n B = _splitNum2[1],\n T = _splitNum2[2];\n\n console.log(Math.floor(T / A) * B);\n })(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n}\n\n_main();\n", "language": "JavaScript", "metadata": {"date": 1556413305, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03059.html", "problem_id": "p03059", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03059/input.txt", "sample_output_relpath": "derived/input_output/data/p03059/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03059/JavaScript/s670536581.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s670536581", "user_id": "u251786347"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "\"use strict\";\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _main() {\n // ----------\n function splitNum(line) {\n return (Array.isArray(line) ? line : line.split(/\\s+/)).map(function (n) {\n return parseInt(n);\n });\n }\n /**\n * Iterates over integers in [start, end).\n */\n\n\n /**\n * implementation of arbitrary-precision unsigned integer.\n */\n var Longer =\n /*#__PURE__*/\n function () {\n function Longer(value) {\n _classCallCheck(this, Longer);\n\n // enough for 64bit\n this.data = [0, 0, 0];\n var idx = 0;\n\n while (value !== 0) {\n this.data[idx] = value % Longer.border;\n value = Math.floor(value / Longer.border);\n idx++;\n }\n }\n\n _createClass(Longer, [{\n key: \"add\",\n value: function add(right) {\n var result = new Longer(0);\n var max = Math.max(this.data.length, right.data.length);\n var carry = 0;\n var idx = 0;\n\n for (; idx < max; idx++) {\n var sum = (this.data[idx] || 0) + (right.data[idx] || 0) + carry;\n result.data[idx] = sum % Longer.border;\n carry = Math.floor(sum / Longer.border);\n }\n\n if (carry > 0) {\n result.data[idx] = carry;\n }\n\n return result;\n }\n }, {\n key: \"mul\",\n value: function mul(right) {\n var result = new Longer(0);\n\n for (var lidx = 0; lidx < this.data.length; lidx++) {\n for (var ridx = 0; ridx < right.data.length; ridx++) {\n var me = this.data[lidx] * right.data[ridx];\n var tidx = lidx + ridx;\n var value = me;\n\n while (value > 0) {\n var sum = (result.data[tidx] || 0) + value;\n result.data[tidx] = sum % Longer.border;\n value = Math.floor(sum / Longer.border);\n tidx++;\n }\n }\n }\n\n return result;\n }\n }, {\n key: \"toString\",\n value: function toString() {\n var d = this.data.concat().reverse(); // let fsti = d.findIndex(v => v !== 0);\n\n var fsti = function (arr, pred) {\n for (var i = 0; i < arr.length; i++) {\n if (pred(arr[i], i)) {\n return i;\n }\n }\n\n return null;\n } // not full polyfill!\n (d, function (v) {\n return v !== 0;\n });\n\n if (fsti == null) {\n return \"0\";\n }\n\n return d.slice(fsti).map(function (v, i) {\n if (i === 0) {\n return String(v);\n } else {\n // return String(v).padStart(Longer.digits, \"0\");\n return padStart(String(v), Longer.digits, \"0\");\n }\n }).join(\"\");\n\n function padStart(str, num, pad) {\n var n = num - str.length;\n var result = \"\";\n\n for (var i = 0; i < n; i++) {\n result += pad;\n }\n\n return result + str;\n }\n }\n }]);\n\n return Longer;\n }();\n /** digits per element. */\n\n\n Longer.digits = 7;\n Longer.border = Math.pow(10, Longer.digits);\n /**\n * UnionFind of integers in [0, N).\n * */\n\n /*#__PURE__*/\n (function () {\n function UnionFind(N) {\n _classCallCheck(this, UnionFind);\n\n this.nodes = new Array(N).fill(null).map(function () {\n return {\n parent: null,\n\n /**\n * size of set.\n * meaningless if not root\n */\n size: 1\n };\n });\n }\n /**\n * Find the root of element.\n */\n\n\n _createClass(UnionFind, [{\n key: \"find\",\n value: function find(elm) {\n var node = this.nodes[elm];\n var route = [];\n\n while (node.parent != null) {\n route.push(node);\n node = node.parent;\n }\n\n for (var _i2 = 0; _i2 < route.length; _i2++) {\n var r = route[_i2];\n r.parent = node;\n }\n\n return node;\n }\n /**\n * Union two sets.\n * @returns new root of merged set.\n */\n\n }, {\n key: \"union\",\n value: function union(elm1, elm2) {\n var node1 = this.find(elm1);\n var node2 = this.find(elm2);\n\n if (node1 === node2) {\n return;\n }\n\n node2.parent = node1;\n node1.size += node2.size;\n return node1;\n }\n }]);\n\n return UnionFind;\n })();\n /**\n * Runs a recursive function expressed as a generator function.\n */\n\n\n // ----------\n (function (input) {\n var lines = input.split(\"\\n\");\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 3),\n A = _splitNum2[0],\n B = _splitNum2[1],\n T = _splitNum2[2];\n\n console.log(Math.floor(T / A) * B);\n })(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n}\n\n_main();\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "sample_input": "3 5 7\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03059", "source_text": "Score : 100 points\n\nProblem Statement\n\nA biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.\n\nFind the total number of biscuits produced within T + 0.5 seconds after activation.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B, T \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B T\n\nOutput\n\nPrint the total number of biscuits produced within T + 0.5 seconds after activation.\n\nSample Input 1\n\n3 5 7\n\nSample Output 1\n\n10\n\nFive biscuits will be produced three seconds after activation.\n\nAnother five biscuits will be produced six seconds after activation.\n\nThus, a total of ten biscuits will be produced within 7.5 seconds after activation.\n\nSample Input 2\n\n3 2 9\n\nSample Output 2\n\n6\n\nSample Input 3\n\n20 20 19\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 6808, "cpu_time_ms": 211, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s174170663", "group_id": "codeNet:p03063", "input_text": "'use strict'\n\nclass Main {\n solve() {\n const n = input.nextInt();\n const list = Array.from(input.nextLine()).map(e=>e==='#'?1:0);\n let skip = true;\n const l1 = [];\n for (let i = 0; i < n; ++i) {\n if (list[i] == 1) skip = false;\n if (skip) {continue;}\n l1.push(list[i]);\n }\n let size = l1.length;\n for (let i = l1.length - 1; i >= 0; --i) {\n if (l1[i] == 0) { break; }\n size = i;\n }\n const l2 = l1.slice(0,size);\n if (l2.length == 0) return 0;\n const black = l2;\n const white = l2.map(e=>e==1?0:1);\n const blackSum = _.sumArray(black);\n const whiteSum = _.sumArray(white);\n const blackMax = _.sum(black);\n const whiteMax = _.sum(white);\n const pre = [];\n pre.push(whiteMax);\n for (let i = 0; i < black.length; ++i) {\n pre.push(blackSum[i]+(whiteMax - whiteSum[i]));\n }\n return _.min(pre);\n }\n}\n\nclass Mod {\n constructor(mod) {\n if (mod == null) { mod = Combinatorics.DefaultMod; }\n this.mod = mod;\n }\n mult(a,b) {\n let ret = 0;\n a %= this.mod;\n b %= this.mod;\n while (b) {\n if (b&1) {\n ret += a;\n if (ret > this.mod) { ret -= this.mod; }\n }\n a <<= 1;\n if (a > this.mod) { a -= this.mod; }\n b >>= 1;\n }\n return ret;\n }\n pow(a,b) {\n let ret = 1;\n while(b) {\n if (b&1) { ret = this.mult(ret,a); }\n a = this.mult(a,a);\n b >>= 1;\n }\n return ret;\n }\n div(a,b) { return this.mult(a, this.pow(b, this.mod-2)) }\n comb(n,k) { return MOD.mult(factTable[n],MOD.mult(invFactTable[k],invFactTable[n-k])); }\n}\nconst MOD = new Mod(998244353);\n\nclass Underscore {\n sum(arr) { return arr.reduce((a,b)=>a+b); }\n modSum(arr,mod) { if (mod == null) { mod = MOD.mod; } return arr.reduce((a,b)=>(a+b)%mod); }\n min(arr, func) { if (func == null) {func = (a,b) => a - b} return arr.reduce((a,b) => func(a,b) < 0 ? a : b); }\n max(arr, func) { if (func == null) {func = (a,b) => a - b} return arr.reduce((a,b) => func(a,b) > 0 ? a : b); }\n sort(arr, func) { if (func == null) {func = (a,b) => a - b} return arr.sort(func) }\n uniq(arr) { \n arr.sort();\n for(let i = 0; i < arr.length - 1; ++i) { \n arr[i] = arr[i+1] == arr[i] ? null : arr[i]; \n }\n return arr.filter(e => e != null);\n }\n range(start, stop, step) {\n if (stop == null) { stop = start || 0; start = 0; }\n if (!step) { step = stop < start ? -1 : 1; }\n const length = Math.max(Math.ceil((stop - start) / step), 0);\n const range = Array(length);\n for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; }\n return range;\n }\n first (array, n) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null) return array[0];\n return this.initial(array, array.length - n);\n };\n initial (array, n) { return array.slice.call(array, 0, Math.max(0, array.length - (n == null ? 1 : n))); }\n tail(array, n) { return array.slice.call(array, n == null ? 1 : n); }\n last (array, n) { if (n == null) return array[array.length - 1]; return this.tail(array, Math.max(0, array.length - n)); }\n sumArray (arr) { return this.tail(arr.reduce(((a,b,i) => {a.push(b + a[i]); return a}), [0])); }\n diffArray (arr) { const s = []; for (let i = 1; i < arr.length; ++i) { s.push(arr[i] - arr[i-1]); } return s; }\n // 配列の値以下の最大のindex\n binarySearch (array, key, iteratee) {\n const itr = (obj) => (typeof obj === 'object') ? obj[iteratee] : obj;\n const value = itr(key);\n let low = 0, high = array.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n if (itr(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n };\n}\nconst _ = new Underscore();\n\nclass Input {\n constructor() {\n this.cursor = 0;\n this.inputAll();\n }\n\n inputAll() {\n this.data = (require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")).split('\\n');\n return this.data;\n }\n\n /* 1行 or 複数行文字列 */\n nextLine(n) {\n if (n) {\n const ret = this.data.slice(this.cursor, this.cursor + n);\n this.cursor += n;\n return ret;\n }\n return this.data[this.cursor++];\n }\n /* 1整数 */\n nextInt() { return parseInt(this.nextLine()); } \n /* 一行文字配列 */\n nextStrArr() { return this.nextLine().split(' '); } \n /* 一行整数配列 */\n nextIntArr() { return this.nextStrArr().map((e) => parseInt(e)); }\n /* 一行浮動小数点配列 */\n nextFloatArr() { return this.nextStrArr().map((e) => parseFloat(e)); }\n /* 複数行整数配列 */\n nextIntLine(n) { return this.nextLine(n).map((e) => parseInt(e)) }\n /* 複数行浮動小数点配列 */\n nextFloatLine(n) { return this.nextLine(n).map((e) => parseFloat(e)) }\n /* 複数行文字列二次元配列 */\n nextStrRange(n) { return this.nextLine(n).map((line) => line.split(' ')); }\n /* 複数行整数二次元配列 */\n nextIntRange(n) {\n return this.nextLine(n).map((line) => line.split(' ').map((e) => parseInt(e)));\n }\n /* 複数行浮動小数点数二次元配列 */\n nextFloatRange(n) {\n return this.nextLine(n).map((line) => line.split(' ').map((e) => parseFloat(e)));\n }\n} \nconst input = new Input();\n\nclass Out {\n constructor() {\n this.option = {\n 'true': 'Yes',\n 'false': 'No',\n };\n }\n write(output){\n let ret;\n if (output == null) return;\n if (output === true) { ret = this.option['true']; }\n else if (output === false) { ret = this.option['false']; }\n else { ret = output; }\n console.log(ret);\n }\n bool(option) {\n this.option['false'] = option[0];\n this.option['true'] = option[1];\n return this;\n }\n}\nconst out = new Out();\n\nout.write(new Main().solve());\n", "language": "JavaScript", "metadata": {"date": 1555811030, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03063.html", "problem_id": "p03063", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03063/input.txt", "sample_output_relpath": "derived/input_output/data/p03063/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03063/JavaScript/s174170663.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s174170663", "user_id": "u038229929"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "'use strict'\n\nclass Main {\n solve() {\n const n = input.nextInt();\n const list = Array.from(input.nextLine()).map(e=>e==='#'?1:0);\n let skip = true;\n const l1 = [];\n for (let i = 0; i < n; ++i) {\n if (list[i] == 1) skip = false;\n if (skip) {continue;}\n l1.push(list[i]);\n }\n let size = l1.length;\n for (let i = l1.length - 1; i >= 0; --i) {\n if (l1[i] == 0) { break; }\n size = i;\n }\n const l2 = l1.slice(0,size);\n if (l2.length == 0) return 0;\n const black = l2;\n const white = l2.map(e=>e==1?0:1);\n const blackSum = _.sumArray(black);\n const whiteSum = _.sumArray(white);\n const blackMax = _.sum(black);\n const whiteMax = _.sum(white);\n const pre = [];\n pre.push(whiteMax);\n for (let i = 0; i < black.length; ++i) {\n pre.push(blackSum[i]+(whiteMax - whiteSum[i]));\n }\n return _.min(pre);\n }\n}\n\nclass Mod {\n constructor(mod) {\n if (mod == null) { mod = Combinatorics.DefaultMod; }\n this.mod = mod;\n }\n mult(a,b) {\n let ret = 0;\n a %= this.mod;\n b %= this.mod;\n while (b) {\n if (b&1) {\n ret += a;\n if (ret > this.mod) { ret -= this.mod; }\n }\n a <<= 1;\n if (a > this.mod) { a -= this.mod; }\n b >>= 1;\n }\n return ret;\n }\n pow(a,b) {\n let ret = 1;\n while(b) {\n if (b&1) { ret = this.mult(ret,a); }\n a = this.mult(a,a);\n b >>= 1;\n }\n return ret;\n }\n div(a,b) { return this.mult(a, this.pow(b, this.mod-2)) }\n comb(n,k) { return MOD.mult(factTable[n],MOD.mult(invFactTable[k],invFactTable[n-k])); }\n}\nconst MOD = new Mod(998244353);\n\nclass Underscore {\n sum(arr) { return arr.reduce((a,b)=>a+b); }\n modSum(arr,mod) { if (mod == null) { mod = MOD.mod; } return arr.reduce((a,b)=>(a+b)%mod); }\n min(arr, func) { if (func == null) {func = (a,b) => a - b} return arr.reduce((a,b) => func(a,b) < 0 ? a : b); }\n max(arr, func) { if (func == null) {func = (a,b) => a - b} return arr.reduce((a,b) => func(a,b) > 0 ? a : b); }\n sort(arr, func) { if (func == null) {func = (a,b) => a - b} return arr.sort(func) }\n uniq(arr) { \n arr.sort();\n for(let i = 0; i < arr.length - 1; ++i) { \n arr[i] = arr[i+1] == arr[i] ? null : arr[i]; \n }\n return arr.filter(e => e != null);\n }\n range(start, stop, step) {\n if (stop == null) { stop = start || 0; start = 0; }\n if (!step) { step = stop < start ? -1 : 1; }\n const length = Math.max(Math.ceil((stop - start) / step), 0);\n const range = Array(length);\n for (var idx = 0; idx < length; idx++, start += step) { range[idx] = start; }\n return range;\n }\n first (array, n) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null) return array[0];\n return this.initial(array, array.length - n);\n };\n initial (array, n) { return array.slice.call(array, 0, Math.max(0, array.length - (n == null ? 1 : n))); }\n tail(array, n) { return array.slice.call(array, n == null ? 1 : n); }\n last (array, n) { if (n == null) return array[array.length - 1]; return this.tail(array, Math.max(0, array.length - n)); }\n sumArray (arr) { return this.tail(arr.reduce(((a,b,i) => {a.push(b + a[i]); return a}), [0])); }\n diffArray (arr) { const s = []; for (let i = 1; i < arr.length; ++i) { s.push(arr[i] - arr[i-1]); } return s; }\n // 配列の値以下の最大のindex\n binarySearch (array, key, iteratee) {\n const itr = (obj) => (typeof obj === 'object') ? obj[iteratee] : obj;\n const value = itr(key);\n let low = 0, high = array.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n if (itr(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n };\n}\nconst _ = new Underscore();\n\nclass Input {\n constructor() {\n this.cursor = 0;\n this.inputAll();\n }\n\n inputAll() {\n this.data = (require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")).split('\\n');\n return this.data;\n }\n\n /* 1行 or 複数行文字列 */\n nextLine(n) {\n if (n) {\n const ret = this.data.slice(this.cursor, this.cursor + n);\n this.cursor += n;\n return ret;\n }\n return this.data[this.cursor++];\n }\n /* 1整数 */\n nextInt() { return parseInt(this.nextLine()); } \n /* 一行文字配列 */\n nextStrArr() { return this.nextLine().split(' '); } \n /* 一行整数配列 */\n nextIntArr() { return this.nextStrArr().map((e) => parseInt(e)); }\n /* 一行浮動小数点配列 */\n nextFloatArr() { return this.nextStrArr().map((e) => parseFloat(e)); }\n /* 複数行整数配列 */\n nextIntLine(n) { return this.nextLine(n).map((e) => parseInt(e)) }\n /* 複数行浮動小数点配列 */\n nextFloatLine(n) { return this.nextLine(n).map((e) => parseFloat(e)) }\n /* 複数行文字列二次元配列 */\n nextStrRange(n) { return this.nextLine(n).map((line) => line.split(' ')); }\n /* 複数行整数二次元配列 */\n nextIntRange(n) {\n return this.nextLine(n).map((line) => line.split(' ').map((e) => parseInt(e)));\n }\n /* 複数行浮動小数点数二次元配列 */\n nextFloatRange(n) {\n return this.nextLine(n).map((line) => line.split(' ').map((e) => parseFloat(e)));\n }\n} \nconst input = new Input();\n\nclass Out {\n constructor() {\n this.option = {\n 'true': 'Yes',\n 'false': 'No',\n };\n }\n write(output){\n let ret;\n if (output == null) return;\n if (output === true) { ret = this.option['true']; }\n else if (output === false) { ret = this.option['false']; }\n else { ret = output; }\n console.log(ret);\n }\n bool(option) {\n this.option['false'] = option[0];\n this.option['true'] = option[1];\n return this;\n }\n}\nconst out = new Out();\n\nout.write(new Main().solve());\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "sample_input": "3\n#.#\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03063", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N stones arranged in a row. Every stone is painted white or black.\nA string S represents the color of the stones. The i-th stone from the left is white if the i-th character of S is ., and the stone is black if the character is #.\n\nTakahashi wants to change the colors of some stones to black or white so that there will be no white stone immediately to the right of a black stone.\nFind the minimum number of stones that needs to be recolored.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\nS is a string of length N consisting of . and #.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\n\nOutput\n\nPrint the minimum number of stones that needs to be recolored.\n\nSample Input 1\n\n3\n#.#\n\nSample Output 1\n\n1\n\nIt is enough to change the color of the first stone to white.\n\nSample Input 2\n\n5\n#.##.\n\nSample Output 2\n\n2\n\nSample Input 3\n\n9\n.........\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 5688, "cpu_time_ms": 362, "memory_kb": 50980}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s040901102", "group_id": "codeNet:p03068", "input_text": "function Main(input) {\n // 数字\n var N = parseInt(input[0], 10);\n var S = input[1];\n var K = parseInt(input[2], 10);\n // 文字\n // var A = input[0];\n\n var changeStr = S.charAt(K - 1);\n var str = '';\n\n for (var i = 0; i < S.length; i++) {\n if (S.charAt(i) !== changeStr) {\n str += '*';\n } else {\n str += changeStr;\n }\n }\n console.log(str);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "language": "JavaScript", "metadata": {"date": 1555810329, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03068.html", "problem_id": "p03068", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03068/input.txt", "sample_output_relpath": "derived/input_output/data/p03068/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03068/JavaScript/s040901102.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s040901102", "user_id": "u709108999"}, "prompt_components": {"gold_output": "*rr*r\n", "input_to_evaluate": "function Main(input) {\n // 数字\n var N = parseInt(input[0], 10);\n var S = input[1];\n var K = parseInt(input[2], 10);\n // 文字\n // var A = input[0];\n\n var changeStr = S.charAt(K - 1);\n var str = '';\n\n for (var i = 0; i < S.length; i++) {\n if (S.charAt(i) !== changeStr) {\n str += '*';\n } else {\n str += changeStr;\n }\n }\n console.log(str);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(/\\n|\\s/));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "sample_input": "5\nerror\n2\n"}, "reference_outputs": ["*rr*r\n"], "source_document_id": "p03068", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S of length N consisting of lowercase English letters, and an integer K.\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nConstraints\n\n1 \\leq K \\leq N\\leq 10\n\nS is a string of length N consisting of lowercase English letters.\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nS\nK\n\nOutput\n\nPrint the string obtained by replacing every character in S that differs from the K-th character of S, with *.\n\nSample Input 1\n\n5\nerror\n2\n\nSample Output 1\n\n*rr*r\n\nThe second character of S is r. When we replace every character in error that differs from r with *, we get the string *rr*r.\n\nSample Input 2\n\n6\neleven\n5\n\nSample Output 2\n\ne*e*e*\n\nSample Input 3\n\n9\neducation\n7\n\nSample Output 3\n\n******i**", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 452, "cpu_time_ms": 891, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s736648164", "group_id": "codeNet:p03069", "input_text": "module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,\"a\",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p=\"\",t(t.s=0)}([function(e,r,t){t(1)(t(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,r){e.exports=function(e){for(var r=e.split(\"\\n\"),t=Number(r[0]),n=r[1].split(\"\"),o=0,u=0;uparseInt(inputs,10));\n a = nums[0]+(nums[0]-1);\n b = nums[1]+(nums[1]-1);\n c = nums[0]+(nums[1]);\n\tconsole.log(Math.max(a, b, c));\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557857468, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/JavaScript/s210382463.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s210382463", "user_id": "u720390023"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "function Main(input){\n\tinputs = input.trim().split(' ');\n\tnums = inputs.map(inputs=>parseInt(inputs,10));\n a = nums[0]+(nums[0]-1);\n b = nums[1]+(nums[1]-1);\n c = nums[0]+(nums[1]);\n\tconsole.log(Math.max(a, b, c));\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 282, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s573212982", "group_id": "codeNet:p03071", "input_text": "'use strict'\nfunction Main(input){\n input=input.trim().split(/\\s+/).map(x=>x-0);\n var A=input.shift();\n var B=input.shift();\n var result=Math.max(2*A-1,2*B-1,A+B);\n console.log(result);\n}\n\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "language": "JavaScript", "metadata": {"date": 1555185439, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/JavaScript/s573212982.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s573212982", "user_id": "u833932983"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "'use strict'\nfunction Main(input){\n input=input.trim().split(/\\s+/).map(x=>x-0);\n var A=input.shift();\n var B=input.shift();\n var result=Math.max(2*A-1,2*B-1,A+B);\n console.log(result);\n}\n\nMain(require('fs').readFileSync('/dev/stdin','utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 248, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s278852101", "group_id": "codeNet:p03071", "input_text": "\"use strict\";\nfunction Main(input) {\n let lines = input.split(\"\\n\");\n let ab = lines.shift().split(/\\s/).map((v) => v - 0);\n let A = ab[0], B = ab[1];\n let set = [[A, A-1], [A, B], [B, B-1]];\n let sum = set.map((v) => v[0] + v[1]);\n let ans = Math.max(...sum);\n console.log(ans);\n}\nif (typeof window == \"undefined\") Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1555182359, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03071.html", "problem_id": "p03071", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03071/input.txt", "sample_output_relpath": "derived/input_output/data/p03071/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03071/JavaScript/s278852101.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s278852101", "user_id": "u043150661"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "\"use strict\";\nfunction Main(input) {\n let lines = input.split(\"\\n\");\n let ab = lines.shift().split(/\\s/).map((v) => v - 0);\n let A = ab[0], B = ab[1];\n let set = [[A, A-1], [A, B], [B, B-1]];\n let sum = set.map((v) => v[0] + v[1]);\n let ans = Math.max(...sum);\n console.log(ans);\n}\nif (typeof window == \"undefined\") Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "sample_input": "5 3\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03071", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are two buttons, one of size A and one of size B.\n\nWhen you press a button of size X, you get X coins and the size of that button decreases by 1.\n\nYou will press a button twice. Here, you can press the same button twice, or press both buttons once.\n\nAt most how many coins can you get?\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq A, B \\leq 20\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the maximum number of coins you can get.\n\nSample Input 1\n\n5 3\n\nSample Output 1\n\n9\n\nYou can get 5 + 4 = 9 coins by pressing the button of size 5 twice, and this is the maximum result.\n\nSample Input 2\n\n3 4\n\nSample Output 2\n\n7\n\nSample Input 3\n\n6 6\n\nSample Output 3\n\n12", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 392, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s728634155", "group_id": "codeNet:p03072", "input_text": "function main(input) {\n\tvar mt = input.split(/\\n/)[0];\n \tvar height = input.split(/\\n/)[1].split(/\\s/);\n \tvar maxHeight = 0;\n \tvar num = 0;\n \tfor (var i = 0; i <= mt; i++) {\n \tif (height[i] > maxHeight) {\n \tmaxHeight = height[i];\n \tnum++;\n }\n }\n \tconsole.log(num);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1555187937, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03072.html", "problem_id": "p03072", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03072/input.txt", "sample_output_relpath": "derived/input_output/data/p03072/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03072/JavaScript/s728634155.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s728634155", "user_id": "u661899295"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function main(input) {\n\tvar mt = input.split(/\\n/)[0];\n \tvar height = input.split(/\\n/)[1].split(/\\s/);\n \tvar maxHeight = 0;\n \tvar num = 0;\n \tfor (var i = 0; i <= mt; i++) {\n \tif (height[i] > maxHeight) {\n \tmaxHeight = height[i];\n \tnum++;\n }\n }\n \tconsole.log(num);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "sample_input": "4\n6 5 6 8\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03072", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N mountains ranging from east to west, and an ocean to the west.\n\nAt the top of each mountain, there is an inn. You have decided to choose where to stay from these inns.\n\nThe height of the i-th mountain from the west is H_i.\n\nYou can certainly see the ocean from the inn at the top of the westmost mountain.\n\nFor the inn at the top of the i-th mountain from the west (i = 2, 3, ..., N), you can see the ocean if and only if H_1 \\leq H_i, H_2 \\leq H_i, ..., and H_{i-1} \\leq H_i.\n\nFrom how many of these N inns can you see the ocean?\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 20\n\n1 \\leq H_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the number of inns from which you can see the ocean.\n\nSample Input 1\n\n4\n6 5 6 8\n\nSample Output 1\n\n3\n\nYou can see the ocean from the first, third and fourth inns from the west.\n\nSample Input 2\n\n5\n4 5 3 5 4\n\nSample Output 2\n\n3\n\nSample Input 3\n\n5\n9 5 6 8 4\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 358, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s198713067", "group_id": "codeNet:p03073", "input_text": "function Main(input) {\n var odd = 0;\n var even = 0;\n\tfor(var i = 0; i < input.length; i = i + 2) {\n if (input[i] === '0') {\n even++;\n } else {\n odd++;\n }\n\t}\n\tfor(var i = 1; i < input.length; i = i + 2) {\n if (input[i] === '0') {\n odd++;\n } else {\n even++;\n }\n\t}\n console.log(even > odd ? odd : even);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1556050734, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03073.html", "problem_id": "p03073", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03073/input.txt", "sample_output_relpath": "derived/input_output/data/p03073/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03073/JavaScript/s198713067.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s198713067", "user_id": "u888733083"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n var odd = 0;\n var even = 0;\n\tfor(var i = 0; i < input.length; i = i + 2) {\n if (input[i] === '0') {\n even++;\n } else {\n odd++;\n }\n\t}\n\tfor(var i = 1; i < input.length; i = i + 2) {\n if (input[i] === '0') {\n odd++;\n } else {\n even++;\n }\n\t}\n console.log(even > odd ? odd : even);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03073", "source_text": "Score : 300 points\n\nProblem Statement\n\nN tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N.\n\nThe i-th tile from the left is painted black if the i-th character of S is 0, and painted white if that character is 1.\n\nYou want to repaint some of the tiles black or white, so that any two adjacent tiles have different colors.\n\nAt least how many tiles need to be repainted to satisfy the condition?\n\nConstraints\n\n1 \\leq |S| \\leq 10^5\n\nS_i is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the minimum number of tiles that need to be repainted to satisfy the condition.\n\nSample Input 1\n\n000\n\nSample Output 1\n\n1\n\nThe condition can be satisfied by repainting the middle tile white.\n\nSample Input 2\n\n10010010\n\nSample Output 2\n\n3\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 434, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s652703576", "group_id": "codeNet:p03074", "input_text": "const main = (input) => {\n var ip = input.trim().split(\"\\n\")[0].split(\" \");\n var N = ip[0]-0;\n var K = ip[1]-0;\n if(N<=K/2){\n console.log(N);\n return;\n }\n var inputs = input.trim().split(\"\\n\")[1].split(\"\");\n var ans = 0;\n for(var s=0;s {\n var ip = input.trim().split(\"\\n\")[0].split(\" \");\n var N = ip[0]-0;\n var K = ip[1]-0;\n if(N<=K/2){\n console.log(N);\n return;\n }\n var inputs = input.trim().split(\"\\n\")[1].split(\"\");\n var ans = 0;\n for(var s=0;su;i--){var f=t[i]-t[u];if(Math.abs(f)>o)return void console.log(\":(\")}console.log(\"Yay!\")}},function(e,r){e.exports=require(\"fs\")}]);", "language": "JavaScript", "metadata": {"date": 1566460264, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s399451226.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s399451226", "user_id": "u501148202"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,\"a\",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p=\"\",t(t.s=0)}([function(e,r,t){t(1)(t(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,r){e.exports=function(e){for(var r=e.split(\"\\n\"),t=[],n=0;n<5;n++)t.push(Number(r[n]));for(var o=Number(r[5]),u=0;u<5;u++)for(var i=4;i>u;i--){var f=t[i]-t[u];if(Math.abs(f)>o)return void console.log(\":(\")}console.log(\"Yay!\")}},function(e,r){e.exports=require(\"fs\")}]);", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1276, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s688802378", "group_id": "codeNet:p03075", "input_text": "function Main(input){\n inputs = input.split('\\n');\n //console.log(inputs);\n if(inputs[4] - inputs[0] <=inputs[5]){\n console.log('Yay!');\n }else{\n console.log(':(');\n }\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557856091, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s688802378.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688802378", "user_id": "u720390023"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "function Main(input){\n inputs = input.split('\\n');\n //console.log(inputs);\n if(inputs[4] - inputs[0] <=inputs[5]){\n console.log('Yay!');\n }else{\n console.log(':(');\n }\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 255, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s717616833", "group_id": "codeNet:p03075", "input_text": "function main(args) {\n\tvar input = args.split(/\\n/);\n \tconsole.log((input[4] * 1 - input[0] * 1 <= k) ? \":(\" : \"Yay!\");\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1554626155, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s717616833.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s717616833", "user_id": "u661899295"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "function main(args) {\n\tvar input = args.split(/\\n/);\n \tconsole.log((input[4] * 1 - input[0] * 1 <= k) ? \":(\" : \"Yay!\");\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 178, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s514365734", "group_id": "codeNet:p03075", "input_text": "let main = (args) => {\n\tlet input = args.split(/\\n/);\n \tconsole.log((input[4] - input[0] <= k) ? \":(\" : \"Yay!\");\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1554625939, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s514365734.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s514365734", "user_id": "u661899295"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "let main = (args) => {\n\tlet input = args.split(/\\n/);\n \tconsole.log((input[4] - input[0] <= k) ? \":(\" : \"Yay!\");\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 171, "cpu_time_ms": 50, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s748368244", "group_id": "codeNet:p03075", "input_text": "input = a.split('\\n').map(Number);\n\nk = input[input.length - 1];\nflag = 0;\n\nfor (i = 0; i < 5; i++) {\n for (j = 0; j < 5; j++) {\n flag += Math.abs(input[i] - input[j]) > k;\n }\n}\n\nconsole.log(flag == 0 ? 'Yay!' : ':(');", "language": "JavaScript", "metadata": {"date": 1554577809, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s748368244.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s748368244", "user_id": "u646148705"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "input = a.split('\\n').map(Number);\n\nk = input[input.length - 1];\nflag = 0;\n\nfor (i = 0; i < 5; i++) {\n for (j = 0; j < 5; j++) {\n flag += Math.abs(input[i] - input[j]) > k;\n }\n}\n\nconsole.log(flag == 0 ? 'Yay!' : ':(');", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 231, "cpu_time_ms": 174, "memory_kb": 20936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s929528445", "group_id": "codeNet:p03075", "input_text": "'use strict';\nfunction Main(input) {\n input = input.split(\"\\n\");\n let tmp = input[0].split(\" \");\n console.log(input);\n for(let i=0;i<5;i++){\n for(let j = i;j<5;j++){\n //console.log(`A:${input[i]} vs B:${input[j]} = abs:${input[i]-input[j]}`)\n\n if (Math.abs(input[i]-input[j])>input[5]){\n console.log(\":(\");\n return;\n }\n }\n }\n console.log(\"Yay!\");\n return;\n}\n/*\nMain(`1\n2\n4\n8\n9\n15`);\n*/\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1554577802, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s929528445.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s929528445", "user_id": "u913483976"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "'use strict';\nfunction Main(input) {\n input = input.split(\"\\n\");\n let tmp = input[0].split(\" \");\n console.log(input);\n for(let i=0;i<5;i++){\n for(let j = i;j<5;j++){\n //console.log(`A:${input[i]} vs B:${input[j]} = abs:${input[i]-input[j]}`)\n\n if (Math.abs(input[i]-input[j])>input[5]){\n console.log(\":(\");\n return;\n }\n }\n }\n console.log(\"Yay!\");\n return;\n}\n/*\nMain(`1\n2\n4\n8\n9\n15`);\n*/\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 539, "cpu_time_ms": 511, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s676245007", "group_id": "codeNet:p03075", "input_text": "function Main(input) {\n\ttmp = input.split(\"\\n\");\n\t\n\tvar a = parseInt(tmp[0]);\n\tvar b = parseInt(tmp[1]);\n\tvar c = parseInt(tmp[2]);\n\tvar d = parseInt(tmp[3]);\n\tvar e = parseInt(tmp[4]);\n\tvar k = parseInt(tmp[5]);\n\tvar err = 0;\n\t\n\tif(b-a > k){ err++; }\n\tif(c-a > k){ err++; }\n\tif(d-a > k){ err++; }\n\tif(e-a > k){ err++; }\n\tif(c-b > k){ err++; }\n\tif(d-b > k){ err++; }\n\tif(e-b > k){ err++; }\n\tif(d-c > k){ err++; }\n\tif(e-c > k){ err++; }\n\tif(e-d > k){ err++; }\n\t\n\tif(err>=1){\n\t\tconsole.log(\":(\");\n\t}else{\n\t\tconsole.log(\"Yay!\");\n\t}\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1554577610, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03075.html", "problem_id": "p03075", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03075/input.txt", "sample_output_relpath": "derived/input_output/data/p03075/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03075/JavaScript/s676245007.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s676245007", "user_id": "u279753178"}, "prompt_components": {"gold_output": "Yay!\n", "input_to_evaluate": "function Main(input) {\n\ttmp = input.split(\"\\n\");\n\t\n\tvar a = parseInt(tmp[0]);\n\tvar b = parseInt(tmp[1]);\n\tvar c = parseInt(tmp[2]);\n\tvar d = parseInt(tmp[3]);\n\tvar e = parseInt(tmp[4]);\n\tvar k = parseInt(tmp[5]);\n\tvar err = 0;\n\t\n\tif(b-a > k){ err++; }\n\tif(c-a > k){ err++; }\n\tif(d-a > k){ err++; }\n\tif(e-a > k){ err++; }\n\tif(c-b > k){ err++; }\n\tif(d-b > k){ err++; }\n\tif(e-b > k){ err++; }\n\tif(d-c > k){ err++; }\n\tif(e-c > k){ err++; }\n\tif(e-d > k){ err++; }\n\t\n\tif(err>=1){\n\t\tconsole.log(\":(\");\n\t}else{\n\t\tconsole.log(\"Yay!\");\n\t}\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "sample_input": "1\n2\n4\n8\n9\n15\n"}, "reference_outputs": ["Yay!\n"], "source_document_id": "p03075", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.\n\nTwo antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.\n\nDetermine if there exists a pair of antennas that cannot communicate directly.\n\nHere, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.\n\nConstraints\n\na, b, c, d, e and k are integers between 0 and 123 (inclusive).\n\na < b < c < d < e\n\nInput\n\nInput is given from Standard Input in the following format:\n\na\nb\nc\nd\ne\nk\n\nOutput\n\nPrint :( if there exists a pair of antennas that cannot communicate directly, and print Yay! if there is no such pair.\n\nSample Input 1\n\n1\n2\n4\n8\n9\n15\n\nSample Output 1\n\nYay!\n\nIn this case, there is no pair of antennas that cannot communicate directly, because:\n\nthe distance between A and B is 2 - 1 = 1\n\nthe distance between A and C is 4 - 1 = 3\n\nthe distance between A and D is 8 - 1 = 7\n\nthe distance between A and E is 9 - 1 = 8\n\nthe distance between B and C is 4 - 2 = 2\n\nthe distance between B and D is 8 - 2 = 6\n\nthe distance between B and E is 9 - 2 = 7\n\nthe distance between C and D is 8 - 4 = 4\n\nthe distance between C and E is 9 - 4 = 5\n\nthe distance between D and E is 9 - 8 = 1\n\nand none of them is greater than 15. Thus, the correct output is Yay!.\n\nSample Input 2\n\n15\n18\n26\n35\n36\n18\n\nSample Output 2\n\n:(\n\nIn this case, the distance between antennas A and D is 35 - 15 = 20 and exceeds 18, so they cannot communicate directly.\nThus, the correct output is :(.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 587, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s598962526", "group_id": "codeNet:p03076", "input_text": "'use strict'\nfunction Main(input){\n input=input.trim().split(/\\s+/).map(x=>x-0);\n var r=input.map(x=>x%10);\n var M=Math.max.apply(null,r);\n var m=Math.min.apply(null,r);\n input=input.map(x=>x-x%10);\n var result=input.reduce((a,c)=>a+c,0)+r.map(x=>x?10:0).reduce((a,c)=>a+c,0)-(m?10:0)+m;\n console.log(result);\n}\n\nMain(require('fs').readFileSync('/dev/stdin','utf8'));\n", "language": "JavaScript", "metadata": {"date": 1554580035, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/JavaScript/s598962526.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s598962526", "user_id": "u833932983"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "'use strict'\nfunction Main(input){\n input=input.trim().split(/\\s+/).map(x=>x-0);\n var r=input.map(x=>x%10);\n var M=Math.max.apply(null,r);\n var m=Math.min.apply(null,r);\n input=input.map(x=>x-x%10);\n var result=input.reduce((a,c)=>a+c,0)+r.map(x=>x?10:0).reduce((a,c)=>a+c,0)-(m?10:0)+m;\n console.log(result);\n}\n\nMain(require('fs').readFileSync('/dev/stdin','utf8'));\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 375, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s558698473", "group_id": "codeNet:p03076", "input_text": "\"use strict\";\n \nconst main = arg => {\n arg = arg.split(\"\\n\");\n const times = arg.map(n=>parseInt(n));\n let timer = 0;\n let min = 10;\n \n let sum = 0;\n \n for(let i in times) {\n let digitOne = parseInt(String(times[i]).split(\"\").pop());\n let digitMinus = 10 - digitOne;\n sum += parseInt(times[i]);\n \n if(digitMinus !== 10) {\n sum += digitMinus;\n }\n \n if(digitMinus !== 10 && digitOne < min) {\n min = digitOne;\n }\n }\n\n console.log(sum - (10 - min));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1554579547, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/JavaScript/s558698473.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s558698473", "user_id": "u598795006"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "\"use strict\";\n \nconst main = arg => {\n arg = arg.split(\"\\n\");\n const times = arg.map(n=>parseInt(n));\n let timer = 0;\n let min = 10;\n \n let sum = 0;\n \n for(let i in times) {\n let digitOne = parseInt(String(times[i]).split(\"\").pop());\n let digitMinus = 10 - digitOne;\n sum += parseInt(times[i]);\n \n if(digitMinus !== 10) {\n sum += digitMinus;\n }\n \n if(digitMinus !== 10 && digitOne < min) {\n min = digitOne;\n }\n }\n\n console.log(sum - (10 - min));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 625, "cpu_time_ms": 54, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s144480062", "group_id": "codeNet:p03076", "input_text": "\"use strict\";\nfunction main(input) {\n const args = input.split('\\n');\n\n let ans_time = 0;\n let first = 9;\n let food_first;\n let flag = false\n\n for(var i = 0; i < args.length - 1; i++) {\n const food = parseInt(args[i]);\n ans_time += Math.ceil(food / 10) * 10;\n food_first = food % 10;\n if (food_first !== 0 && food_first <= first) {\n first = food_first;\n flag = true;\n }\n }\n if (!flag) { first = 10; }\n console.log(ans_time - 10 + first);\n\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1554579239, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03076.html", "problem_id": "p03076", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03076/input.txt", "sample_output_relpath": "derived/input_output/data/p03076/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03076/JavaScript/s144480062.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s144480062", "user_id": "u044133843"}, "prompt_components": {"gold_output": "215\n", "input_to_evaluate": "\"use strict\";\nfunction main(input) {\n const args = input.split('\\n');\n\n let ans_time = 0;\n let first = 9;\n let food_first;\n let flag = false\n\n for(var i = 0; i < args.length - 1; i++) {\n const food = parseInt(args[i]);\n ans_time += Math.ceil(food / 10) * 10;\n food_first = food % 10;\n if (food_first !== 0 && food_first <= first) {\n first = food_first;\n flag = true;\n }\n }\n if (!flag) { first = 10; }\n console.log(ans_time - 10 + first);\n\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "sample_input": "29\n20\n7\n35\n120\n"}, "reference_outputs": ["215\n"], "source_document_id": "p03076", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe restaurant AtCoder serves the following five dishes:\n\nABC Don (rice bowl): takes A minutes to serve.\n\nARC Curry: takes B minutes to serve.\n\nAGC Pasta: takes C minutes to serve.\n\nAPC Ramen: takes D minutes to serve.\n\nATC Hanbagu (hamburger patty): takes E minutes to serve.\n\nHere, the time to serve a dish is the time between when an order is placed and when the dish is delivered.\n\nThis restaurant has the following rules on orders:\n\nAn order can only be placed at a time that is a multiple of 10 (time 0, 10, 20, ...).\n\nOnly one dish can be ordered at a time.\n\nNo new order can be placed when an order is already placed and the dish is still not delivered, but a new order can be placed at the exact time when the dish is delivered.\n\nE869120 arrives at this restaurant at time 0. He will order all five dishes. Find the earliest possible time for the last dish to be delivered.\n\nHere, he can order the dishes in any order he likes, and he can place an order already at time 0.\n\nConstraints\n\nA, B, C, D and E are integers between 1 and 123 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the earliest possible time for the last dish to be delivered, as an integer.\n\nSample Input 1\n\n29\n20\n7\n35\n120\n\nSample Output 1\n\n215\n\nIf we decide to order the dishes in the order ABC Don, ARC Curry, AGC Pasta, ATC Hanbagu, APC Ramen, the earliest possible time for each order is as follows:\n\nOrder ABC Don at time 0, which will be delivered at time 29.\n\nOrder ARC Curry at time 30, which will be delivered at time 50.\n\nOrder AGC Pasta at time 50, which will be delivered at time 57.\n\nOrder ATC Hanbagu at time 60, which will be delivered at time 180.\n\nOrder APC Ramen at time 180, which will be delivered at time 215.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 2\n\n101\n86\n119\n108\n57\n\nSample Output 2\n\n481\n\nIf we decide to order the dishes in the order AGC Pasta, ARC Curry, ATC Hanbagu, APC Ramen, ABC Don, the earliest possible time for each order is as follows:\n\nOrder AGC Pasta at time 0, which will be delivered at time 119.\n\nOrder ARC Curry at time 120, which will be delivered at time 206.\n\nOrder ATC Hanbagu at time 210, which will be delivered at time 267.\n\nOrder APC Ramen at time 270, which will be delivered at time 378.\n\nOrder ABC Don at time 380, which will be delivered at time 481.\n\nThere is no way to order the dishes in which the last dish will be delivered earlier than this.\n\nSample Input 3\n\n123\n123\n123\n123\n123\n\nSample Output 3\n\n643\n\nThis is the largest valid case.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 581, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s054661330", "group_id": "codeNet:p03077", "input_text": "'use strict'\nfunction Main(input) {\n const numP = input.split(\"\\n\").map(Number);\n numP.pop();\n let numG = numP[0];\n numP.shift();\n // console.log({ numG, numP });\n\n numP.sort((a, b) => a - b);\n // console.log({ numG, numP });\n\n let btlNeck = Math.ceil(numG / numP[0]);\n let Ans = btlNeck + 4;\n console.log(Ans);\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1576503475, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/JavaScript/s054661330.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s054661330", "user_id": "u880930934"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "'use strict'\nfunction Main(input) {\n const numP = input.split(\"\\n\").map(Number);\n numP.pop();\n let numG = numP[0];\n numP.shift();\n // console.log({ numG, numP });\n\n numP.sort((a, b) => a - b);\n // console.log({ numG, numP });\n\n let btlNeck = Math.ceil(numG / numP[0]);\n let Ans = btlNeck + 4;\n console.log(Ans);\n\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 380, "cpu_time_ms": 218, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s006762038", "group_id": "codeNet:p03077", "input_text": "function Main(input) {\n var list = input.split(\"\\n\").map(s => parseInt(s, 10));\n var min = list[1];\n var ans = 0;\n var last = 10;\n \n for (i = 1; i < 6; i++) {\n if (list[i] < min) min = list[i];\n }\n \n ans = Math.floor((list[0]-1)/min) + 5;\n \n console.log(ans);\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1555398583, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/JavaScript/s006762038.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s006762038", "user_id": "u544437817"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "function Main(input) {\n var list = input.split(\"\\n\").map(s => parseInt(s, 10));\n var min = list[1];\n var ans = 0;\n var last = 10;\n \n for (i = 1; i < 6; i++) {\n if (list[i] < min) min = list[i];\n }\n \n ans = Math.floor((list[0]-1)/min) + 5;\n \n console.log(ans);\n}\n \nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 333, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s683823456", "group_id": "codeNet:p03077", "input_text": "\"use strict\";\nfunction Main(input) {\n let T = input.split(\"\\n\").map((v) => v - 0);\n let N = T[0];\n let min = Math.min(...T.slice(1, 6));\n let t = Math.ceil(N / min) + 4;\n console.log(t);\n}\nif (typeof window === 'undefined') Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1554586491, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/JavaScript/s683823456.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s683823456", "user_id": "u043150661"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "\"use strict\";\nfunction Main(input) {\n let T = input.split(\"\\n\").map((v) => v - 0);\n let N = T[0];\n let min = Math.min(...T.slice(1, 6));\n let t = Math.ceil(N / min) + 4;\n console.log(t);\n}\nif (typeof window === 'undefined') Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 295, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s099856149", "group_id": "codeNet:p03077", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var A = ~~input[1];\n var B = ~~input[2];\n var C = ~~input[3];\n var D = ~~input[4];\n var E = ~~input[5];\n\n\n var AtCoder = function(N,A,B,C,D,E){\n this.move = [A,B,C,D,E];\n this.memNum = N;\n };\n\n AtCoder.prototype = {\n procedure: function(){\n return Math.ceil(this.memNum/Math.min(...this.move))+4;\n }\n }\n var atcoder = new AtCoder(N,A,B,C,D,E);\n console.log(atcoder.procedure());\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1554585577, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03077.html", "problem_id": "p03077", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03077/input.txt", "sample_output_relpath": "derived/input_output/data/p03077/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03077/JavaScript/s099856149.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s099856149", "user_id": "u849530909"}, "prompt_components": {"gold_output": "7\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n var A = ~~input[1];\n var B = ~~input[2];\n var C = ~~input[3];\n var D = ~~input[4];\n var E = ~~input[5];\n\n\n var AtCoder = function(N,A,B,C,D,E){\n this.move = [A,B,C,D,E];\n this.memNum = N;\n };\n\n AtCoder.prototype = {\n procedure: function(){\n return Math.ceil(this.memNum/Math.min(...this.move))+4;\n }\n }\n var atcoder = new AtCoder(N,A,B,C,D,E);\n console.log(atcoder.procedure());\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "5\n3\n2\n4\n3\n5\n"}, "reference_outputs": ["7\n"], "source_document_id": "p03077", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn 2028 and after a continuous growth, AtCoder Inc. finally built an empire with six cities (City 1, 2, 3, 4, 5, 6)!\n\nThere are five means of transport in this empire:\n\nTrain: travels from City 1 to 2 in one minute. A train can occupy at most A people.\n\nBus: travels from City 2 to 3 in one minute. A bus can occupy at most B people.\n\nTaxi: travels from City 3 to 4 in one minute. A taxi can occupy at most C people.\n\nAirplane: travels from City 4 to 5 in one minute. An airplane can occupy at most D people.\n\nShip: travels from City 5 to 6 in one minute. A ship can occupy at most E people.\n\nFor each of them, one vehicle leaves the city at each integer time (time 0, 1, 2, ...).\n\nThere is a group of N people at City 1, and they all want to go to City 6.\n\nAt least how long does it take for all of them to reach there?\nYou can ignore the time needed to transfer.\n\nConstraints\n\n1 \\leq N, A, B, C, D, E \\leq 10^{15}\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA\nB\nC\nD\nE\n\nOutput\n\nPrint the minimum time required for all of the people to reach City 6, in minutes.\n\nSample Input 1\n\n5\n3\n2\n4\n3\n5\n\nSample Output 1\n\n7\n\nOne possible way to travel is as follows.\nFirst, there are N = 5 people at City 1, as shown in the following image:\n\nIn the first minute, three people travels from City 1 to City 2 by train. Note that a train can only occupy at most three people.\n\nIn the second minute, the remaining two people travels from City 1 to City 2 by train, and two of the three people who were already at City 2 travels to City 3 by bus. Note that a bus can only occupy at most two people.\n\nIn the third minute, two people travels from City 2 to City 3 by train, and another two people travels from City 3 to City 4 by taxi.\n\nFrom then on, if they continue traveling without stopping until they reach City 6, all of them can reach there in seven minutes.\n\nThere is no way for them to reach City 6 in 6 minutes or less.\n\nSample Input 2\n\n10\n123\n123\n123\n123\n123\n\nSample Output 2\n\n5\n\nAll kinds of vehicles can occupy N = 10 people at a time.\nThus, if they continue traveling without stopping until they reach City 6, all of them can reach there in five minutes.\n\nSample Input 3\n\n10000000007\n2\n3\n5\n7\n11\n\nSample Output 3\n\n5000000008\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 547, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s863342611", "group_id": "codeNet:p03078", "input_text": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(v)\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\nfunction PriorityQueue(){\n this.heap = [];\n}\nPriorityQueue.prototype = {\n push : function(x){\n var i = this.heap.length++;\n while(i){\n var j = i - 1 >> 1;\n if(x >= this.heap[j])break;\n this.heap[i] = this.heap[j];\n i = j;\n }\n this.heap[i] = x;\n },\n pop : function(){\n var r = this.heap[0];\n var x = this.heap.pop();\n var i = 0;\n var k = this.heap.length >> 1;\n while (i < k) {\n var j = (i << 1) + 1;\n if(this.heap[j] > this.heap[j+1])++j;\n if(x <= this.heap[j])break;\n this.heap[i] = this.heap[j];\n i = j;\n }\n if(this.heap.length)this.heap[i] = x;\n return r;\n },\n size : function(){return this.heap.length;},\n top : function(){return this.heap[0];},\n};\n\nconsole.log(main());\nfunction main(){\n var x = o.a();\n var y = o.a();\n var z = o.a();\n var k = o.a();\n var a = o.l().sort((a,b)=>b-a);\n var b = o.l().sort((a,b)=>b-a);\n var c = o.l().sort((a,b)=>b-a);\n var pq = new PriorityQueue();\n for(var i = 0; i < x; i++){\n for(var j = 0; j < y; j++){\n var p = a[i] + b[j];\n if(pq.size() === k){\n var t = pq.top();\n if(p <= t)break;\n pq.push(p);\n pq.pop();\n }else pq.push(p);\n }\n }\n var pq2 = new PriorityQueue();\n while(pq.size()){\n var q = pq.pop();\n for(var i = 0; i < z; i++){\n var p = q + c[i];\n if(pq2.size() === k){\n var t = pq.top();\n if(p <= t)break;\n pq2.push(p);\n pq2.pop();\n }else pq2.push(p);\n }\n }\n var ans = [];\n for(var i = 0; i < k; i++)ans.push(pq2.pop());\n return ans.reverse().join(\"\\n\");\n}", "language": "JavaScript", "metadata": {"date": 1554632974, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03078.html", "problem_id": "p03078", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03078/input.txt", "sample_output_relpath": "derived/input_output/data/p03078/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03078/JavaScript/s863342611.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s863342611", "user_id": "u643613120"}, "prompt_components": {"gold_output": "19\n17\n15\n14\n13\n12\n10\n8\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(v)\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\nfunction PriorityQueue(){\n this.heap = [];\n}\nPriorityQueue.prototype = {\n push : function(x){\n var i = this.heap.length++;\n while(i){\n var j = i - 1 >> 1;\n if(x >= this.heap[j])break;\n this.heap[i] = this.heap[j];\n i = j;\n }\n this.heap[i] = x;\n },\n pop : function(){\n var r = this.heap[0];\n var x = this.heap.pop();\n var i = 0;\n var k = this.heap.length >> 1;\n while (i < k) {\n var j = (i << 1) + 1;\n if(this.heap[j] > this.heap[j+1])++j;\n if(x <= this.heap[j])break;\n this.heap[i] = this.heap[j];\n i = j;\n }\n if(this.heap.length)this.heap[i] = x;\n return r;\n },\n size : function(){return this.heap.length;},\n top : function(){return this.heap[0];},\n};\n\nconsole.log(main());\nfunction main(){\n var x = o.a();\n var y = o.a();\n var z = o.a();\n var k = o.a();\n var a = o.l().sort((a,b)=>b-a);\n var b = o.l().sort((a,b)=>b-a);\n var c = o.l().sort((a,b)=>b-a);\n var pq = new PriorityQueue();\n for(var i = 0; i < x; i++){\n for(var j = 0; j < y; j++){\n var p = a[i] + b[j];\n if(pq.size() === k){\n var t = pq.top();\n if(p <= t)break;\n pq.push(p);\n pq.pop();\n }else pq.push(p);\n }\n }\n var pq2 = new PriorityQueue();\n while(pq.size()){\n var q = pq.pop();\n for(var i = 0; i < z; i++){\n var p = q + c[i];\n if(pq2.size() === k){\n var t = pq.top();\n if(p <= t)break;\n pq2.push(p);\n pq2.pop();\n }else pq2.push(p);\n }\n }\n var ans = [];\n for(var i = 0; i < k; i++)ans.push(pq2.pop());\n return ans.reverse().join(\"\\n\");\n}", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2405, "cpu_time_ms": 2109, "memory_kb": 12860}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s323212784", "group_id": "codeNet:p03078", "input_text": "\"use strict\";\nfunction I(s,f){this._s=s.split(\"\\n\");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(\" \");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(\" \").map(this._f)};\n\nfunction main(input) {\n const o = new I(input);\n\n var x = o.a();\n var y = o.a();\n var z = o.a();\n var k = o.a();\n\n var a = o.l();\n var b = o.l();\n var c = o.l();\n\n a.sort((a,b) => b-a);\n b.sort((a,b) => b-a);\n c.sort((a,b) => b-a);\n\n var ta = a[0] - a[1];\n var tb = b[0] - b[1];\n var tc = c[0] - c[1];\n\n var ai = 1, bi = 1, ci = 1;\n var count = (ai + 1) * (bi + 1) * (ci + 1);\n\n while (count < k) {\n if ( ta <= tb && ta <= tc) {\n ai += 1;\n } else if ( tb <= tc) {\n bi += 1;\n } else {\n ci += 1;\n }\n\n ta = (ai === a.length - 1) ? Infinity : a[0] - a[ai];\n tb = (bi === b.length - 1) ? Infinity : b[0] - b[bi];\n tc = (ci === c.length - 1) ? Infinity : c[0] - c[ci];\n count = (ai + 1) * (bi + 1) * (ci + 1);\n }\n\n var tm = Math.max(ta + tb, tb + tc, tc + ta);\n\n while (a[0] - a[ai] <= tm && ai < a.length) {\n ai += 1;\n }\n if ( ai === a.length) ai -= 1;\n while (b[0] - b[bi] <= tm && bi < b.length) {\n bi += 1;\n }\n if ( bi === b.length) bi -= 1;\n\n while (c[0] - c[ci] <= tm && ci < c.length) {\n ci += 1;\n }\n if ( ci === c.length) ci -= 1;\n\n var results = [];\n for(var ak = 0; ak <= ai; ak++){\n for(var bk = 0; bk <= bi; bk++){\n for(var ck = 0; ck <= ci; ck++){\n results.push(a[ak] + b[bk] + c[ck]);\n }\n }\n }\n\n results.sort((a,b)=> b - a);\n for(let i=0; i < k; i++) {\n console.log(results[i])\n }\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1554583026, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03078.html", "problem_id": "p03078", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03078/input.txt", "sample_output_relpath": "derived/input_output/data/p03078/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03078/JavaScript/s323212784.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s323212784", "user_id": "u439911726"}, "prompt_components": {"gold_output": "19\n17\n15\n14\n13\n12\n10\n8\n", "input_to_evaluate": "\"use strict\";\nfunction I(s,f){this._s=s.split(\"\\n\");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(\" \");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(\" \").map(this._f)};\n\nfunction main(input) {\n const o = new I(input);\n\n var x = o.a();\n var y = o.a();\n var z = o.a();\n var k = o.a();\n\n var a = o.l();\n var b = o.l();\n var c = o.l();\n\n a.sort((a,b) => b-a);\n b.sort((a,b) => b-a);\n c.sort((a,b) => b-a);\n\n var ta = a[0] - a[1];\n var tb = b[0] - b[1];\n var tc = c[0] - c[1];\n\n var ai = 1, bi = 1, ci = 1;\n var count = (ai + 1) * (bi + 1) * (ci + 1);\n\n while (count < k) {\n if ( ta <= tb && ta <= tc) {\n ai += 1;\n } else if ( tb <= tc) {\n bi += 1;\n } else {\n ci += 1;\n }\n\n ta = (ai === a.length - 1) ? Infinity : a[0] - a[ai];\n tb = (bi === b.length - 1) ? Infinity : b[0] - b[bi];\n tc = (ci === c.length - 1) ? Infinity : c[0] - c[ci];\n count = (ai + 1) * (bi + 1) * (ci + 1);\n }\n\n var tm = Math.max(ta + tb, tb + tc, tc + ta);\n\n while (a[0] - a[ai] <= tm && ai < a.length) {\n ai += 1;\n }\n if ( ai === a.length) ai -= 1;\n while (b[0] - b[bi] <= tm && bi < b.length) {\n bi += 1;\n }\n if ( bi === b.length) bi -= 1;\n\n while (c[0] - c[ci] <= tm && ci < c.length) {\n ci += 1;\n }\n if ( ci === c.length) ci -= 1;\n\n var results = [];\n for(var ak = 0; ak <= ai; ak++){\n for(var bk = 0; bk <= bi; bk++){\n for(var ck = 0; ck <= ci; ck++){\n results.push(a[ak] + b[bk] + c[ck]);\n }\n }\n }\n\n results.sort((a,b)=> b - a);\n for(let i=0; i < k; i++) {\n console.log(results[i])\n }\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "sample_input": "2 2 2 8\n4 6\n1 5\n3 8\n"}, "reference_outputs": ["19\n17\n15\n14\n13\n12\n10\n8\n"], "source_document_id": "p03078", "source_text": "Score: 400 points\n\nProblem Statement\n\nThe Patisserie AtCoder sells cakes with number-shaped candles.\nThere are X, Y and Z kinds of cakes with 1-shaped, 2-shaped and 3-shaped candles, respectively.\nEach cake has an integer value called deliciousness, as follows:\n\nThe deliciousness of the cakes with 1-shaped candles are A_1, A_2, ..., A_X.\n\nThe deliciousness of the cakes with 2-shaped candles are B_1, B_2, ..., B_Y.\n\nThe deliciousness of the cakes with 3-shaped candles are C_1, C_2, ..., C_Z.\n\nTakahashi decides to buy three cakes, one for each of the three shapes of the candles, to celebrate ABC 123.\n\nThere are X \\times Y \\times Z such ways to choose three cakes.\n\nWe will arrange these X \\times Y \\times Z ways in descending order of the sum of the deliciousness of the cakes.\n\nPrint the sums of the deliciousness of the cakes for the first, second, ..., K-th ways in this list.\n\nConstraints\n\n1 \\leq X \\leq 1 \\ 000\n\n1 \\leq Y \\leq 1 \\ 000\n\n1 \\leq Z \\leq 1 \\ 000\n\n1 \\leq K \\leq \\min(3 \\ 000, X \\times Y \\times Z)\n\n1 \\leq A_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq B_i \\leq 10 \\ 000 \\ 000 \\ 000\n\n1 \\leq C_i \\leq 10 \\ 000 \\ 000 \\ 000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y Z K\nA_1 \\ A_2 \\ A_3 \\ ... \\ A_X\nB_1 \\ B_2 \\ B_3 \\ ... \\ B_Y\nC_1 \\ C_2 \\ C_3 \\ ... \\ C_Z\n\nOutput\n\nPrint K lines. The i-th line should contain the i-th value stated in the problem statement.\n\nSample Input 1\n\n2 2 2 8\n4 6\n1 5\n3 8\n\nSample Output 1\n\n19\n17\n15\n14\n13\n12\n10\n8\n\nThere are 2 \\times 2 \\times 2 = 8 ways to choose three cakes, as shown below in descending order of the sum of the deliciousness of the cakes:\n\n(A_2, B_2, C_2): 6 + 5 + 8 = 19\n\n(A_1, B_2, C_2): 4 + 5 + 8 = 17\n\n(A_2, B_1, C_2): 6 + 1 + 8 = 15\n\n(A_2, B_2, C_1): 6 + 5 + 3 = 14\n\n(A_1, B_1, C_2): 4 + 1 + 8 = 13\n\n(A_1, B_2, C_1): 4 + 5 + 3 = 12\n\n(A_2, B_1, C_1): 6 + 1 + 3 = 10\n\n(A_1, B_1, C_1): 4 + 1 + 3 = 8\n\nSample Input 2\n\n3 3 3 5\n1 10 100\n2 20 200\n1 10 100\n\nSample Output 2\n\n400\n310\n310\n301\n301\n\nThere may be multiple combinations of cakes with the same sum of the deliciousness. For example, in this test case, the sum of A_1, B_3, C_3 and the sum of A_3, B_3, C_1 are both 301.\nHowever, they are different ways of choosing cakes, so 301 occurs twice in the output.\n\nSample Input 3\n\n10 10 10 20\n7467038376 5724769290 292794712 2843504496 3381970101 8402252870 249131806 6310293640 6690322794 6082257488\n1873977926 2576529623 1144842195 1379118507 6003234687 4925540914 3902539811 3326692703 484657758 2877436338\n4975681328 8974383988 2882263257 7690203955 514305523 6679823484 4263279310 585966808 3752282379 620585736\n\nSample Output 3\n\n23379871545\n22444657051\n22302177772\n22095691512\n21667941469\n21366963278\n21287912315\n21279176669\n21160477018\n21085311041\n21059876163\n21017997739\n20703329561\n20702387965\n20590247696\n20383761436\n20343962175\n20254073196\n20210218542\n20150096547\n\nNote that the input or output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1841, "cpu_time_ms": 2118, "memory_kb": 1472960}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s731180533", "group_id": "codeNet:p03080", "input_text": "function Main(input) {\n var red=0;\n var text = input[1];\n for(var i = 0; i < text.length; i++){\n red += (text[i] == \"R\" ? 1:-1);\n }\n console.log(red > 0 ? \"Yes\": \"No\");\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());\n", "language": "JavaScript", "metadata": {"date": 1554215109, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03080.html", "problem_id": "p03080", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03080/input.txt", "sample_output_relpath": "derived/input_output/data/p03080/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03080/JavaScript/s731180533.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s731180533", "user_id": "u757900744"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function Main(input) {\n var red=0;\n var text = input[1];\n for(var i = 0; i < text.length; i++){\n red += (text[i] == \"R\" ? 1:-1);\n }\n console.log(red > 0 ? \"Yes\": \"No\");\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim());\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is R, and a blue hat if s_i is B.\n\nDetermine if there are more people wearing a red hat than people wearing a blue hat.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|s| = N\n\ns_i is R or B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there are more people wearing a red hat than there are people wearing a blue hat, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nRRBR\n\nSample Output 1\n\nYes\n\nThere are three people wearing a red hat, and one person wearing a blue hat.\n\nSince there are more people wearing a red hat than people wearing a blue hat, the answer is Yes.\n\nSample Input 2\n\n4\nBRBR\n\nSample Output 2\n\nNo\n\nThere are two people wearing a red hat, and two people wearing a blue hat.\n\nSince there are as many people wearing a red hat as people wearing a blue hat, the answer is No.", "sample_input": "4\nRRBR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03080", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is R, and a blue hat if s_i is B.\n\nDetermine if there are more people wearing a red hat than people wearing a blue hat.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|s| = N\n\ns_i is R or B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there are more people wearing a red hat than there are people wearing a blue hat, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nRRBR\n\nSample Output 1\n\nYes\n\nThere are three people wearing a red hat, and one person wearing a blue hat.\n\nSince there are more people wearing a red hat than people wearing a blue hat, the answer is Yes.\n\nSample Input 2\n\n4\nBRBR\n\nSample Output 2\n\nNo\n\nThere are two people wearing a red hat, and two people wearing a blue hat.\n\nSince there are as many people wearing a red hat as people wearing a blue hat, the answer is No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 243, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s847845291", "group_id": "codeNet:p03080", "input_text": "function main(input) {\n const row = input.split(\"\\n\")\n const n = parseInt(row[0])\n const s = row[1]\n let r = 0\n let b = 0\n for (let i = 0; i < s.length; i++) {\n const c = s.slice(i, i+1)\n if (c === 'R') r++\n if (c === 'B') b++\n }\n \n if (r > b) {\n console.log(\"Yes\")\n } else {\n console.log(\"No\")\n }\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1553978818, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03080.html", "problem_id": "p03080", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03080/input.txt", "sample_output_relpath": "derived/input_output/data/p03080/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03080/JavaScript/s847845291.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s847845291", "user_id": "u893154287"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function main(input) {\n const row = input.split(\"\\n\")\n const n = parseInt(row[0])\n const s = row[1]\n let r = 0\n let b = 0\n for (let i = 0; i < s.length; i++) {\n const c = s.slice(i, i+1)\n if (c === 'R') r++\n if (c === 'B') b++\n }\n \n if (r > b) {\n console.log(\"Yes\")\n } else {\n console.log(\"No\")\n }\n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is R, and a blue hat if s_i is B.\n\nDetermine if there are more people wearing a red hat than people wearing a blue hat.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|s| = N\n\ns_i is R or B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there are more people wearing a red hat than there are people wearing a blue hat, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nRRBR\n\nSample Output 1\n\nYes\n\nThere are three people wearing a red hat, and one person wearing a blue hat.\n\nSince there are more people wearing a red hat than people wearing a blue hat, the answer is Yes.\n\nSample Input 2\n\n4\nBRBR\n\nSample Output 2\n\nNo\n\nThere are two people wearing a red hat, and two people wearing a blue hat.\n\nSince there are as many people wearing a red hat as people wearing a blue hat, the answer is No.", "sample_input": "4\nRRBR\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03080", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N people numbered 1 to N. Each person wears a red hat or a blue hat.\n\nYou are given a string s representing the colors of the people. Person i wears a red hat if s_i is R, and a blue hat if s_i is B.\n\nDetermine if there are more people wearing a red hat than people wearing a blue hat.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n|s| = N\n\ns_i is R or B.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\ns\n\nOutput\n\nIf there are more people wearing a red hat than there are people wearing a blue hat, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\nRRBR\n\nSample Output 1\n\nYes\n\nThere are three people wearing a red hat, and one person wearing a blue hat.\n\nSince there are more people wearing a red hat than people wearing a blue hat, the answer is Yes.\n\nSample Input 2\n\n4\nBRBR\n\nSample Output 2\n\nNo\n\nThere are two people wearing a red hat, and two people wearing a blue hat.\n\nSince there are as many people wearing a red hat as people wearing a blue hat, the answer is No.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 552, "cpu_time_ms": 50, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s134144068", "group_id": "codeNet:p03081", "input_text": "function main(input) {\n var lines = input.split(\"\\n\");\n var N = Number(lines[0].split(\" \")[0])\n var Q = Number(lines[0].split(\" \")[1]);\n var str = lines[1];\n var table = [];\n var map = {};\n for(var i=0;i<=N+1;i++){\n if(i==0 || i==N+1){\n table[i]={count:0};\n }else{\n table[i]={count:1, i: i};\n if(!map[str[i-1]]) map[str[i-1]] = [];\n map[str[i-1]].push(table[i]);\n }\n }\n for(var j=2;j=0;i--){\n var ii = movet[i].i;\n var mvc = table[ii].count;\n table[ii+1].count+=mvc;\n table[ii].count=0;\n }\n }else{\n for(var i=0;i=0;i--){\n var ii = movet[i].i;\n var mvc = table[ii].count;\n table[ii+1].count+=mvc;\n table[ii].count=0;\n }\n }else{\n for(var i=0;i parseInt(val, 10));\nconst N = firstLine[0];\nconst Q = firstLine[1];\n\nconst S = input[1];\nconst golems = new Array(N).fill(1);\n\nlet left = 0;\nlet right = N - 1;\n\nfor (let i = Q + 1; i > 1; i--) {\n const spell = input[i].split(\" \");\n const t = spell[0];\n const d = spell[1];\n\n if (S.charAt(left) === t && d === \"L\") {\n left++;\n } else if (S.charAt(right) === t && d === \"R\") {\n right--;\n }\n}\n\nconsole.log(left <= right ? N - (left + (N - 1 - right)) : 0);\n", "language": "JavaScript", "metadata": {"date": 1553978866, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03081.html", "problem_id": "p03081", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03081/input.txt", "sample_output_relpath": "derived/input_output/data/p03081/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03081/JavaScript/s360988377.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s360988377", "user_id": "u445747215"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\")\n .readFileSync(\"/dev/stdin\", \"utf8\")\n .split(\"\\n\");\n\nconst firstLine = input[0].split(\" \").map((val) => parseInt(val, 10));\nconst N = firstLine[0];\nconst Q = firstLine[1];\n\nconst S = input[1];\nconst golems = new Array(N).fill(1);\n\nlet left = 0;\nlet right = N - 1;\n\nfor (let i = Q + 1; i > 1; i--) {\n const spell = input[i].split(\" \");\n const t = spell[0];\n const d = spell[1];\n\n if (S.charAt(left) === t && d === \"L\") {\n left++;\n } else if (S.charAt(right) === t && d === \"R\") {\n right--;\n }\n}\n\nconsole.log(left <= right ? N - (left + (N - 1 - right)) : 0);\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere are N squares numbered 1 to N from left to right.\nEach square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q spells to move the golems.\n\nThe i-th spell consisted of two characters t_i and d_i, where d_i is L or R.\nWhen Snuke cast this spell, for each square with the character t_i, all golems on that square moved to the square adjacent to the left if d_i is L, and moved to the square adjacent to the right if d_i is R.\n\nHowever, when a golem tried to move left from Square 1 or move right from Square N, it disappeared.\n\nFind the number of golems remaining after Snuke cast the Q spells.\n\nConstraints\n\n1 \\leq N,Q \\leq 2 \\times 10^{5}\n\n|s| = N\n\ns_i and t_i are uppercase English letters.\n\nd_i is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\ns\nt_1 d_1\n\\vdots\nt_{Q} d_Q\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 4\nABC\nA L\nB L\nB R\nA R\n\nSample Output 1\n\n2\n\nInitially, there is one golem on each square.\n\nIn the first spell, the golem on Square 1 tries to move left and disappears.\n\nIn the second spell, the golem on Square 2 moves left.\n\nIn the third spell, no golem moves.\n\nIn the fourth spell, the golem on Square 1 moves right.\n\nAfter the four spells are cast, there is one golem on Square 2 and one golem on Square 3, for a total of two golems remaining.\n\nSample Input 2\n\n8 3\nAABCBDBA\nA L\nB R\nA R\n\nSample Output 2\n\n5\n\nAfter the three spells are cast, there is one golem on Square 2, two golems on Square 4 and two golems on Square 6, for a total of five golems remaining.\n\nNote that a single spell may move multiple golems.\n\nSample Input 3\n\n10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nS L\n\nSample Output 3\n\n3", "sample_input": "3 4\nABC\nA L\nB L\nB R\nA R\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03081", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere are N squares numbered 1 to N from left to right.\nEach square has a character written on it, and Square i has a letter s_i. Besides, there is initially one golem on each square.\n\nSnuke cast Q spells to move the golems.\n\nThe i-th spell consisted of two characters t_i and d_i, where d_i is L or R.\nWhen Snuke cast this spell, for each square with the character t_i, all golems on that square moved to the square adjacent to the left if d_i is L, and moved to the square adjacent to the right if d_i is R.\n\nHowever, when a golem tried to move left from Square 1 or move right from Square N, it disappeared.\n\nFind the number of golems remaining after Snuke cast the Q spells.\n\nConstraints\n\n1 \\leq N,Q \\leq 2 \\times 10^{5}\n\n|s| = N\n\ns_i and t_i are uppercase English letters.\n\nd_i is L or R.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN Q\ns\nt_1 d_1\n\\vdots\nt_{Q} d_Q\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n3 4\nABC\nA L\nB L\nB R\nA R\n\nSample Output 1\n\n2\n\nInitially, there is one golem on each square.\n\nIn the first spell, the golem on Square 1 tries to move left and disappears.\n\nIn the second spell, the golem on Square 2 moves left.\n\nIn the third spell, no golem moves.\n\nIn the fourth spell, the golem on Square 1 moves right.\n\nAfter the four spells are cast, there is one golem on Square 2 and one golem on Square 3, for a total of two golems remaining.\n\nSample Input 2\n\n8 3\nAABCBDBA\nA L\nB R\nA R\n\nSample Output 2\n\n5\n\nAfter the three spells are cast, there is one golem on Square 2, two golems on Square 4 and two golems on Square 6, for a total of five golems remaining.\n\nNote that a single spell may move multiple golems.\n\nSample Input 3\n\n10 15\nSNCZWRCEWB\nB R\nR R\nE R\nW R\nZ L\nS R\nQ L\nW L\nB R\nC L\nA L\nN L\nE R\nZ L\nS L\n\nSample Output 3\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 640, "cpu_time_ms": 206, "memory_kb": 33312}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s493968795", "group_id": "codeNet:p03082", "input_text": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(v)\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\nvar mod = 1e9+7;\nfunction abmod(){for(var a=arguments,r=a[0],i=1;i>16)*a[i]%mod*65536+(r&65535)*a[i++])%mod;return r;}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var x = o.a();\n var s = o.l().sort((a,b)=>b-a);\n var dp = Array(x+1).fill(0);\n dp[x] = 1;\n for(var i = 0; i < n; i++){\n var dp2 = Array(x+1).fill(0);\n for(var j = 0; j <= x; j++){\n dp2[j] += dp[j] * (n-i-1);\n dp2[j] %= mod;\n var m = j % s[i];\n dp2[m] += dp[j];\n dp2[m] %= mod;\n }\n dp = dp2;\n }\n var ans = 0;\n for(i = 0; i < s[n-1]; i++){\n ans += abmod(i,dp[i]);\n }\n return ans % mod;\n}", "language": "JavaScript", "metadata": {"date": 1554009352, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03082.html", "problem_id": "p03082", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03082/input.txt", "sample_output_relpath": "derived/input_output/data/p03082/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03082/JavaScript/s493968795.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s493968795", "user_id": "u643613120"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\nfunction xArray(v){var a=arguments,l=a.length,r=\"Array(a[\"+--l+\"]).fill(v)\";while(--l)r=\"Array(a[\"+l+\"]).fill(0).map(x=>\"+r+\")\";return eval(r);}\nvar mod = 1e9+7;\nfunction abmod(){for(var a=arguments,r=a[0],i=1;i>16)*a[i]%mod*65536+(r&65535)*a[i++])%mod;return r;}\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var x = o.a();\n var s = o.l().sort((a,b)=>b-a);\n var dp = Array(x+1).fill(0);\n dp[x] = 1;\n for(var i = 0; i < n; i++){\n var dp2 = Array(x+1).fill(0);\n for(var j = 0; j <= x; j++){\n dp2[j] += dp[j] * (n-i-1);\n dp2[j] %= mod;\n var m = j % s[i];\n dp2[m] += dp[j];\n dp2[m] %= mod;\n }\n dp = dp2;\n }\n var ans = 0;\n for(i = 0; i < s[n-1]; i++){\n ans += abmod(i,dp[i]);\n }\n return ans % mod;\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke has a blackboard and a set S consisting of N integers.\nThe i-th element in S is S_i.\n\nHe wrote an integer X on the blackboard, then performed the following operation N times:\n\nChoose one element from S and remove it.\n\nLet x be the number written on the blackboard now, and y be the integer removed from S. Replace the number on the blackboard with x \\bmod {y}.\n\nThere are N! possible orders in which the elements are removed from S.\nFor each of them, find the number that would be written on the blackboard after the N operations, and compute the sum of all those N! numbers modulo 10^{9}+7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200\n\n1 \\leq S_i, X \\leq 10^{5}\n\nS_i are pairwise distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nS_1 S_2 \\ldots S_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 19\n3 7\n\nSample Output 1\n\n3\n\nThere are two possible orders in which we remove the numbers from S.\n\nIf we remove 3 and 7 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 1 \\rightarrow 1.\n\nIf we remove 7 and 3 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 5 \\rightarrow 2.\n\nThe output should be the sum of these: 3.\n\nSample Input 2\n\n5 82\n22 11 6 5 13\n\nSample Output 2\n\n288\n\nSample Input 3\n\n10 100000\n50000 50001 50002 50003 50004 50005 50006 50007 50008 50009\n\nSample Output 3\n\n279669259\n\nBe sure to compute the sum modulo 10^{9}+7.", "sample_input": "2 19\n3 7\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03082", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke has a blackboard and a set S consisting of N integers.\nThe i-th element in S is S_i.\n\nHe wrote an integer X on the blackboard, then performed the following operation N times:\n\nChoose one element from S and remove it.\n\nLet x be the number written on the blackboard now, and y be the integer removed from S. Replace the number on the blackboard with x \\bmod {y}.\n\nThere are N! possible orders in which the elements are removed from S.\nFor each of them, find the number that would be written on the blackboard after the N operations, and compute the sum of all those N! numbers modulo 10^{9}+7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200\n\n1 \\leq S_i, X \\leq 10^{5}\n\nS_i are pairwise distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nS_1 S_2 \\ldots S_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 19\n3 7\n\nSample Output 1\n\n3\n\nThere are two possible orders in which we remove the numbers from S.\n\nIf we remove 3 and 7 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 1 \\rightarrow 1.\n\nIf we remove 7 and 3 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 5 \\rightarrow 2.\n\nThe output should be the sum of these: 3.\n\nSample Input 2\n\n5 82\n22 11 6 5 13\n\nSample Output 2\n\n288\n\nSample Input 3\n\n10 100000\n50000 50001 50002 50003 50004 50005 50006 50007 50008 50009\n\nSample Output 3\n\n279669259\n\nBe sure to compute the sum modulo 10^{9}+7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1426, "cpu_time_ms": 581, "memory_kb": 42004}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s138117401", "group_id": "codeNet:p03082", "input_text": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\")\n .readFileSync(\"/dev/stdin\", \"utf8\")\n .split(\"\\n\");\n\nconst firstLine = input[0].split(\" \").map((val) => parseInt(val, 10));\nconst N = firstLine[0];\nconst X = firstLine[1];\n\nconst S = input[1].split(\" \").map((val) => parseInt(val, 10));\n\nfunction sumMod(X, ary) {\n let sum = 0;\n\n if (ary.length === 1) {\n return X % ary[0];\n }\n\n for (let i = 0; i < ary.length; i++) {\n const num = ary[i];\n const nextX = X % num;\n\n sum += sumMod(nextX, ary.slice(0, i).concat(ary.slice(i + 1, ary.length)));\n }\n\n return sum %= 1000000000 + 7;\n}\n\nconsole.log(sumMod(X, S));\n", "language": "JavaScript", "metadata": {"date": 1553982728, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03082.html", "problem_id": "p03082", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03082/input.txt", "sample_output_relpath": "derived/input_output/data/p03082/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03082/JavaScript/s138117401.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s138117401", "user_id": "u445747215"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\")\n .readFileSync(\"/dev/stdin\", \"utf8\")\n .split(\"\\n\");\n\nconst firstLine = input[0].split(\" \").map((val) => parseInt(val, 10));\nconst N = firstLine[0];\nconst X = firstLine[1];\n\nconst S = input[1].split(\" \").map((val) => parseInt(val, 10));\n\nfunction sumMod(X, ary) {\n let sum = 0;\n\n if (ary.length === 1) {\n return X % ary[0];\n }\n\n for (let i = 0; i < ary.length; i++) {\n const num = ary[i];\n const nextX = X % num;\n\n sum += sumMod(nextX, ary.slice(0, i).concat(ary.slice(i + 1, ary.length)));\n }\n\n return sum %= 1000000000 + 7;\n}\n\nconsole.log(sumMod(X, S));\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke has a blackboard and a set S consisting of N integers.\nThe i-th element in S is S_i.\n\nHe wrote an integer X on the blackboard, then performed the following operation N times:\n\nChoose one element from S and remove it.\n\nLet x be the number written on the blackboard now, and y be the integer removed from S. Replace the number on the blackboard with x \\bmod {y}.\n\nThere are N! possible orders in which the elements are removed from S.\nFor each of them, find the number that would be written on the blackboard after the N operations, and compute the sum of all those N! numbers modulo 10^{9}+7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200\n\n1 \\leq S_i, X \\leq 10^{5}\n\nS_i are pairwise distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nS_1 S_2 \\ldots S_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 19\n3 7\n\nSample Output 1\n\n3\n\nThere are two possible orders in which we remove the numbers from S.\n\nIf we remove 3 and 7 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 1 \\rightarrow 1.\n\nIf we remove 7 and 3 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 5 \\rightarrow 2.\n\nThe output should be the sum of these: 3.\n\nSample Input 2\n\n5 82\n22 11 6 5 13\n\nSample Output 2\n\n288\n\nSample Input 3\n\n10 100000\n50000 50001 50002 50003 50004 50005 50006 50007 50008 50009\n\nSample Output 3\n\n279669259\n\nBe sure to compute the sum modulo 10^{9}+7.", "sample_input": "2 19\n3 7\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03082", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke has a blackboard and a set S consisting of N integers.\nThe i-th element in S is S_i.\n\nHe wrote an integer X on the blackboard, then performed the following operation N times:\n\nChoose one element from S and remove it.\n\nLet x be the number written on the blackboard now, and y be the integer removed from S. Replace the number on the blackboard with x \\bmod {y}.\n\nThere are N! possible orders in which the elements are removed from S.\nFor each of them, find the number that would be written on the blackboard after the N operations, and compute the sum of all those N! numbers modulo 10^{9}+7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 200\n\n1 \\leq S_i, X \\leq 10^{5}\n\nS_i are pairwise distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\nS_1 S_2 \\ldots S_{N}\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n2 19\n3 7\n\nSample Output 1\n\n3\n\nThere are two possible orders in which we remove the numbers from S.\n\nIf we remove 3 and 7 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 1 \\rightarrow 1.\n\nIf we remove 7 and 3 in this order, the number on the blackboard changes as follows: 19 \\rightarrow 5 \\rightarrow 2.\n\nThe output should be the sum of these: 3.\n\nSample Input 2\n\n5 82\n22 11 6 5 13\n\nSample Output 2\n\n288\n\nSample Input 3\n\n10 100000\n50000 50001 50002 50003 50004 50005 50006 50007 50008 50009\n\nSample Output 3\n\n279669259\n\nBe sure to compute the sum modulo 10^{9}+7.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 643, "cpu_time_ms": 2108, "memory_kb": 12236}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s420998091", "group_id": "codeNet:p03085", "input_text": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nb = lines.shift()\ns = {\n A: 'T',\n C: 'G',\n G: 'C',\n T: 'A'\n}\nconsole.log(s[b])", "language": "JavaScript", "metadata": {"date": 1570996707, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/JavaScript/s420998091.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s420998091", "user_id": "u461478706"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nb = lines.shift()\ns = {\n A: 'T',\n C: 'G',\n G: 'C',\n T: 'A'\n}\nconsole.log(s[b])", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 173, "cpu_time_ms": 53, "memory_kb": 7496}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s351009009", "group_id": "codeNet:p03085", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n switch(input){\n case 'A':\n console.log('T');\n case 'T':\n console.log('A');\n case 'G':\n console.log('C');\n case 'C':\n console.log('G');\n }\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1554060190, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/JavaScript/s351009009.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s351009009", "user_id": "u738606088"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n switch(input){\n case 'A':\n console.log('T');\n case 'T':\n console.log('A');\n case 'G':\n console.log('C');\n case 'C':\n console.log('G');\n }\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 423, "cpu_time_ms": 50, "memory_kb": 11340}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s599035832", "group_id": "codeNet:p03085", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n var a = \"\";\n if(\"A\" === input){\n a = \"T\";\n }else if(\"T\" === input){\n a = \"A\";\n }else if(\"G\" === input){\n a = \"C\";\n }else\n a = \"G\";\n }\n\t//出力\n\tconsole.log(a);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1553786323, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/JavaScript/s599035832.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s599035832", "user_id": "u609502714"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n var a = \"\";\n if(\"A\" === input){\n a = \"T\";\n }else if(\"T\" === input){\n a = \"A\";\n }else if(\"G\" === input){\n a = \"C\";\n }else\n a = \"G\";\n }\n\t//出力\n\tconsole.log(a);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 432, "cpu_time_ms": 53, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s618553583", "group_id": "codeNet:p03085", "input_text": "function Main(input) {\n var output = {\n A: 'T',\n T: 'A',\n C: 'G',\n G: 'C'\n };\n console.log(output[input]);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1553779717, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/JavaScript/s618553583.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s618553583", "user_id": "u757900744"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "function Main(input) {\n var output = {\n A: 'T',\n T: 'A',\n C: 'G',\n G: 'C'\n };\n console.log(output[input]);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 180, "cpu_time_ms": 53, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s142295057", "group_id": "codeNet:p03085", "input_text": "b = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nr = \nb == 'A' ? 'T':\nb == 'T' ? 'A':\nb == 'C' ? 'G': 'C';\n\nconsole.log(r);", "language": "JavaScript", "metadata": {"date": 1553459173, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03085.html", "problem_id": "p03085", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03085/input.txt", "sample_output_relpath": "derived/input_output/data/p03085/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03085/JavaScript/s142295057.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s142295057", "user_id": "u646148705"}, "prompt_components": {"gold_output": "T\n", "input_to_evaluate": "b = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nr = \nb == 'A' ? 'T':\nb == 'T' ? 'A':\nb == 'C' ? 'G': 'C';\n\nconsole.log(r);", "problem_context": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "sample_input": "A\n"}, "reference_outputs": ["T\n"], "source_document_id": "p03085", "source_text": "Score : 100 points\n\nProblem Statement\n\nOn the Planet AtCoder, there are four types of bases: A, C, G and T. A bonds with T, and C bonds with G.\n\nYou are given a letter b as input, which is A, C, G or T. Write a program that prints the letter representing the base that bonds with the base b.\n\nConstraints\n\nb is one of the letters A, C, G and T.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nb\n\nOutput\n\nPrint the letter representing the base that bonds with the base b.\n\nSample Input 1\n\nA\n\nSample Output 1\n\nT\n\nSample Input 2\n\nG\n\nSample Output 2\n\nC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 129, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s156570916", "group_id": "codeNet:p03085", "input_text": "!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=13)}({0:function(t,e,n){\"use strict\";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(o,u){function i(t){try{c(r.next(t))}catch(t){u(t)}}function a(t){try{c(r.throw(t))}catch(t){u(t)}}function c(t){t.done?o(t.value):new n(function(e){e(t.value)}).then(i,a)}c((r=r.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var n,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function a(u){return function(a){return function(u){if(n)throw new TypeError(\"Generator is already executing.\");for(;i;)try{if(n=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]0}),n=0,r.label=1;case 1:return n0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]0}),n=0,r.label=1;case 1:return n0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]{\n if(ch === 'A' || ch === 'T' || ch === 'G' || ch === 'C'){\n count++;\n }else{\n max_count = count > max_count ? count : max_count;\n count = 0;\n }\n });\n console.log(count > max_count ? count : max_count);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf-8\"));\n", "language": "JavaScript", "metadata": {"date": 1554278191, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03086.html", "problem_id": "p03086", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03086/input.txt", "sample_output_relpath": "derived/input_output/data/p03086/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03086/JavaScript/s693670440.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s693670440", "user_id": "u279735925"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function Main(input){\n S = input.trim().split('');\n count = 0;\n max_count = 0;\n S.forEach((ch)=>{\n if(ch === 'A' || ch === 'T' || ch === 'G' || ch === 'C'){\n count++;\n }else{\n max_count = count > max_count ? count : max_count;\n count = 0;\n }\n });\n console.log(count > max_count ? count : max_count);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf-8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "sample_input": "ATCODER\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03086", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 389, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s913850196", "group_id": "codeNet:p03086", "input_text": "function Main(input) {\n input = input.replace(/[^ACGT]/g,\"_\");\n input = input.split(\"_\");\n var len = 0\n for(var i of input){\n if(len < i.length)len = i.length\n }\n console.log(len)\n return 0\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1553458554, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03086.html", "problem_id": "p03086", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03086/input.txt", "sample_output_relpath": "derived/input_output/data/p03086/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03086/JavaScript/s913850196.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s913850196", "user_id": "u370451553"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function Main(input) {\n input = input.replace(/[^ACGT]/g,\"_\");\n input = input.split(\"_\");\n var len = 0\n for(var i of input){\n if(len < i.length)len = i.length\n }\n console.log(len)\n return 0\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "sample_input": "ATCODER\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03086", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S consisting of uppercase English letters. Find the length of the longest ACGT string that is a substring (see Notes) of S.\n\nHere, a ACGT string is a string that contains no characters other than A, C, G and T.\n\nNotes\n\nA substring of a string T is a string obtained by removing zero or more characters from the beginning and the end of T.\n\nFor example, the substrings of ATCODER include TCO, AT, CODER, ATCODER and (the empty string), but not AC.\n\nConstraints\n\nS is a string of length between 1 and 10 (inclusive).\n\nEach character in S is an uppercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the length of the longest ACGT string that is a substring of S.\n\nSample Input 1\n\nATCODER\n\nSample Output 1\n\n3\n\nAmong the ACGT strings that are substrings of ATCODER, the longest one is ATC.\n\nSample Input 2\n\nHATAGAYA\n\nSample Output 2\n\n5\n\nAmong the ACGT strings that are substrings of HATAGAYA, the longest one is ATAGA.\n\nSample Input 3\n\nSHINJUKU\n\nSample Output 3\n\n0\n\nAmong the ACGT strings that are substrings of SHINJUKU, the longest one is (the empty string).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 273, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s995662284", "group_id": "codeNet:p03087", "input_text": "var input = require('fs').readFileSync('/dev/stdin', 'utf8');\nvar arr=input.split(\"\\n\");\nvar q=arr[0].split(\" \").map(Number)[1];\nvar s = arr[1];\nvar a=[0,0];\nvar cnt=0;\nfor(var i=1;i {\n const N = parseInt(arg.split(\"\\n\")[0].split(\" \")[0]);\n const Q = parseInt(arg.split(\"\\n\")[0].split(\" \")[1]);\n const S = arg.split(\"\\n\")[1].split(\"\");\n //const lr = arg.split(\"\\n\").slice(2, N + 1);\n let dp = [0, 0];\n let cnt = 0;\n \n for(let i=2; i<=N; i++) {\n if(S[i-2] === \"A\" && S[i-1] === \"C\") {\n dp.push(dp[i-1] + 1);\n } else {\n dp.push(dp[i-1]);\n }\n }\n\n for(let i=0; i {\n const N = parseInt(arg.split(\"\\n\")[0].split(\" \")[0]);\n const Q = parseInt(arg.split(\"\\n\")[0].split(\" \")[1]);\n const S = arg.split(\"\\n\")[1].split(\"\");\n //const lr = arg.split(\"\\n\").slice(2, N + 1);\n let dp = [0, 0];\n let cnt = 0;\n \n for(let i=2; i<=N; i++) {\n if(S[i-2] === \"A\" && S[i-1] === \"C\") {\n dp.push(dp[i-1] + 1);\n } else {\n dp.push(dp[i-1]);\n }\n }\n\n for(let i=0; ie&&(e=u,u=0);var o;return u>e&&(e=u),[String(e)]},C_GeT_AC:function(n){var t=n[0].split(\" \").map(function(n){return Number(n)}),e=(t[0],t[1],n[1]),r=n.slice(2).map(function(n){return n.split(\" \").map(function(n){return Number(n)})}),u=e.split(\"\").map(function(n,t,e){return\"A\"===n&&e.length>t+1&&\"C\"===e[t+1]});return r.map(function(n){var t=n[0],e=n[1];return u.slice(t-1,e-1).filter(function(n){return!0===n}).length}).map(function(n){return String(n)})}},u=!0,o=!1;function i(n){var t=function(n){for(var t=[],e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u.length>0?[4,v(r[0],u[0])]:[3,5];case 4:return(i=c.sent()?r.shift():u.shift())&&o.push(i),[3,3];case 5:return o.push.apply(o,r.concat(u)),[2,o]}})})}function v(n,t){return h(this,void 0,void 0,function(){return d(this,function(e){switch(e.label){case 0:return console.log(\"? \"+n+\" \"+t),[4,f.a.readFileSync(\"/dev/stdin\",\"utf8\")];case 1:return[2,\"<\"===e.sent()]}})})}var y={beginner_contest_122:r,GrandContest029:a,interactiveSorting:function(n){return h(this,void 0,void 0,function(){var t,e,r;return d(this,function(u){switch(u.label){case 0:return t=n[0].split(\" \").map(function(n){return Number(n)}),e=t[0],t[1],r=\"A\".charCodeAt(0),[4,b(Array.apply(null,new Array(e)).map(function(n,t){return String.fromCharCode(r+t)}))];case 1:return[2,[\"! \"+u.sent().join(\"\")]]}})})},welcomeToAtCoder:function(n){var t=Number(n[0]),e=n[1].split(\" \").map(function(n){return Number(n)});return[t+e[0]+e[1]+\" \"+n[2]]}},m=function(n,t,e,r){return new(e||(e=Promise))(function(u,o){function i(n){try{a(r.next(n))}catch(n){o(n)}}function c(n){try{a(r.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(t){t(n.value)}).then(i,c)}a((r=r.apply(n,t||[])).next())})},g=function(n,t){var e,r,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(e)throw new TypeError(\"Generator is already executing.\");for(;i;)try{if(e=1,r&&(u=2&o[0]?r.return:o[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,o[1])).done)return u;switch(r=0,u&&(o=[2&o[0],u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]e&&(e=u,u=0);var o;return u>e&&(e=u),[String(e)]},C_GeT_AC:function(n){var t=n[0].split(\" \").map(function(n){return Number(n)}),e=(t[0],t[1],n[1]),r=n.slice(2).map(function(n){return n.split(\" \").map(function(n){return Number(n)})}),u=e.split(\"\").map(function(n,t,e){return\"A\"===n&&e.length>t+1&&\"C\"===e[t+1]});return r.map(function(n){var t=n[0],e=n[1];return u.slice(t-1,e-1).filter(function(n){return!0===n}).length}).map(function(n){return String(n)})}},u=!0,o=!1;function i(n){var t=function(n){for(var t=[],e=0;e0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1]0&&u.length>0?[4,v(r[0],u[0])]:[3,5];case 4:return(i=c.sent()?r.shift():u.shift())&&o.push(i),[3,3];case 5:return o.push.apply(o,r.concat(u)),[2,o]}})})}function v(n,t){return h(this,void 0,void 0,function(){return d(this,function(e){switch(e.label){case 0:return console.log(\"? \"+n+\" \"+t),[4,f.a.readFileSync(\"/dev/stdin\",\"utf8\")];case 1:return[2,\"<\"===e.sent()]}})})}var y={beginner_contest_122:r,GrandContest029:a,interactiveSorting:function(n){return h(this,void 0,void 0,function(){var t,e,r;return d(this,function(u){switch(u.label){case 0:return t=n[0].split(\" \").map(function(n){return Number(n)}),e=t[0],t[1],r=\"A\".charCodeAt(0),[4,b(Array.apply(null,new Array(e)).map(function(n,t){return String.fromCharCode(r+t)}))];case 1:return[2,[\"! \"+u.sent().join(\"\")]]}})})},welcomeToAtCoder:function(n){var t=Number(n[0]),e=n[1].split(\" \").map(function(n){return Number(n)});return[t+e[0]+e[1]+\" \"+n[2]]}},m=function(n,t,e,r){return new(e||(e=Promise))(function(u,o){function i(n){try{a(r.next(n))}catch(n){o(n)}}function c(n){try{a(r.throw(n))}catch(n){o(n)}}function a(n){n.done?u(n.value):new e(function(t){t(n.value)}).then(i,c)}a((r=r.apply(n,t||[])).next())})},g=function(n,t){var e,r,u,o,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},\"function\"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(e)throw new TypeError(\"Generator is already executing.\");for(;i;)try{if(e=1,r&&(u=2&o[0]?r.return:o[0]?r.throw||((u=r.return)&&u.call(r),0):r.next)&&!(u=u.call(r,o[1])).done)return u;switch(r=0,u&&(o=[2&o[0],u.value]),o[0]){case 0:case 1:u=o;break;case 4:return i.label++,{value:o[1],done:!1};case 5:i.label++,r=o[1],o=[0];continue;case 7:o=i.ops.pop(),i.trys.pop();continue;default:if(!(u=(u=i.trys).length>0&&u[u.length-1])&&(6===o[0]||2===o[0])){i=0;continue}if(3===o[0]&&(!u||o[1]>u[0]&&o[1] {\n const inputs = input.trim().split(\"\\n\");\n const N = Number(inputs[0].split(\" \")[0]);\n const Q = Number(inputs[0].split(\" \")[1]);\n const S = inputs[1];\n\n for(var i=2;i {\n const inputs = input.trim().split(\"\\n\");\n const N = Number(inputs[0].split(\" \")[0]);\n const Q = Number(inputs[0].split(\" \")[1]);\n const S = inputs[1];\n\n for(var i=2;i parseInt(e));\n }\n\n nextFloatArr() {\n\treturn this.nextStrArr().map((e) => parseFloat(e));\n }\n\n nextIntLine(n) {\n\treturn this.nextLine(n).map((e) => parseInt(e))\n }\n\n nextFloatLine(n) {\n\treturn this.nextLine(n).map((e) => parseFloat(e))\n }\n\n nextStrRange(n) {\n\treturn this.nextLine(n).map((line) => line.split(' '));\n }\n\n nextIntRange(n) {\n\treturn this.nextLine(n).map((line) => line.split(' ').map((e) => parseInt(e)));\n }\n\n nextFloatRange(n) {\n\treturn this.nextLine(n).map((line) => line.split(' ').map((e) => parseFloat(e)));\n }\n}\n\nconst input = new Input();\n(new Main()).solve();\n", "language": "JavaScript", "metadata": {"date": 1552161662, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03101.html", "problem_id": "p03101", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03101/input.txt", "sample_output_relpath": "derived/input_output/data/p03101/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03101/JavaScript/s223649432.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s223649432", "user_id": "u038229929"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "'use strict'\n\nclass Main {\n solve() {\n const size = input.nextIntArr();\n const nums = input.nextIntArr();\n console.log((size[0] - nums[0]) * (size[1] - nums[1]));\n }\n}\n\nclass Input {\n constructor() {\n\tthis.cursor = 0;\n\tthis.inputAll();\n }\n\n inputAll() {\n\tthis.data = (require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")).split('\\n');\n\treturn this.data;\n }\n\n nextLine(n) {\n\tif (n) {\n\t const ret = this.data.slice(this.cursor, this.cursor + n);\n\t this.cursor += n;\n\t return ret;\n\t}\n\treturn this.data[this.cursor++];\n }\n\n nextStrArr() {\n\treturn this.nextLine().split(' ');\n }\n\n nextIntArr() {\n\treturn this.nextStrArr().map((e) => parseInt(e));\n }\n\n nextFloatArr() {\n\treturn this.nextStrArr().map((e) => parseFloat(e));\n }\n\n nextIntLine(n) {\n\treturn this.nextLine(n).map((e) => parseInt(e))\n }\n\n nextFloatLine(n) {\n\treturn this.nextLine(n).map((e) => parseFloat(e))\n }\n\n nextStrRange(n) {\n\treturn this.nextLine(n).map((line) => line.split(' '));\n }\n\n nextIntRange(n) {\n\treturn this.nextLine(n).map((line) => line.split(' ').map((e) => parseInt(e)));\n }\n\n nextFloatRange(n) {\n\treturn this.nextLine(n).map((line) => line.split(' ').map((e) => parseFloat(e)));\n }\n}\n\nconst input = new Input();\n(new Main()).solve();\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "sample_input": "3 2\n2 1\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03101", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere are H rows and W columns of white square cells.\n\nYou will choose h of the rows and w of the columns, and paint all of the cells contained in those rows or columns.\n\nHow many white cells will remain?\n\nIt can be proved that this count does not depend on what rows and columns are chosen.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq H, W \\leq 20\n\n1 \\leq h \\leq H\n\n1 \\leq w \\leq W\n\nInput\n\nInput is given from Standard Input in the following format:\n\nH W\nh w\n\nOutput\n\nPrint the number of white cells that will remain.\n\nSample Input 1\n\n3 2\n2 1\n\nSample Output 1\n\n1\n\nThere are 3 rows and 2 columns of cells. When two rows and one column are chosen and painted in black, there is always one white cell that remains.\n\nSample Input 2\n\n5 5\n2 3\n\nSample Output 2\n\n6\n\nSample Input 3\n\n2 4\n2 4\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1242, "cpu_time_ms": 210, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s740998877", "group_id": "codeNet:p03102", "input_text": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nline = lines.shift().split(' ')\nN = line[0] * 1\nM = line[1] * 1 \nC = line[2] * 1\nB = lines.shift().split(' ')\ncnt = 0\nfor (i=0;i 0) {\n cnt++\n }\n}\nconsole.log(cnt)\n", "language": "JavaScript", "metadata": {"date": 1573402929, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03102.html", "problem_id": "p03102", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03102/input.txt", "sample_output_relpath": "derived/input_output/data/p03102/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03102/JavaScript/s740998877.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s740998877", "user_id": "u461478706"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nline = lines.shift().split(' ')\nN = line[0] * 1\nM = line[1] * 1 \nC = line[2] * 1\nB = lines.shift().split(' ')\ncnt = 0\nfor (i=0;i 0) {\n cnt++\n }\n}\nconsole.log(cnt)\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}.\n\nAdditionally, you are given integers B_1, B_2, ..., B_M and C.\n\nThe i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.\n\nAmong the N codes, find the number of codes that correctly solve this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 20\n\n-100 \\leq A_{ij} \\leq 100\n\n-100 \\leq B_i \\leq 100\n\n-100 \\leq C \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M C\nB_1 B_2 ... B_M\nA_{11} A_{12} ... A_{1M}\nA_{21} A_{22} ... A_{2M}\n\\vdots\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint the number of codes among the given N codes that correctly solve this problem.\n\nSample Input 1\n\n2 3 -10\n1 2 3\n3 2 1\n1 2 2\n\nSample Output 1\n\n1\n\nOnly the second code correctly solves this problem, as follows:\n\nSince 3 \\times 1 + 2 \\times 2 + 1 \\times 3 + (-10) = 0 \\leq 0, the first code does not solve this problem.\n\n1 \\times 1 + 2 \\times 2 + 2 \\times 3 + (-10) = 1 > 0, the second code solves this problem.\n\nSample Input 2\n\n5 2 -4\n-2 5\n100 41\n100 40\n-3 0\n-6 -2\n18 -13\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 0\n100 -100 0\n0 100 100\n100 100 100\n-100 100 100\n\nSample Output 3\n\n0\n\nAll of them are Wrong Answer. Except yours.", "sample_input": "2 3 -10\n1 2 3\n3 2 1\n1 2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03102", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}.\n\nAdditionally, you are given integers B_1, B_2, ..., B_M and C.\n\nThe i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0.\n\nAmong the N codes, find the number of codes that correctly solve this problem.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 20\n\n-100 \\leq A_{ij} \\leq 100\n\n-100 \\leq B_i \\leq 100\n\n-100 \\leq C \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M C\nB_1 B_2 ... B_M\nA_{11} A_{12} ... A_{1M}\nA_{21} A_{22} ... A_{2M}\n\\vdots\nA_{N1} A_{N2} ... A_{NM}\n\nOutput\n\nPrint the number of codes among the given N codes that correctly solve this problem.\n\nSample Input 1\n\n2 3 -10\n1 2 3\n3 2 1\n1 2 2\n\nSample Output 1\n\n1\n\nOnly the second code correctly solves this problem, as follows:\n\nSince 3 \\times 1 + 2 \\times 2 + 1 \\times 3 + (-10) = 0 \\leq 0, the first code does not solve this problem.\n\n1 \\times 1 + 2 \\times 2 + 2 \\times 3 + (-10) = 1 > 0, the second code solves this problem.\n\nSample Input 2\n\n5 2 -4\n-2 5\n100 41\n100 40\n-3 0\n-6 -2\n18 -13\n\nSample Output 2\n\n2\n\nSample Input 3\n\n3 3 0\n100 -100 0\n0 100 100\n100 100 100\n-100 100 100\n\nSample Output 3\n\n0\n\nAll of them are Wrong Answer. Except yours.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 386, "cpu_time_ms": 55, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s556589888", "group_id": "codeNet:p03103", "input_text": "var PS={};(function(exports){\"use strict\";exports.arrayApply=function(fs){return function(xs){var l=fs.length;var k=xs.length;var result=new Array(l*k);var n=0;for(var i=0;i=0;i--){acc=f(xs[i])(acc)}return acc}}};exports.foldlArray=function(f){return function(init){return function(xs){var acc=init;var len=xs.length;for(var i=0;i=xs.length?nothing:just(xs[i])}}}};exports.sortImpl=function(f){return function(l){return l.slice().sort(function(x,y){return f(x)(y)})}};exports.slice=function(s){return function(e){return function(l){return l.slice(s,e)}}}})(PS[\"Data.Array\"]=PS[\"Data.Array\"]||{});(function(exports){\"use strict\";var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Biapplicative=PS[\"Control.Biapplicative\"];var Control_Biapply=PS[\"Control.Biapply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Comonad=PS[\"Control.Comonad\"];var Control_Extend=PS[\"Control.Extend\"];var Control_Lazy=PS[\"Control.Lazy\"];var Control_Monad=PS[\"Control.Monad\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Bifoldable=PS[\"Data.Bifoldable\"];var Data_Bifunctor=PS[\"Data.Bifunctor\"];var Data_Bitraversable=PS[\"Data.Bitraversable\"];var Data_BooleanAlgebra=PS[\"Data.BooleanAlgebra\"];var Data_Bounded=PS[\"Data.Bounded\"];var Data_CommutativeRing=PS[\"Data.CommutativeRing\"];var Data_Distributive=PS[\"Data.Distributive\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_FoldableWithIndex=PS[\"Data.FoldableWithIndex\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Functor_Invariant=PS[\"Data.Functor.Invariant\"];var Data_FunctorWithIndex=PS[\"Data.FunctorWithIndex\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Maybe_First=PS[\"Data.Maybe.First\"];var Data_Monoid=PS[\"Data.Monoid\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semigroup_Foldable=PS[\"Data.Semigroup.Foldable\"];var Data_Semigroup_Traversable=PS[\"Data.Semigroup.Traversable\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_TraversableWithIndex=PS[\"Data.TraversableWithIndex\"];var Data_Unit=PS[\"Data.Unit\"];var Prelude=PS[\"Prelude\"];var Type_Equality=PS[\"Type.Equality\"];var Tuple=function(){function Tuple(value0,value1){this.value0=value0;this.value1=value1}Tuple.create=function(value0){return function(value1){return new Tuple(value0,value1)}};return Tuple}();var snd=function(v){return v.value1};var fst=function(v){return v.value0};exports[\"Tuple\"]=Tuple;exports[\"fst\"]=fst;exports[\"snd\"]=snd})(PS[\"Data.Tuple\"]=PS[\"Data.Tuple\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Unfoldable1\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup_Traversable=PS[\"Data.Semigroup.Traversable\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Tuple=PS[\"Data.Tuple\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Unfoldable1=function(unfoldr1){this.unfoldr1=unfoldr1};var unfoldr1=function(dict){return dict.unfoldr1};exports[\"Unfoldable1\"]=Unfoldable1;exports[\"unfoldr1\"]=unfoldr1})(PS[\"Data.Unfoldable1\"]=PS[\"Data.Unfoldable1\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Unfoldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable1=PS[\"Data.Unfoldable1\"];var Data_Unit=PS[\"Data.Unit\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Unfoldable=function(Unfoldable10,unfoldr){this.Unfoldable10=Unfoldable10;this.unfoldr=unfoldr};var unfoldr=function(dict){return dict.unfoldr};var replicate=function(dictUnfoldable){return function(n){return function(v){var step=function(i){var $7=i<=0;if($7){return Data_Maybe.Nothing.value}return new Data_Maybe.Just(new Data_Tuple.Tuple(v,i-1|0))};return unfoldr(dictUnfoldable)(step)(n)}}};exports[\"Unfoldable\"]=Unfoldable;exports[\"unfoldr\"]=unfoldr;exports[\"replicate\"]=replicate})(PS[\"Data.Unfoldable\"]=PS[\"Data.Unfoldable\"]||{});(function(exports){\"use strict\";exports.unsafeCoerce=function(x){return x}})(PS[\"Unsafe.Coerce\"]=PS[\"Unsafe.Coerce\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Unsafe.Coerce\"];exports[\"unsafeCoerce\"]=$foreign.unsafeCoerce})(PS[\"Unsafe.Coerce\"]=PS[\"Unsafe.Coerce\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Array\"];var Control_Alt=PS[\"Control.Alt\"];var Control_Alternative=PS[\"Control.Alternative\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Category=PS[\"Control.Category\"];var Control_Lazy=PS[\"Control.Lazy\"];var Control_Monad_Rec_Class=PS[\"Control.Monad.Rec.Class\"];var Control_Monad_ST=PS[\"Control.Monad.ST\"];var Control_Monad_ST_Internal=PS[\"Control.Monad.ST.Internal\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Array_NonEmpty_Internal=PS[\"Data.Array.NonEmpty.Internal\"];var Data_Array_ST=PS[\"Data.Array.ST\"];var Data_Array_ST_Iterator=PS[\"Data.Array.ST.Iterator\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Unsafe_Coerce=PS[\"Unsafe.Coerce\"];var sortBy=function(comp){return function(xs){var comp$prime=function(x){return function(y){var v=comp(x)(y);if(v instanceof Data_Ordering.GT){return 1}if(v instanceof Data_Ordering.EQ){return 0}if(v instanceof Data_Ordering.LT){return-1|0}throw new Error(\"Failed pattern match at Data.Array (line 702, column 15 - line 707, column 1): \"+[v.constructor.name])}};return $foreign.sortImpl(comp$prime)(xs)}};var sortWith=function(dictOrd){return function(f){return sortBy(Data_Ord.comparing(dictOrd)(f))}};var singleton=function(a){return[a]};var index=$foreign.indexImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var concatMap=Data_Function.flip(Control_Bind.bind(Control_Bind.bindArray));var mapMaybe=function(f){return concatMap(function($114){return Data_Maybe.maybe([])(singleton)(f($114))})};exports[\"singleton\"]=singleton;exports[\"index\"]=index;exports[\"concatMap\"]=concatMap;exports[\"mapMaybe\"]=mapMaybe;exports[\"sortBy\"]=sortBy;exports[\"sortWith\"]=sortWith;exports[\"length\"]=$foreign.length})(PS[\"Data.Array\"]=PS[\"Data.Array\"]||{});(function(exports){\"use strict\";exports.toCharCode=function(c){return c.charCodeAt(0)};exports.fromCharCode=function(c){return String.fromCharCode(c)}})(PS[\"Data.Enum\"]=PS[\"Data.Enum\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Enum\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_MonadPlus=PS[\"Control.MonadPlus\"];var Control_MonadZero=PS[\"Control.MonadZero\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Bounded=PS[\"Data.Bounded\"];var Data_Either=PS[\"Data.Either\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Data_Unfoldable1=PS[\"Data.Unfoldable1\"];var Data_Unit=PS[\"Data.Unit\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Enum=function(Ord0,pred,succ){this.Ord0=Ord0;this.pred=pred;this.succ=succ};var BoundedEnum=function(Bounded0,Enum1,cardinality,fromEnum,toEnum){this.Bounded0=Bounded0;this.Enum1=Enum1;this.cardinality=cardinality;this.fromEnum=fromEnum;this.toEnum=toEnum};var toEnum=function(dict){return dict.toEnum};var succ=function(dict){return dict.succ};var pred=function(dict){return dict.pred};var fromEnum=function(dict){return dict.fromEnum};var defaultSucc=function(toEnum$prime){return function(fromEnum$prime){return function(a){return toEnum$prime(fromEnum$prime(a)+1|0)}}};var defaultPred=function(toEnum$prime){return function(fromEnum$prime){return function(a){return toEnum$prime(fromEnum$prime(a)-1|0)}}};var charToEnum=function(v){if(v>=Data_Bounded.bottom(Data_Bounded.boundedInt)&&v<=Data_Bounded.top(Data_Bounded.boundedInt)){return new Data_Maybe.Just($foreign.fromCharCode(v))}return Data_Maybe.Nothing.value};var enumChar=new Enum(function(){return Data_Ord.ordChar},defaultPred(charToEnum)($foreign.toCharCode),defaultSucc(charToEnum)($foreign.toCharCode));var cardinality=function(dict){return dict.cardinality};var boundedEnumChar=new BoundedEnum(function(){return Data_Bounded.boundedChar},function(){return enumChar},$foreign.toCharCode(Data_Bounded.top(Data_Bounded.boundedChar))-$foreign.toCharCode(Data_Bounded.bottom(Data_Bounded.boundedChar))|0,$foreign.toCharCode,charToEnum);exports[\"Enum\"]=Enum;exports[\"succ\"]=succ;exports[\"pred\"]=pred;exports[\"BoundedEnum\"]=BoundedEnum;exports[\"cardinality\"]=cardinality;exports[\"toEnum\"]=toEnum;exports[\"fromEnum\"]=fromEnum;exports[\"defaultSucc\"]=defaultSucc;exports[\"defaultPred\"]=defaultPred;exports[\"enumChar\"]=enumChar;exports[\"boundedEnumChar\"]=boundedEnumChar})(PS[\"Data.Enum\"]=PS[\"Data.Enum\"]||{});(function(exports){\"use strict\";var Data_Enum=PS[\"Data.Enum\"];var Data_Maybe=PS[\"Data.Maybe\"];var toCharCode=Data_Enum.fromEnum(Data_Enum.boundedEnumChar);var fromCharCode=Data_Enum.toEnum(Data_Enum.boundedEnumChar);exports[\"toCharCode\"]=toCharCode;exports[\"fromCharCode\"]=fromCharCode})(PS[\"Data.Char\"]=PS[\"Data.Char\"]||{});(function(exports){\"use strict\";var Data_Boolean=PS[\"Data.Boolean\"];var Data_Char=PS[\"Data.Char\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Function=PS[\"Data.Function\"];var Data_Generic_Rep=PS[\"Data.Generic.Rep\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Digit=function(x){return x};var toInt=function(v){return v};var toChar=function(v){return Data_Maybe.fromJust()(Data_Char.fromCharCode(v+48|0))};var fromInt=function(c){if(0<=c&&c<=9){return new Data_Maybe.Just(c)}if(Data_Boolean.otherwise){return Data_Maybe.Nothing.value}throw new Error(\"Failed pattern match at Data.Digit (line 27, column 1 - line 27, column 30): \"+[c.constructor.name])};var fromChar=function(c){var code=Data_Char.toCharCode(c);var $16=code>=48&&code<=57;if($16){return new Data_Maybe.Just(Digit(code-48|0))}return Data_Maybe.Nothing.value};var eqDigit=new Data_Eq.Eq(function(v){return function(v1){return v===v1}});var ordDigit=new Data_Ord.Ord(function(){return eqDigit},function(v){return function(v1){return Data_Ord.compare(Data_Ord.ordInt)(v)(v1)}});var _zero=0;var _one=1;exports[\"fromInt\"]=fromInt;exports[\"toInt\"]=toInt;exports[\"fromChar\"]=fromChar;exports[\"toChar\"]=toChar;exports[\"_zero\"]=_zero;exports[\"_one\"]=_one;exports[\"eqDigit\"]=eqDigit;exports[\"ordDigit\"]=ordDigit})(PS[\"Data.Digit\"]=PS[\"Data.Digit\"]||{});(function(exports){\"use strict\";exports.fromNumberImpl=function(just){return function(nothing){return function(n){return(n|0)===n?just(n):nothing}}};exports.toNumber=function(n){return n};exports.fromStringAsImpl=function(just){return function(nothing){return function(radix){var digits;if(radix<11){digits=\"[0-\"+(radix-1).toString()+\"]\"}else if(radix===11){digits=\"[0-9a]\"}else{digits=\"[0-9a-\"+String.fromCharCode(86+radix)+\"]\"}var pattern=new RegExp(\"^[\\\\+\\\\-]?\"+digits+\"+$\",\"i\");return function(s){if(pattern.test(s)){var i=parseInt(s,radix);return(i|0)===i?just(i):nothing}else{return nothing}}}}}})(PS[\"Data.Int\"]=PS[\"Data.Int\"]||{});(function(exports){\"use strict\";exports.infinity=Infinity;exports.readFloat=parseFloat})(PS[\"Global\"]=PS[\"Global\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Global\"];exports[\"infinity\"]=$foreign.infinity;exports[\"readFloat\"]=$foreign.readFloat})(PS[\"Global\"]=PS[\"Global\"]||{});(function(exports){\"use strict\";exports.round=Math.round})(PS[\"Math\"]=PS[\"Math\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Math\"];exports[\"round\"]=$foreign.round})(PS[\"Math\"]=PS[\"Math\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Int\"];var Control_Category=PS[\"Control.Category\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Bounded=PS[\"Data.Bounded\"];var Data_CommutativeRing=PS[\"Data.CommutativeRing\"];var Data_DivisionRing=PS[\"Data.DivisionRing\"];var Data_Eq=PS[\"Data.Eq\"];var Data_EuclideanRing=PS[\"Data.EuclideanRing\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Int_Bits=PS[\"Data.Int.Bits\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Global=PS[\"Global\"];var $$Math=PS[\"Math\"];var Prelude=PS[\"Prelude\"];var fromStringAs=$foreign.fromStringAsImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var fromString=fromStringAs(10);var fromNumber=$foreign.fromNumberImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var unsafeClamp=function(x){if(x===Global.infinity){return 0}if(x===-Global.infinity){return 0}if(x>=$foreign.toNumber(Data_Bounded.top(Data_Bounded.boundedInt))){return Data_Bounded.top(Data_Bounded.boundedInt)}if(x<=$foreign.toNumber(Data_Bounded.bottom(Data_Bounded.boundedInt))){return Data_Bounded.bottom(Data_Bounded.boundedInt)}if(Data_Boolean.otherwise){return Data_Maybe.fromMaybe(0)(fromNumber(x))}throw new Error(\"Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): \"+[x.constructor.name])};var round=function($23){return unsafeClamp($$Math.round($23))};exports[\"fromNumber\"]=fromNumber;exports[\"round\"]=round;exports[\"fromString\"]=fromString;exports[\"fromStringAs\"]=fromStringAs;exports[\"toNumber\"]=$foreign.toNumber})(PS[\"Data.Int\"]=PS[\"Data.Int\"]||{});(function(exports){\"use strict\";var Control_Alt=PS[\"Control.Alt\"];var Control_Alternative=PS[\"Control.Alternative\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Category=PS[\"Control.Category\"];var Control_Comonad=PS[\"Control.Comonad\"];var Control_Extend=PS[\"Control.Extend\"];var Control_Monad=PS[\"Control.Monad\"];var Control_MonadPlus=PS[\"Control.MonadPlus\"];var Control_MonadZero=PS[\"Control.MonadZero\"];var Control_Plus=PS[\"Control.Plus\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_FoldableWithIndex=PS[\"Data.FoldableWithIndex\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_FunctorWithIndex=PS[\"Data.FunctorWithIndex\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Monoid=PS[\"Data.Monoid\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_NonEmpty=PS[\"Data.NonEmpty\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semigroup_Foldable=PS[\"Data.Semigroup.Foldable\"];var Data_Semigroup_Traversable=PS[\"Data.Semigroup.Traversable\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_TraversableWithIndex=PS[\"Data.TraversableWithIndex\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Data_Unfoldable1=PS[\"Data.Unfoldable1\"];var Prelude=PS[\"Prelude\"];var Nil=function(){function Nil(){}Nil.value=new Nil;return Nil}();var Cons=function(){function Cons(value0,value1){this.value0=value0;this.value1=value1}Cons.create=function(value0){return function(value1){return new Cons(value0,value1)}};return Cons}();var foldableList=new Data_Foldable.Foldable(function(dictMonoid){return function(f){return Data_Foldable.foldl(foldableList)(function(acc){return function($174){return Data_Semigroup.append(dictMonoid.Semigroup0())(acc)(f($174))}})(Data_Monoid.mempty(dictMonoid))}},function(f){var go=function($copy_b){return function($copy_v){var $tco_var_b=$copy_b;var $tco_done=false;var $tco_result;function $tco_loop(b,v){if(v instanceof Nil){$tco_done=true;return b}if(v instanceof Cons){$tco_var_b=f(b)(v.value0);$copy_v=v.value1;return}throw new Error(\"Failed pattern match at Data.List.Types (line 81, column 12 - line 83, column 30): \"+[v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_b,$copy_v)}return $tco_result}};return go},function(f){return function(b){var rev=Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value);return function($175){return Data_Foldable.foldl(foldableList)(Data_Function.flip(f))(b)(rev($175))}}});var functorList=new Data_Functor.Functor(function(f){return Data_Foldable.foldr(foldableList)(function(x){return function(acc){return new Cons(f(x),acc)}})(Nil.value)});var semigroupList=new Data_Semigroup.Semigroup(function(xs){return function(ys){return Data_Foldable.foldr(foldableList)(Cons.create)(ys)(xs)}});var monoidList=new Data_Monoid.Monoid(function(){return semigroupList},Nil.value);var unfoldable1List=new Data_Unfoldable1.Unfoldable1(function(f){return function(b){var go=function($copy_source){return function($copy_memo){var $tco_var_source=$copy_source;var $tco_done=false;var $tco_result;function $tco_loop(source,memo){var v=f(source);if(v.value1 instanceof Data_Maybe.Just){$tco_var_source=v.value1.value0;$copy_memo=new Cons(v.value0,memo);return}if(v.value1 instanceof Data_Maybe.Nothing){$tco_done=true;return Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value)(new Cons(v.value0,memo))}throw new Error(\"Failed pattern match at Data.List.Types (line 105, column 22 - line 107, column 61): \"+[v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_source,$copy_memo)}return $tco_result}};return go(b)(Nil.value)}});var unfoldableList=new Data_Unfoldable.Unfoldable(function(){return unfoldable1List},function(f){return function(b){var go=function($copy_source){return function($copy_memo){var $tco_var_source=$copy_source;var $tco_done=false;var $tco_result;function $tco_loop(source,memo){var v=f(source);if(v instanceof Data_Maybe.Nothing){$tco_done=true;return Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value)(memo)}if(v instanceof Data_Maybe.Just){$tco_var_source=v.value0.value1;$copy_memo=new Cons(v.value0.value0,memo);return}throw new Error(\"Failed pattern match at Data.List.Types (line 112, column 22 - line 114, column 52): \"+[v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_source,$copy_memo)}return $tco_result}};return go(b)(Nil.value)}});var eq1List=new Data_Eq.Eq1(function(dictEq){return function(xs){return function(ys){var go=function($copy_v){return function($copy_v1){return function($copy_v2){var $tco_var_v=$copy_v;var $tco_var_v1=$copy_v1;var $tco_done=false;var $tco_result;function $tco_loop(v,v1,v2){if(!v2){$tco_done=true;return false}if(v instanceof Nil&&v1 instanceof Nil){$tco_done=true;return v2}if(v instanceof Cons&&v1 instanceof Cons){$tco_var_v=v.value1;$tco_var_v1=v1.value1;$copy_v2=v2&&Data_Eq.eq(dictEq)(v1.value0)(v.value0);return}$tco_done=true;return false}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$tco_var_v1,$copy_v2)}return $tco_result}}};return go(xs)(ys)(true)}}});var eqList=function(dictEq){return new Data_Eq.Eq(Data_Eq.eq1(eq1List)(dictEq))};var ord1List=new Data_Ord.Ord1(function(){return eq1List},function(dictOrd){return function(xs){return function(ys){var go=function($copy_v){return function($copy_v1){var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(v,v1){if(v instanceof Nil&&v1 instanceof Nil){$tco_done=true;return Data_Ordering.EQ.value}if(v instanceof Nil){$tco_done=true;return Data_Ordering.LT.value}if(v1 instanceof Nil){$tco_done=true;return Data_Ordering.GT.value}if(v instanceof Cons&&v1 instanceof Cons){var v2=Data_Ord.compare(dictOrd)(v.value0)(v1.value0);if(v2 instanceof Data_Ordering.EQ){$tco_var_v=v.value1;$copy_v1=v1.value1;return}$tco_done=true;return v2}throw new Error(\"Failed pattern match at Data.List.Types (line 55, column 5 - line 55, column 20): \"+[v.constructor.name,v1.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$copy_v1)}return $tco_result}};return go(xs)(ys)}}});var ordList=function(dictOrd){return new Data_Ord.Ord(function(){return eqList(dictOrd.Eq0())},Data_Ord.compare1(ord1List)(dictOrd))};var applyList=new Control_Apply.Apply(function(){return functorList},function(v){return function(v1){if(v instanceof Nil){return Nil.value}if(v instanceof Cons){return Data_Semigroup.append(semigroupList)(Data_Functor.map(functorList)(v.value0)(v1))(Control_Apply.apply(applyList)(v.value1)(v1))}throw new Error(\"Failed pattern match at Data.List.Types (line 127, column 1 - line 127, column 33): \"+[v.constructor.name,v1.constructor.name])}});var applicativeList=new Control_Applicative.Applicative(function(){return applyList},function(a){return new Cons(a,Nil.value)});exports[\"Nil\"]=Nil;exports[\"Cons\"]=Cons;exports[\"eqList\"]=eqList;exports[\"eq1List\"]=eq1List;exports[\"ordList\"]=ordList;exports[\"ord1List\"]=ord1List;exports[\"semigroupList\"]=semigroupList;exports[\"monoidList\"]=monoidList;exports[\"functorList\"]=functorList;exports[\"foldableList\"]=foldableList;exports[\"unfoldable1List\"]=unfoldable1List;exports[\"unfoldableList\"]=unfoldableList;exports[\"applyList\"]=applyList;exports[\"applicativeList\"]=applicativeList})(PS[\"Data.List.Types\"]=PS[\"Data.List.Types\"]||{});(function(exports){\"use strict\";var Control_Alt=PS[\"Control.Alt\"];var Control_Alternative=PS[\"Control.Alternative\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Category=PS[\"Control.Category\"];var Control_Lazy=PS[\"Control.Lazy\"];var Control_Monad_Rec_Class=PS[\"Control.Monad.Rec.Class\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Bifunctor=PS[\"Data.Bifunctor\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_FunctorWithIndex=PS[\"Data.FunctorWithIndex\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_List_Types=PS[\"Data.List.Types\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_NonEmpty=PS[\"Data.NonEmpty\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Data_Unit=PS[\"Data.Unit\"];var Prelude=PS[\"Prelude\"];var uncons=function(v){if(v instanceof Data_List_Types.Nil){return Data_Maybe.Nothing.value}if(v instanceof Data_List_Types.Cons){return new Data_Maybe.Just({head:v.value0,tail:v.value1})}throw new Error(\"Failed pattern match at Data.List (line 259, column 1 - line 259, column 66): \"+[v.constructor.name])};var span=function(v){return function(v1){if(v1 instanceof Data_List_Types.Cons&&v(v1.value0)){var v2=span(v)(v1.value1);return{init:new Data_List_Types.Cons(v1.value0,v2.init),rest:v2.rest}}return{init:Data_List_Types.Nil.value,rest:v1}}};var reverse=function(){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Nil){$tco_done=true;return acc}if(v instanceof Data_List_Types.Cons){$tco_var_acc=new Data_List_Types.Cons(v.value0,acc);$copy_v=v.value1;return}throw new Error(\"Failed pattern match at Data.List (line 368, column 3 - line 368, column 19): \"+[acc.constructor.name,v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)}();var take=function(){var go=function($copy_acc){return function($copy_v){return function($copy_v1){var $tco_var_acc=$copy_acc;var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(acc,v,v1){if(v<1){$tco_done=true;return reverse(acc)}if(v1 instanceof Data_List_Types.Nil){$tco_done=true;return reverse(acc)}if(v1 instanceof Data_List_Types.Cons){$tco_var_acc=new Data_List_Types.Cons(v1.value0,acc);$tco_var_v=v-1|0;$copy_v1=v1.value1;return}throw new Error(\"Failed pattern match at Data.List (line 520, column 3 - line 520, column 35): \"+[acc.constructor.name,v.constructor.name,v1.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$tco_var_v,$copy_v1)}return $tco_result}}};return go(Data_List_Types.Nil.value)}();var takeWhile=function(p){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Cons&&p(v.value0)){$tco_var_acc=new Data_List_Types.Cons(v.value0,acc);$copy_v=v.value1;return}$tco_done=true;return reverse(acc)}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)};var unsnoc=function(lst){var go=function($copy_v){return function($copy_acc){var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(v,acc){if(v instanceof Data_List_Types.Nil){$tco_done=true;return Data_Maybe.Nothing.value}if(v instanceof Data_List_Types.Cons&&v.value1 instanceof Data_List_Types.Nil){$tco_done=true;return new Data_Maybe.Just({revInit:acc,last:v.value0})}if(v instanceof Data_List_Types.Cons){$tco_var_v=v.value1;$copy_acc=new Data_List_Types.Cons(v.value0,acc);return}throw new Error(\"Failed pattern match at Data.List (line 270, column 3 - line 270, column 23): \"+[v.constructor.name,acc.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$copy_acc)}return $tco_result}};return Data_Functor.map(Data_Maybe.functorMaybe)(function(h){return{init:reverse(h.revInit),last:h.last}})(go(lst)(Data_List_Types.Nil.value))};var zipWith=function(f){return function(xs){return function(ys){var go=function($copy_v){return function($copy_v1){return function($copy_acc){var $tco_var_v=$copy_v;var $tco_var_v1=$copy_v1;var $tco_done=false;var $tco_result;function $tco_loop(v,v1,acc){if(v instanceof Data_List_Types.Nil){$tco_done=true;return acc}if(v1 instanceof Data_List_Types.Nil){$tco_done=true;return acc}if(v instanceof Data_List_Types.Cons&&v1 instanceof Data_List_Types.Cons){$tco_var_v=v.value1;$tco_var_v1=v1.value1;$copy_acc=new Data_List_Types.Cons(f(v.value0)(v1.value0),acc);return}throw new Error(\"Failed pattern match at Data.List (line 718, column 3 - line 718, column 21): \"+[v.constructor.name,v1.constructor.name,acc.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$tco_var_v1,$copy_acc)}return $tco_result}}};return reverse(go(xs)(ys)(Data_List_Types.Nil.value))}}};var zip=zipWith(Data_Tuple.Tuple.create);var $$null=function(v){if(v instanceof Data_List_Types.Nil){return true}return false};var mapMaybe=function(f){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Nil){$tco_done=true;return reverse(acc)}if(v instanceof Data_List_Types.Cons){var v1=f(v.value0);if(v1 instanceof Data_Maybe.Nothing){$tco_var_acc=acc;$copy_v=v.value1;return}if(v1 instanceof Data_Maybe.Just){$tco_var_acc=new Data_List_Types.Cons(v1.value0,acc);$copy_v=v.value1;return}throw new Error(\"Failed pattern match at Data.List (line 419, column 5 - line 421, column 32): \"+[v1.constructor.name])}throw new Error(\"Failed pattern match at Data.List (line 417, column 3 - line 417, column 27): \"+[acc.constructor.name,v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)};var length=Data_Foldable.foldl(Data_List_Types.foldableList)(function(acc){return function(v){return acc+1|0}})(0);var last=function($copy_v){var $tco_done=false;var $tco_result;function $tco_loop(v){if(v instanceof Data_List_Types.Cons&&v.value1 instanceof Data_List_Types.Nil){$tco_done=true;return new Data_Maybe.Just(v.value0)}if(v instanceof Data_List_Types.Cons){$copy_v=v.value1;return}$tco_done=true;return Data_Maybe.Nothing.value}while(!$tco_done){$tco_result=$tco_loop($copy_v)}return $tco_result};var insertAt=function(v){return function(v1){return function(v2){if(v===0){return new Data_Maybe.Just(new Data_List_Types.Cons(v1,v2))}if(v2 instanceof Data_List_Types.Cons){return Data_Functor.map(Data_Maybe.functorMaybe)(function(v3){return new Data_List_Types.Cons(v2.value0,v3)})(insertAt(v-1|0)(v1)(v2.value1))}return Data_Maybe.Nothing.value}}};var init=function(lst){return Data_Functor.map(Data_Maybe.functorMaybe)(function(v){return v.init})(unsnoc(lst))};var fromFoldable=function(dictFoldable){return Data_Foldable.foldr(dictFoldable)(Data_List_Types.Cons.create)(Data_List_Types.Nil.value)};var filter=function(p){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Nil){$tco_done=true;return reverse(acc)}if(v instanceof Data_List_Types.Cons){if(p(v.value0)){$tco_var_acc=new Data_List_Types.Cons(v.value0,acc);$copy_v=v.value1;return}if(Data_Boolean.otherwise){$tco_var_acc=acc;$copy_v=v.value1;return}}throw new Error(\"Failed pattern match at Data.List (line 390, column 3 - line 390, column 27): \"+[acc.constructor.name,v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)};var dropWhile=function(p){var go=function($copy_v){var $tco_done=false;var $tco_result;function $tco_loop(v){if(v instanceof Data_List_Types.Cons&&p(v.value0)){$copy_v=v.value1;return}$tco_done=true;return v}while(!$tco_done){$tco_result=$tco_loop($copy_v)}return $tco_result};return go};var drop=function($copy_v){return function($copy_v1){var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(v,v1){if(v<1){$tco_done=true;return v1}if(v1 instanceof Data_List_Types.Nil){$tco_done=true;return Data_List_Types.Nil.value}if(v1 instanceof Data_List_Types.Cons){$tco_var_v=v-1|0;$copy_v1=v1.value1;return}throw new Error(\"Failed pattern match at Data.List (line 543, column 1 - line 543, column 42): \"+[v.constructor.name,v1.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$copy_v1)}return $tco_result}};exports[\"fromFoldable\"]=fromFoldable;exports[\"null\"]=$$null;exports[\"length\"]=length;exports[\"last\"]=last;exports[\"init\"]=init;exports[\"uncons\"]=uncons;exports[\"unsnoc\"]=unsnoc;exports[\"insertAt\"]=insertAt;exports[\"reverse\"]=reverse;exports[\"filter\"]=filter;exports[\"mapMaybe\"]=mapMaybe;exports[\"take\"]=take;exports[\"takeWhile\"]=takeWhile;exports[\"drop\"]=drop;exports[\"dropWhile\"]=dropWhile;exports[\"span\"]=span;exports[\"zipWith\"]=zipWith;exports[\"zip\"]=zip})(PS[\"Data.List\"]=PS[\"Data.List\"]||{});(function(exports){\"use strict\";exports.toCharArray=function(s){return s.split(\"\")};exports.singleton=function(c){return c};exports.length=function(s){return s.length};exports.countPrefix=function(p){return function(s){var i=0;while(i=l||(e$prime<0||(e$prime>l||b$prime>e$prime)));if($7){return Data_Maybe.Nothing.value}return new Data_Maybe.Just($foreign[\"_slice\"](b)(e)(s))}}};var indexOf=$foreign[\"_indexOf\"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var stripPrefix=function(v){return function(str){var v1=indexOf(v)(str);if(v1 instanceof Data_Maybe.Just&&v1.value0===0){return Data_Maybe.Just.create($foreign.drop($foreign.length(v))(str))}return Data_Maybe.Nothing.value}};var contains=function(pat){return function($16){return Data_Maybe.isJust(indexOf(pat)($16))}};exports[\"stripPrefix\"]=stripPrefix;exports[\"contains\"]=contains;exports[\"indexOf\"]=indexOf;exports[\"takeWhile\"]=takeWhile;exports[\"slice\"]=slice;exports[\"singleton\"]=$foreign.singleton;exports[\"toCharArray\"]=$foreign.toCharArray;exports[\"drop\"]=$foreign.drop})(PS[\"Data.String.CodeUnits\"]=PS[\"Data.String.CodeUnits\"]||{});(function(exports){\"use strict\";exports.error=function(msg){return new Error(msg)};exports.throwException=function(e){return function(){throw e}}})(PS[\"Effect.Exception\"]=PS[\"Effect.Exception\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Effect.Exception\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Either=PS[\"Data.Either\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Show=PS[\"Data.Show\"];var Effect=PS[\"Effect\"];var Prelude=PS[\"Prelude\"];exports[\"error\"]=$foreign.error;exports[\"throwException\"]=$foreign.throwException})(PS[\"Effect.Exception\"]=PS[\"Effect.Exception\"]||{});(function(exports){\"use strict\";exports.unsafePerformEffect=function(f){return f()}})(PS[\"Effect.Unsafe\"]=PS[\"Effect.Unsafe\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Effect.Unsafe\"];var Effect=PS[\"Effect\"];exports[\"unsafePerformEffect\"]=$foreign.unsafePerformEffect})(PS[\"Effect.Unsafe\"]=PS[\"Effect.Unsafe\"]||{});(function(exports){\"use strict\";var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Effect_Exception=PS[\"Effect.Exception\"];var Effect_Unsafe=PS[\"Effect.Unsafe\"];var unsafeThrowException=function($0){return Effect_Unsafe.unsafePerformEffect(Effect_Exception.throwException($0))};var unsafeThrow=function($1){return unsafeThrowException(Effect_Exception.error($1))};exports[\"unsafeThrowException\"]=unsafeThrowException;exports[\"unsafeThrow\"]=unsafeThrow})(PS[\"Effect.Exception.Unsafe\"]=PS[\"Effect.Exception.Unsafe\"]||{});(function(exports){\"use strict\";var Control_Applicative=PS[\"Control.Applicative\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Digit=PS[\"Data.Digit\"];var Data_Eq=PS[\"Data.Eq\"];var Data_EuclideanRing=PS[\"Data.EuclideanRing\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Generic_Rep=PS[\"Data.Generic.Rep\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Int=PS[\"Data.Int\"];var Data_List=PS[\"Data.List\"];var Data_List_Types=PS[\"Data.List.Types\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Monoid=PS[\"Data.Monoid\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_String=PS[\"Data.String\"];var Data_String_CodeUnits=PS[\"Data.String.CodeUnits\"];var Data_String_Pattern=PS[\"Data.String.Pattern\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Effect_Exception_Unsafe=PS[\"Effect.Exception.Unsafe\"];var Global=PS[\"Global\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Plus=function(){function Plus(){}Plus.value=new Plus;return Plus}();var Minus=function(){function Minus(){}Minus.value=new Minus;return Minus}();var Float=function(){function Float(){}Float.value=new Float;return Float}();var Integral=function(){function Integral(){}Integral.value=new Integral;return Integral}();var Scientific=function(){function Scientific(){}Scientific.value=new Scientific;return Scientific}();var zeroHugeNum={digits:new Data_List_Types.Cons(Data_Digit[\"_zero\"],new Data_List_Types.Cons(Data_Digit[\"_zero\"],Data_List_Types.Nil.value)),decimal:1,sign:Plus.value};var unsafeRemoveFrontZeroes=Data_List.dropWhile(function(v){return Data_Eq.eq(Data_Digit.eqDigit)(v)(Data_Digit[\"_zero\"])});var trivialFraction=function(v){var decimals=Data_List.reverse(Data_List.drop(v.decimal)(v.digits));var meaty=Data_List.dropWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(decimals);return Data_List[\"null\"](meaty)};var toString=function(v){var sign=function(){if(v.sign instanceof Plus){return Data_Monoid.mempty(Data_List_Types.monoidList)}if(v.sign instanceof Minus){return Control_Applicative.pure(Data_List_Types.applicativeList)(\"-\")}throw new Error(\"Failed pattern match at Data.HugeNum (line 174, column 14 - line 176, column 49): \"+[v.sign.constructor.name])}();var charray=Data_Functor.map(Data_List_Types.functorList)(Data_Digit.toChar)(v.digits);var numray=Data_Maybe.fromJust()(Data_List.insertAt(v.decimal)(\".\")(charray));return Data_Foldable.foldMap(Data_List_Types.foldableList)(Data_Monoid.monoidString)(Data_String_CodeUnits.singleton)(Data_Semigroup.append(Data_List_Types.semigroupList)(sign)(numray))};var timesSign=function(v){return function(v1){if(v instanceof Plus&&v1 instanceof Plus){return Plus.value}if(v instanceof Minus&&v1 instanceof Minus){return Plus.value}return Minus.value}};var takeMeatyParts=function(arr){return Data_List.reverse(Data_List.dropWhile(function(v){return Data_Eq.eq(Data_Digit.eqDigit)(v)(Data_Digit[\"_zero\"])})(Data_List.reverse(arr)))};var timesPowOfTen=function(n){return function(v){var newDecimal=v.decimal+n|0;var newZeroesLength=function(){var $97=newDecimal>=Data_List.length(takeMeatyParts(v.digits));if($97){return newDecimal-Data_List.length(takeMeatyParts(v.digits))|0}return 0}();var newZeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(newZeroesLength)(Data_Digit[\"_zero\"]);var z={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(v.digits)(newZeroes),sign:v.sign,decimal:newDecimal};return z}};var smallEnough=function(v){if(v.decimal===1&&Data_List.length(v.digits)===2){return true}return false};var rec=function(v){return v};var parseScientific=function(n){var split=Data_List.span(function(v){return v!==\"e\"})(Data_List.fromFoldable(Data_Foldable.foldableArray)(Data_String_CodeUnits.toCharArray(Data_Show.show(Data_Show.showNumber)(n))));var signSplit=Data_Maybe.fromJust()(Data_List.uncons(Data_List.drop(1)(split.rest)));var sign=function(){var $102=n<0;if($102){return Minus.value}return Plus.value}();var exponent=Data_Int.round(Global.readFloat(Data_Foldable.foldMap(Data_List_Types.foldableList)(Data_Monoid.monoidString)(Data_String_CodeUnits.singleton)(signSplit.tail)));var expSign=function(){if(signSplit.head===\"+\"){return Plus.value}return Minus.value}();var base=Data_List.filter(function(v){return v!==\".\"})(split.init);var z={exponent:exponent,expSign:expSign,base:base,sign:sign};return z};var parsePlusPlus=function(exp){return function(base){var zeroCardinality=(exp-Data_List.length(base)|0)+2|0;var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(zeroCardinality)(Data_Digit[\"_zero\"]);var digits=Data_Semigroup.append(Data_List_Types.semigroupList)(Data_List.mapMaybe(Data_Digit.fromChar)(base))(zeroes);var decimal=1+exp|0;var r={digits:digits,decimal:decimal,sign:Plus.value};return r}};var parsePlusMinus=function(exp){return function(base){var r=parsePlusPlus(exp)(base);return{digits:Data_Semigroup.append(Data_List_Types.semigroupList)(r.digits)(Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"])),decimal:r.decimal,sign:Minus.value}}};var parseNumber=function(n){if(Data_String_CodeUnits.contains(\"e\")(Data_Show.show(Data_Show.showNumber)(n))){return Scientific.value}if(Data_String_CodeUnits.contains(\".\")(Data_Show.show(Data_Show.showNumber)(n))){return Float.value}if(Data_Boolean.otherwise){return Integral.value}throw new Error(\"Failed pattern match at Data.HugeNum (line 204, column 1 - line 204, column 37): \"+[n.constructor.name])};var parseMinusPlus=function(exp){return function(base){var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(exp)(Data_Digit[\"_zero\"]);var digits=Data_Semigroup.append(Data_List_Types.semigroupList)(zeroes)(Data_List.mapMaybe(Data_Digit.fromChar)(base));var r={digits:digits,decimal:1,sign:Plus.value};return r}};var parseMinusMinus=function(exp){return function(base){var r=parseMinusPlus(exp)(base);return{digits:r.digits,decimal:r.decimal,sign:Minus.value}}};var scientificToHugeNum=function(n){var parsed=parseScientific(n);var r=function(){if(parsed.expSign instanceof Plus){if(parsed.sign instanceof Plus){return parsePlusPlus(parsed.exponent)(parsed.base)}return parsePlusMinus(parsed.exponent)(parsed.base)}if(parsed.sign instanceof Plus){return parseMinusPlus(parsed.exponent)(parsed.base)}return parseMinusMinus(parsed.exponent)(parsed.base)}();return r};var oneHugeNum={digits:new Data_List_Types.Cons(Data_Digit[\"_one\"],new Data_List_Types.Cons(Data_Digit[\"_zero\"],Data_List_Types.Nil.value)),decimal:1,sign:Plus.value};var neg=function(v){if(v.sign instanceof Minus){return{digits:v.digits,decimal:v.decimal,sign:Plus.value}}return{digits:v.digits,decimal:v.decimal,sign:Minus.value}};var meatyDecimals=function(v){var decimals=Data_List.reverse(Data_List.drop(v.decimal)(v.digits));var meaty=Data_List.dropWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(decimals);return Data_List.length(meaty)};var makeHugeInteger$prime=function(v){var digits=Data_Semigroup.append(Data_List_Types.semigroupList)(unsafeRemoveFrontZeroes(v.digits))(Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"]));var decimal=Data_List.length(digits)-1|0;var z={digits:digits,decimal:decimal,sign:v.sign};return z};var lessPrecise=function(v){return function(v1){return Data_List.length(Data_List.drop(v.decimal)(v.digits))=0;var split=function(){if(pos){return Data_List.span(function(v){return v!==\".\"})(Data_List.fromFoldable(Data_Foldable.foldableArray)(Data_String_CodeUnits.toCharArray(Data_Show.show(Data_Show.showNumber)(n))))}return Data_List.span(function(v){return v!==\".\"})(Data_List.drop(1)(Data_List.fromFoldable(Data_Foldable.foldableArray)(Data_String_CodeUnits.toCharArray(Data_Show.show(Data_Show.showNumber)(n)))))}();var small=Data_List.drop(1)(split.rest);var decimal=Data_List.length(split.init);var digits=Data_List.mapMaybe(Data_Digit.fromChar)(Data_Semigroup.append(Data_List_Types.semigroupList)(split.init)(small));var r={digits:digits,decimal:decimal,sign:sign};return r};var fromNumber=function(n){var v=parseNumber(n);if(v instanceof Float){return floatToHugeNum(n)}if(v instanceof Scientific){return scientificToHugeNum(n)}if(v instanceof Integral){return integralToHugeNum(n)}throw new Error(\"Failed pattern match at Data.HugeNum (line 283, column 16 - line 286, column 52): \"+[v.constructor.name])};var eqSign=new Data_Eq.Eq(function(v){return function(v1){if(v instanceof Plus&&v1 instanceof Plus){return true}if(v instanceof Minus&&v1 instanceof Minus){return true}return false}});var ordSign=new Data_Ord.Ord(function(){return eqSign},function(v){return function(v1){if(v instanceof Plus&&v1 instanceof Minus){return Data_Ordering.GT.value}if(v instanceof Minus&&v1 instanceof Plus){return Data_Ordering.LT.value}return Data_Ordering.EQ.value}});var strictlyEqual=function(v){return function(v1){return v.decimal===v1.decimal&&(Data_Eq.eq(Data_List_Types.eqList(Data_Digit.eqDigit))(v.digits)(v1.digits)&&Data_Eq.eq(eqSign)(v.sign)(v1.sign))}};var dropZeroes=function(){var dropIntegralZeroes=function(v){var integralPart=Data_List.take(v.decimal)(v.digits);var zeroes=Data_List.takeWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(integralPart);var digits=function(){var $148=Data_List.length(integralPart)===Data_List.length(zeroes);if($148){return Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"])}return Data_List.drop(Data_List.length(zeroes))(integralPart)}();var decimal=Data_List.length(digits);var z={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(digits)(Data_List.drop(v.decimal)(v.digits)),decimal:decimal,sign:v.sign};return z};var dropFractionalZeroes=function(v){var fractionalDigits=Data_List.reverse(Data_List.drop(v.decimal)(v.digits));var meatyFraction=Data_List.dropWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(fractionalDigits);var digits=Data_List.reverse(meatyFraction);var z={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(Data_List.take(v.decimal)(v.digits))(function(){var $150=Data_List[\"null\"](digits);if($150){return Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"])}return digits}()),decimal:v.decimal,sign:v.sign};return z};return function($213){return dropIntegralZeroes(dropFractionalZeroes($213))}}();var eqHugeNum=new Data_Eq.Eq(function(x){return function(y){if(isZero(x)&&isZero(y)){return true}if(Data_Boolean.otherwise){return strictlyEqual(dropZeroes(x))(dropZeroes(y))}throw new Error(\"Failed pattern match at Data.HugeNum (line 75, column 1 - line 75, column 33): \"+[x.constructor.name,y.constructor.name])}});var digitwiseSubtract=function(v){return function(v1){var tint=Data_Digit.toInt(v1.value0)-Data_Digit.toInt(v.value1)|0;var bint=Data_Digit.toInt(v1.value1);var diff$prime=tint-bint|0;var diff=Data_Maybe.fromJust()(Data_Digit.fromInt(function(){var $155=diff$prime<0;if($155){return diff$prime+10|0}return diff$prime}()));var spill=function(){var $156=diff$prime<0;if($156){return Data_Digit[\"_one\"]}return Data_Digit[\"_zero\"]}();return new Data_Tuple.Tuple(new Data_List_Types.Cons(diff,v.value0),spill)}};var digitwiseAdd=function(v){return function(v1){var tint=Data_Digit.toInt(v1.value0)+Data_Digit.toInt(v.value1)|0;var bint=Data_Digit.toInt(v1.value1);var summ$prime=tint+bint|0;var spill=function(){var $163=summ$prime>9;if($163){return Data_Digit[\"_one\"]}return Data_Digit[\"_zero\"]}();var summ=Data_Maybe.fromJust()(Data_Digit.fromInt(function(){var $164=summ$prime>9;if($164){return summ$prime-10|0}return summ$prime}()));return new Data_Tuple.Tuple(new Data_List_Types.Cons(summ,v.value0),spill)}};var equivalize=function(){var integralize=function(v){if(Data_List.length(Data_List.take(v.fst.decimal)(v.fst.digits))===Data_List.length(Data_List.take(v.snd.decimal)(v.snd.digits))){return{fst:v.fst,snd:v.snd}}if(Data_Boolean.otherwise){var lesser=rec(Data_Ord.min(ordHugeNum)(v.fst)(v.snd));var greater=rec(Data_Ord.max(ordHugeNum)(v.fst)(v.snd));var zeroesLength=Data_List.length(Data_List.take(greater.decimal)(greater.digits))-Data_List.length(Data_List.take(lesser.decimal)(lesser.digits))|0;var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(zeroesLength)(Data_Digit[\"_zero\"]);var lesser$prime={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(zeroes)(lesser.digits),decimal:greater.decimal,sign:lesser.sign};var z={fst:lesser$prime,snd:greater};return z}throw new Error(\"Failed pattern match at Data.HugeNum (line 150, column 3 - line 158, column 57): \"+[v.constructor.name])};var fractionalize=function(v){if(Data_List.length(Data_List.drop(v.fst.decimal)(v.fst.digits))===Data_List.length(Data_List.drop(v.snd.decimal)(v.snd.digits))){return{fst:v.fst,snd:v.snd}}if(Data_Boolean.otherwise){var test=lessPrecise(v.fst)(v.snd);var lesser=function(){if(test){return v.fst}return v.snd}();var greater=function(){if(test){return v.snd}return v.fst}();var lesserDecimal=Data_List.length(Data_List.drop(greater.decimal)(greater.digits))-Data_List.length(Data_List.drop(lesser.decimal)(lesser.digits))|0;var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(lesserDecimal)(Data_Digit[\"_zero\"]);var lesser$prime={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(lesser.digits)(zeroes),decimal:lesser.decimal,sign:lesser.sign};var z={fst:lesser$prime,snd:greater};return z}throw new Error(\"Failed pattern match at Data.HugeNum (line 140, column 3 - line 149, column 57): \"+[v.constructor.name])};return function($214){return integralize(fractionalize($214))}}();var compareHugeNum=function(v){return function(v1){if(Data_Ord.lessThan(ordSign)(v.sign)(v1.sign)){return Data_Ordering.LT.value}if(Data_Ord.greaterThan(ordSign)(v.sign)(v1.sign)){return Data_Ordering.GT.value}if(v.decimal>v1.decimal){return Data_Ordering.GT.value}if(v.decimal=0;i--){acc=f(xs[i])(acc)}return acc}}};exports.foldlArray=function(f){return function(init){return function(xs){var acc=init;var len=xs.length;for(var i=0;i=xs.length?nothing:just(xs[i])}}}};exports.sortImpl=function(f){return function(l){return l.slice().sort(function(x,y){return f(x)(y)})}};exports.slice=function(s){return function(e){return function(l){return l.slice(s,e)}}}})(PS[\"Data.Array\"]=PS[\"Data.Array\"]||{});(function(exports){\"use strict\";var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Biapplicative=PS[\"Control.Biapplicative\"];var Control_Biapply=PS[\"Control.Biapply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Comonad=PS[\"Control.Comonad\"];var Control_Extend=PS[\"Control.Extend\"];var Control_Lazy=PS[\"Control.Lazy\"];var Control_Monad=PS[\"Control.Monad\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Bifoldable=PS[\"Data.Bifoldable\"];var Data_Bifunctor=PS[\"Data.Bifunctor\"];var Data_Bitraversable=PS[\"Data.Bitraversable\"];var Data_BooleanAlgebra=PS[\"Data.BooleanAlgebra\"];var Data_Bounded=PS[\"Data.Bounded\"];var Data_CommutativeRing=PS[\"Data.CommutativeRing\"];var Data_Distributive=PS[\"Data.Distributive\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_FoldableWithIndex=PS[\"Data.FoldableWithIndex\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Functor_Invariant=PS[\"Data.Functor.Invariant\"];var Data_FunctorWithIndex=PS[\"Data.FunctorWithIndex\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Maybe_First=PS[\"Data.Maybe.First\"];var Data_Monoid=PS[\"Data.Monoid\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semigroup_Foldable=PS[\"Data.Semigroup.Foldable\"];var Data_Semigroup_Traversable=PS[\"Data.Semigroup.Traversable\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_TraversableWithIndex=PS[\"Data.TraversableWithIndex\"];var Data_Unit=PS[\"Data.Unit\"];var Prelude=PS[\"Prelude\"];var Type_Equality=PS[\"Type.Equality\"];var Tuple=function(){function Tuple(value0,value1){this.value0=value0;this.value1=value1}Tuple.create=function(value0){return function(value1){return new Tuple(value0,value1)}};return Tuple}();var snd=function(v){return v.value1};var fst=function(v){return v.value0};exports[\"Tuple\"]=Tuple;exports[\"fst\"]=fst;exports[\"snd\"]=snd})(PS[\"Data.Tuple\"]=PS[\"Data.Tuple\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Unfoldable1\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup_Traversable=PS[\"Data.Semigroup.Traversable\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Tuple=PS[\"Data.Tuple\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Unfoldable1=function(unfoldr1){this.unfoldr1=unfoldr1};var unfoldr1=function(dict){return dict.unfoldr1};exports[\"Unfoldable1\"]=Unfoldable1;exports[\"unfoldr1\"]=unfoldr1})(PS[\"Data.Unfoldable1\"]=PS[\"Data.Unfoldable1\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Unfoldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable1=PS[\"Data.Unfoldable1\"];var Data_Unit=PS[\"Data.Unit\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Unfoldable=function(Unfoldable10,unfoldr){this.Unfoldable10=Unfoldable10;this.unfoldr=unfoldr};var unfoldr=function(dict){return dict.unfoldr};var replicate=function(dictUnfoldable){return function(n){return function(v){var step=function(i){var $7=i<=0;if($7){return Data_Maybe.Nothing.value}return new Data_Maybe.Just(new Data_Tuple.Tuple(v,i-1|0))};return unfoldr(dictUnfoldable)(step)(n)}}};exports[\"Unfoldable\"]=Unfoldable;exports[\"unfoldr\"]=unfoldr;exports[\"replicate\"]=replicate})(PS[\"Data.Unfoldable\"]=PS[\"Data.Unfoldable\"]||{});(function(exports){\"use strict\";exports.unsafeCoerce=function(x){return x}})(PS[\"Unsafe.Coerce\"]=PS[\"Unsafe.Coerce\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Unsafe.Coerce\"];exports[\"unsafeCoerce\"]=$foreign.unsafeCoerce})(PS[\"Unsafe.Coerce\"]=PS[\"Unsafe.Coerce\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Array\"];var Control_Alt=PS[\"Control.Alt\"];var Control_Alternative=PS[\"Control.Alternative\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Category=PS[\"Control.Category\"];var Control_Lazy=PS[\"Control.Lazy\"];var Control_Monad_Rec_Class=PS[\"Control.Monad.Rec.Class\"];var Control_Monad_ST=PS[\"Control.Monad.ST\"];var Control_Monad_ST_Internal=PS[\"Control.Monad.ST.Internal\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Array_NonEmpty_Internal=PS[\"Data.Array.NonEmpty.Internal\"];var Data_Array_ST=PS[\"Data.Array.ST\"];var Data_Array_ST_Iterator=PS[\"Data.Array.ST.Iterator\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Unsafe_Coerce=PS[\"Unsafe.Coerce\"];var sortBy=function(comp){return function(xs){var comp$prime=function(x){return function(y){var v=comp(x)(y);if(v instanceof Data_Ordering.GT){return 1}if(v instanceof Data_Ordering.EQ){return 0}if(v instanceof Data_Ordering.LT){return-1|0}throw new Error(\"Failed pattern match at Data.Array (line 702, column 15 - line 707, column 1): \"+[v.constructor.name])}};return $foreign.sortImpl(comp$prime)(xs)}};var sortWith=function(dictOrd){return function(f){return sortBy(Data_Ord.comparing(dictOrd)(f))}};var singleton=function(a){return[a]};var index=$foreign.indexImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var concatMap=Data_Function.flip(Control_Bind.bind(Control_Bind.bindArray));var mapMaybe=function(f){return concatMap(function($114){return Data_Maybe.maybe([])(singleton)(f($114))})};exports[\"singleton\"]=singleton;exports[\"index\"]=index;exports[\"concatMap\"]=concatMap;exports[\"mapMaybe\"]=mapMaybe;exports[\"sortBy\"]=sortBy;exports[\"sortWith\"]=sortWith;exports[\"length\"]=$foreign.length})(PS[\"Data.Array\"]=PS[\"Data.Array\"]||{});(function(exports){\"use strict\";exports.toCharCode=function(c){return c.charCodeAt(0)};exports.fromCharCode=function(c){return String.fromCharCode(c)}})(PS[\"Data.Enum\"]=PS[\"Data.Enum\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Enum\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_MonadPlus=PS[\"Control.MonadPlus\"];var Control_MonadZero=PS[\"Control.MonadZero\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Bounded=PS[\"Data.Bounded\"];var Data_Either=PS[\"Data.Either\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Data_Unfoldable1=PS[\"Data.Unfoldable1\"];var Data_Unit=PS[\"Data.Unit\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Enum=function(Ord0,pred,succ){this.Ord0=Ord0;this.pred=pred;this.succ=succ};var BoundedEnum=function(Bounded0,Enum1,cardinality,fromEnum,toEnum){this.Bounded0=Bounded0;this.Enum1=Enum1;this.cardinality=cardinality;this.fromEnum=fromEnum;this.toEnum=toEnum};var toEnum=function(dict){return dict.toEnum};var succ=function(dict){return dict.succ};var pred=function(dict){return dict.pred};var fromEnum=function(dict){return dict.fromEnum};var defaultSucc=function(toEnum$prime){return function(fromEnum$prime){return function(a){return toEnum$prime(fromEnum$prime(a)+1|0)}}};var defaultPred=function(toEnum$prime){return function(fromEnum$prime){return function(a){return toEnum$prime(fromEnum$prime(a)-1|0)}}};var charToEnum=function(v){if(v>=Data_Bounded.bottom(Data_Bounded.boundedInt)&&v<=Data_Bounded.top(Data_Bounded.boundedInt)){return new Data_Maybe.Just($foreign.fromCharCode(v))}return Data_Maybe.Nothing.value};var enumChar=new Enum(function(){return Data_Ord.ordChar},defaultPred(charToEnum)($foreign.toCharCode),defaultSucc(charToEnum)($foreign.toCharCode));var cardinality=function(dict){return dict.cardinality};var boundedEnumChar=new BoundedEnum(function(){return Data_Bounded.boundedChar},function(){return enumChar},$foreign.toCharCode(Data_Bounded.top(Data_Bounded.boundedChar))-$foreign.toCharCode(Data_Bounded.bottom(Data_Bounded.boundedChar))|0,$foreign.toCharCode,charToEnum);exports[\"Enum\"]=Enum;exports[\"succ\"]=succ;exports[\"pred\"]=pred;exports[\"BoundedEnum\"]=BoundedEnum;exports[\"cardinality\"]=cardinality;exports[\"toEnum\"]=toEnum;exports[\"fromEnum\"]=fromEnum;exports[\"defaultSucc\"]=defaultSucc;exports[\"defaultPred\"]=defaultPred;exports[\"enumChar\"]=enumChar;exports[\"boundedEnumChar\"]=boundedEnumChar})(PS[\"Data.Enum\"]=PS[\"Data.Enum\"]||{});(function(exports){\"use strict\";var Data_Enum=PS[\"Data.Enum\"];var Data_Maybe=PS[\"Data.Maybe\"];var toCharCode=Data_Enum.fromEnum(Data_Enum.boundedEnumChar);var fromCharCode=Data_Enum.toEnum(Data_Enum.boundedEnumChar);exports[\"toCharCode\"]=toCharCode;exports[\"fromCharCode\"]=fromCharCode})(PS[\"Data.Char\"]=PS[\"Data.Char\"]||{});(function(exports){\"use strict\";var Data_Boolean=PS[\"Data.Boolean\"];var Data_Char=PS[\"Data.Char\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Function=PS[\"Data.Function\"];var Data_Generic_Rep=PS[\"Data.Generic.Rep\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Digit=function(x){return x};var toInt=function(v){return v};var toChar=function(v){return Data_Maybe.fromJust()(Data_Char.fromCharCode(v+48|0))};var fromInt=function(c){if(0<=c&&c<=9){return new Data_Maybe.Just(c)}if(Data_Boolean.otherwise){return Data_Maybe.Nothing.value}throw new Error(\"Failed pattern match at Data.Digit (line 27, column 1 - line 27, column 30): \"+[c.constructor.name])};var fromChar=function(c){var code=Data_Char.toCharCode(c);var $16=code>=48&&code<=57;if($16){return new Data_Maybe.Just(Digit(code-48|0))}return Data_Maybe.Nothing.value};var eqDigit=new Data_Eq.Eq(function(v){return function(v1){return v===v1}});var ordDigit=new Data_Ord.Ord(function(){return eqDigit},function(v){return function(v1){return Data_Ord.compare(Data_Ord.ordInt)(v)(v1)}});var _zero=0;var _one=1;exports[\"fromInt\"]=fromInt;exports[\"toInt\"]=toInt;exports[\"fromChar\"]=fromChar;exports[\"toChar\"]=toChar;exports[\"_zero\"]=_zero;exports[\"_one\"]=_one;exports[\"eqDigit\"]=eqDigit;exports[\"ordDigit\"]=ordDigit})(PS[\"Data.Digit\"]=PS[\"Data.Digit\"]||{});(function(exports){\"use strict\";exports.fromNumberImpl=function(just){return function(nothing){return function(n){return(n|0)===n?just(n):nothing}}};exports.toNumber=function(n){return n};exports.fromStringAsImpl=function(just){return function(nothing){return function(radix){var digits;if(radix<11){digits=\"[0-\"+(radix-1).toString()+\"]\"}else if(radix===11){digits=\"[0-9a]\"}else{digits=\"[0-9a-\"+String.fromCharCode(86+radix)+\"]\"}var pattern=new RegExp(\"^[\\\\+\\\\-]?\"+digits+\"+$\",\"i\");return function(s){if(pattern.test(s)){var i=parseInt(s,radix);return(i|0)===i?just(i):nothing}else{return nothing}}}}}})(PS[\"Data.Int\"]=PS[\"Data.Int\"]||{});(function(exports){\"use strict\";exports.infinity=Infinity;exports.readFloat=parseFloat})(PS[\"Global\"]=PS[\"Global\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Global\"];exports[\"infinity\"]=$foreign.infinity;exports[\"readFloat\"]=$foreign.readFloat})(PS[\"Global\"]=PS[\"Global\"]||{});(function(exports){\"use strict\";exports.round=Math.round})(PS[\"Math\"]=PS[\"Math\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Math\"];exports[\"round\"]=$foreign.round})(PS[\"Math\"]=PS[\"Math\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Data.Int\"];var Control_Category=PS[\"Control.Category\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Bounded=PS[\"Data.Bounded\"];var Data_CommutativeRing=PS[\"Data.CommutativeRing\"];var Data_DivisionRing=PS[\"Data.DivisionRing\"];var Data_Eq=PS[\"Data.Eq\"];var Data_EuclideanRing=PS[\"Data.EuclideanRing\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Int_Bits=PS[\"Data.Int.Bits\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Global=PS[\"Global\"];var $$Math=PS[\"Math\"];var Prelude=PS[\"Prelude\"];var fromStringAs=$foreign.fromStringAsImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var fromString=fromStringAs(10);var fromNumber=$foreign.fromNumberImpl(Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var unsafeClamp=function(x){if(x===Global.infinity){return 0}if(x===-Global.infinity){return 0}if(x>=$foreign.toNumber(Data_Bounded.top(Data_Bounded.boundedInt))){return Data_Bounded.top(Data_Bounded.boundedInt)}if(x<=$foreign.toNumber(Data_Bounded.bottom(Data_Bounded.boundedInt))){return Data_Bounded.bottom(Data_Bounded.boundedInt)}if(Data_Boolean.otherwise){return Data_Maybe.fromMaybe(0)(fromNumber(x))}throw new Error(\"Failed pattern match at Data.Int (line 66, column 1 - line 66, column 29): \"+[x.constructor.name])};var round=function($23){return unsafeClamp($$Math.round($23))};exports[\"fromNumber\"]=fromNumber;exports[\"round\"]=round;exports[\"fromString\"]=fromString;exports[\"fromStringAs\"]=fromStringAs;exports[\"toNumber\"]=$foreign.toNumber})(PS[\"Data.Int\"]=PS[\"Data.Int\"]||{});(function(exports){\"use strict\";var Control_Alt=PS[\"Control.Alt\"];var Control_Alternative=PS[\"Control.Alternative\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Category=PS[\"Control.Category\"];var Control_Comonad=PS[\"Control.Comonad\"];var Control_Extend=PS[\"Control.Extend\"];var Control_Monad=PS[\"Control.Monad\"];var Control_MonadPlus=PS[\"Control.MonadPlus\"];var Control_MonadZero=PS[\"Control.MonadZero\"];var Control_Plus=PS[\"Control.Plus\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_FoldableWithIndex=PS[\"Data.FoldableWithIndex\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_FunctorWithIndex=PS[\"Data.FunctorWithIndex\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Monoid=PS[\"Data.Monoid\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_NonEmpty=PS[\"Data.NonEmpty\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semigroup_Foldable=PS[\"Data.Semigroup.Foldable\"];var Data_Semigroup_Traversable=PS[\"Data.Semigroup.Traversable\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_TraversableWithIndex=PS[\"Data.TraversableWithIndex\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Data_Unfoldable1=PS[\"Data.Unfoldable1\"];var Prelude=PS[\"Prelude\"];var Nil=function(){function Nil(){}Nil.value=new Nil;return Nil}();var Cons=function(){function Cons(value0,value1){this.value0=value0;this.value1=value1}Cons.create=function(value0){return function(value1){return new Cons(value0,value1)}};return Cons}();var foldableList=new Data_Foldable.Foldable(function(dictMonoid){return function(f){return Data_Foldable.foldl(foldableList)(function(acc){return function($174){return Data_Semigroup.append(dictMonoid.Semigroup0())(acc)(f($174))}})(Data_Monoid.mempty(dictMonoid))}},function(f){var go=function($copy_b){return function($copy_v){var $tco_var_b=$copy_b;var $tco_done=false;var $tco_result;function $tco_loop(b,v){if(v instanceof Nil){$tco_done=true;return b}if(v instanceof Cons){$tco_var_b=f(b)(v.value0);$copy_v=v.value1;return}throw new Error(\"Failed pattern match at Data.List.Types (line 81, column 12 - line 83, column 30): \"+[v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_b,$copy_v)}return $tco_result}};return go},function(f){return function(b){var rev=Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value);return function($175){return Data_Foldable.foldl(foldableList)(Data_Function.flip(f))(b)(rev($175))}}});var functorList=new Data_Functor.Functor(function(f){return Data_Foldable.foldr(foldableList)(function(x){return function(acc){return new Cons(f(x),acc)}})(Nil.value)});var semigroupList=new Data_Semigroup.Semigroup(function(xs){return function(ys){return Data_Foldable.foldr(foldableList)(Cons.create)(ys)(xs)}});var monoidList=new Data_Monoid.Monoid(function(){return semigroupList},Nil.value);var unfoldable1List=new Data_Unfoldable1.Unfoldable1(function(f){return function(b){var go=function($copy_source){return function($copy_memo){var $tco_var_source=$copy_source;var $tco_done=false;var $tco_result;function $tco_loop(source,memo){var v=f(source);if(v.value1 instanceof Data_Maybe.Just){$tco_var_source=v.value1.value0;$copy_memo=new Cons(v.value0,memo);return}if(v.value1 instanceof Data_Maybe.Nothing){$tco_done=true;return Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value)(new Cons(v.value0,memo))}throw new Error(\"Failed pattern match at Data.List.Types (line 105, column 22 - line 107, column 61): \"+[v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_source,$copy_memo)}return $tco_result}};return go(b)(Nil.value)}});var unfoldableList=new Data_Unfoldable.Unfoldable(function(){return unfoldable1List},function(f){return function(b){var go=function($copy_source){return function($copy_memo){var $tco_var_source=$copy_source;var $tco_done=false;var $tco_result;function $tco_loop(source,memo){var v=f(source);if(v instanceof Data_Maybe.Nothing){$tco_done=true;return Data_Foldable.foldl(foldableList)(Data_Function.flip(Cons.create))(Nil.value)(memo)}if(v instanceof Data_Maybe.Just){$tco_var_source=v.value0.value1;$copy_memo=new Cons(v.value0.value0,memo);return}throw new Error(\"Failed pattern match at Data.List.Types (line 112, column 22 - line 114, column 52): \"+[v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_source,$copy_memo)}return $tco_result}};return go(b)(Nil.value)}});var eq1List=new Data_Eq.Eq1(function(dictEq){return function(xs){return function(ys){var go=function($copy_v){return function($copy_v1){return function($copy_v2){var $tco_var_v=$copy_v;var $tco_var_v1=$copy_v1;var $tco_done=false;var $tco_result;function $tco_loop(v,v1,v2){if(!v2){$tco_done=true;return false}if(v instanceof Nil&&v1 instanceof Nil){$tco_done=true;return v2}if(v instanceof Cons&&v1 instanceof Cons){$tco_var_v=v.value1;$tco_var_v1=v1.value1;$copy_v2=v2&&Data_Eq.eq(dictEq)(v1.value0)(v.value0);return}$tco_done=true;return false}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$tco_var_v1,$copy_v2)}return $tco_result}}};return go(xs)(ys)(true)}}});var eqList=function(dictEq){return new Data_Eq.Eq(Data_Eq.eq1(eq1List)(dictEq))};var ord1List=new Data_Ord.Ord1(function(){return eq1List},function(dictOrd){return function(xs){return function(ys){var go=function($copy_v){return function($copy_v1){var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(v,v1){if(v instanceof Nil&&v1 instanceof Nil){$tco_done=true;return Data_Ordering.EQ.value}if(v instanceof Nil){$tco_done=true;return Data_Ordering.LT.value}if(v1 instanceof Nil){$tco_done=true;return Data_Ordering.GT.value}if(v instanceof Cons&&v1 instanceof Cons){var v2=Data_Ord.compare(dictOrd)(v.value0)(v1.value0);if(v2 instanceof Data_Ordering.EQ){$tco_var_v=v.value1;$copy_v1=v1.value1;return}$tco_done=true;return v2}throw new Error(\"Failed pattern match at Data.List.Types (line 55, column 5 - line 55, column 20): \"+[v.constructor.name,v1.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$copy_v1)}return $tco_result}};return go(xs)(ys)}}});var ordList=function(dictOrd){return new Data_Ord.Ord(function(){return eqList(dictOrd.Eq0())},Data_Ord.compare1(ord1List)(dictOrd))};var applyList=new Control_Apply.Apply(function(){return functorList},function(v){return function(v1){if(v instanceof Nil){return Nil.value}if(v instanceof Cons){return Data_Semigroup.append(semigroupList)(Data_Functor.map(functorList)(v.value0)(v1))(Control_Apply.apply(applyList)(v.value1)(v1))}throw new Error(\"Failed pattern match at Data.List.Types (line 127, column 1 - line 127, column 33): \"+[v.constructor.name,v1.constructor.name])}});var applicativeList=new Control_Applicative.Applicative(function(){return applyList},function(a){return new Cons(a,Nil.value)});exports[\"Nil\"]=Nil;exports[\"Cons\"]=Cons;exports[\"eqList\"]=eqList;exports[\"eq1List\"]=eq1List;exports[\"ordList\"]=ordList;exports[\"ord1List\"]=ord1List;exports[\"semigroupList\"]=semigroupList;exports[\"monoidList\"]=monoidList;exports[\"functorList\"]=functorList;exports[\"foldableList\"]=foldableList;exports[\"unfoldable1List\"]=unfoldable1List;exports[\"unfoldableList\"]=unfoldableList;exports[\"applyList\"]=applyList;exports[\"applicativeList\"]=applicativeList})(PS[\"Data.List.Types\"]=PS[\"Data.List.Types\"]||{});(function(exports){\"use strict\";var Control_Alt=PS[\"Control.Alt\"];var Control_Alternative=PS[\"Control.Alternative\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Apply=PS[\"Control.Apply\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Category=PS[\"Control.Category\"];var Control_Lazy=PS[\"Control.Lazy\"];var Control_Monad_Rec_Class=PS[\"Control.Monad.Rec.Class\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Bifunctor=PS[\"Data.Bifunctor\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Eq=PS[\"Data.Eq\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_FunctorWithIndex=PS[\"Data.FunctorWithIndex\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_List_Types=PS[\"Data.List.Types\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Newtype=PS[\"Data.Newtype\"];var Data_NonEmpty=PS[\"Data.NonEmpty\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Data_Unit=PS[\"Data.Unit\"];var Prelude=PS[\"Prelude\"];var uncons=function(v){if(v instanceof Data_List_Types.Nil){return Data_Maybe.Nothing.value}if(v instanceof Data_List_Types.Cons){return new Data_Maybe.Just({head:v.value0,tail:v.value1})}throw new Error(\"Failed pattern match at Data.List (line 259, column 1 - line 259, column 66): \"+[v.constructor.name])};var span=function(v){return function(v1){if(v1 instanceof Data_List_Types.Cons&&v(v1.value0)){var v2=span(v)(v1.value1);return{init:new Data_List_Types.Cons(v1.value0,v2.init),rest:v2.rest}}return{init:Data_List_Types.Nil.value,rest:v1}}};var reverse=function(){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Nil){$tco_done=true;return acc}if(v instanceof Data_List_Types.Cons){$tco_var_acc=new Data_List_Types.Cons(v.value0,acc);$copy_v=v.value1;return}throw new Error(\"Failed pattern match at Data.List (line 368, column 3 - line 368, column 19): \"+[acc.constructor.name,v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)}();var take=function(){var go=function($copy_acc){return function($copy_v){return function($copy_v1){var $tco_var_acc=$copy_acc;var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(acc,v,v1){if(v<1){$tco_done=true;return reverse(acc)}if(v1 instanceof Data_List_Types.Nil){$tco_done=true;return reverse(acc)}if(v1 instanceof Data_List_Types.Cons){$tco_var_acc=new Data_List_Types.Cons(v1.value0,acc);$tco_var_v=v-1|0;$copy_v1=v1.value1;return}throw new Error(\"Failed pattern match at Data.List (line 520, column 3 - line 520, column 35): \"+[acc.constructor.name,v.constructor.name,v1.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$tco_var_v,$copy_v1)}return $tco_result}}};return go(Data_List_Types.Nil.value)}();var takeWhile=function(p){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Cons&&p(v.value0)){$tco_var_acc=new Data_List_Types.Cons(v.value0,acc);$copy_v=v.value1;return}$tco_done=true;return reverse(acc)}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)};var unsnoc=function(lst){var go=function($copy_v){return function($copy_acc){var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(v,acc){if(v instanceof Data_List_Types.Nil){$tco_done=true;return Data_Maybe.Nothing.value}if(v instanceof Data_List_Types.Cons&&v.value1 instanceof Data_List_Types.Nil){$tco_done=true;return new Data_Maybe.Just({revInit:acc,last:v.value0})}if(v instanceof Data_List_Types.Cons){$tco_var_v=v.value1;$copy_acc=new Data_List_Types.Cons(v.value0,acc);return}throw new Error(\"Failed pattern match at Data.List (line 270, column 3 - line 270, column 23): \"+[v.constructor.name,acc.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$copy_acc)}return $tco_result}};return Data_Functor.map(Data_Maybe.functorMaybe)(function(h){return{init:reverse(h.revInit),last:h.last}})(go(lst)(Data_List_Types.Nil.value))};var zipWith=function(f){return function(xs){return function(ys){var go=function($copy_v){return function($copy_v1){return function($copy_acc){var $tco_var_v=$copy_v;var $tco_var_v1=$copy_v1;var $tco_done=false;var $tco_result;function $tco_loop(v,v1,acc){if(v instanceof Data_List_Types.Nil){$tco_done=true;return acc}if(v1 instanceof Data_List_Types.Nil){$tco_done=true;return acc}if(v instanceof Data_List_Types.Cons&&v1 instanceof Data_List_Types.Cons){$tco_var_v=v.value1;$tco_var_v1=v1.value1;$copy_acc=new Data_List_Types.Cons(f(v.value0)(v1.value0),acc);return}throw new Error(\"Failed pattern match at Data.List (line 718, column 3 - line 718, column 21): \"+[v.constructor.name,v1.constructor.name,acc.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$tco_var_v1,$copy_acc)}return $tco_result}}};return reverse(go(xs)(ys)(Data_List_Types.Nil.value))}}};var zip=zipWith(Data_Tuple.Tuple.create);var $$null=function(v){if(v instanceof Data_List_Types.Nil){return true}return false};var mapMaybe=function(f){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Nil){$tco_done=true;return reverse(acc)}if(v instanceof Data_List_Types.Cons){var v1=f(v.value0);if(v1 instanceof Data_Maybe.Nothing){$tco_var_acc=acc;$copy_v=v.value1;return}if(v1 instanceof Data_Maybe.Just){$tco_var_acc=new Data_List_Types.Cons(v1.value0,acc);$copy_v=v.value1;return}throw new Error(\"Failed pattern match at Data.List (line 419, column 5 - line 421, column 32): \"+[v1.constructor.name])}throw new Error(\"Failed pattern match at Data.List (line 417, column 3 - line 417, column 27): \"+[acc.constructor.name,v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)};var length=Data_Foldable.foldl(Data_List_Types.foldableList)(function(acc){return function(v){return acc+1|0}})(0);var last=function($copy_v){var $tco_done=false;var $tco_result;function $tco_loop(v){if(v instanceof Data_List_Types.Cons&&v.value1 instanceof Data_List_Types.Nil){$tco_done=true;return new Data_Maybe.Just(v.value0)}if(v instanceof Data_List_Types.Cons){$copy_v=v.value1;return}$tco_done=true;return Data_Maybe.Nothing.value}while(!$tco_done){$tco_result=$tco_loop($copy_v)}return $tco_result};var insertAt=function(v){return function(v1){return function(v2){if(v===0){return new Data_Maybe.Just(new Data_List_Types.Cons(v1,v2))}if(v2 instanceof Data_List_Types.Cons){return Data_Functor.map(Data_Maybe.functorMaybe)(function(v3){return new Data_List_Types.Cons(v2.value0,v3)})(insertAt(v-1|0)(v1)(v2.value1))}return Data_Maybe.Nothing.value}}};var init=function(lst){return Data_Functor.map(Data_Maybe.functorMaybe)(function(v){return v.init})(unsnoc(lst))};var fromFoldable=function(dictFoldable){return Data_Foldable.foldr(dictFoldable)(Data_List_Types.Cons.create)(Data_List_Types.Nil.value)};var filter=function(p){var go=function($copy_acc){return function($copy_v){var $tco_var_acc=$copy_acc;var $tco_done=false;var $tco_result;function $tco_loop(acc,v){if(v instanceof Data_List_Types.Nil){$tco_done=true;return reverse(acc)}if(v instanceof Data_List_Types.Cons){if(p(v.value0)){$tco_var_acc=new Data_List_Types.Cons(v.value0,acc);$copy_v=v.value1;return}if(Data_Boolean.otherwise){$tco_var_acc=acc;$copy_v=v.value1;return}}throw new Error(\"Failed pattern match at Data.List (line 390, column 3 - line 390, column 27): \"+[acc.constructor.name,v.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_acc,$copy_v)}return $tco_result}};return go(Data_List_Types.Nil.value)};var dropWhile=function(p){var go=function($copy_v){var $tco_done=false;var $tco_result;function $tco_loop(v){if(v instanceof Data_List_Types.Cons&&p(v.value0)){$copy_v=v.value1;return}$tco_done=true;return v}while(!$tco_done){$tco_result=$tco_loop($copy_v)}return $tco_result};return go};var drop=function($copy_v){return function($copy_v1){var $tco_var_v=$copy_v;var $tco_done=false;var $tco_result;function $tco_loop(v,v1){if(v<1){$tco_done=true;return v1}if(v1 instanceof Data_List_Types.Nil){$tco_done=true;return Data_List_Types.Nil.value}if(v1 instanceof Data_List_Types.Cons){$tco_var_v=v-1|0;$copy_v1=v1.value1;return}throw new Error(\"Failed pattern match at Data.List (line 543, column 1 - line 543, column 42): \"+[v.constructor.name,v1.constructor.name])}while(!$tco_done){$tco_result=$tco_loop($tco_var_v,$copy_v1)}return $tco_result}};exports[\"fromFoldable\"]=fromFoldable;exports[\"null\"]=$$null;exports[\"length\"]=length;exports[\"last\"]=last;exports[\"init\"]=init;exports[\"uncons\"]=uncons;exports[\"unsnoc\"]=unsnoc;exports[\"insertAt\"]=insertAt;exports[\"reverse\"]=reverse;exports[\"filter\"]=filter;exports[\"mapMaybe\"]=mapMaybe;exports[\"take\"]=take;exports[\"takeWhile\"]=takeWhile;exports[\"drop\"]=drop;exports[\"dropWhile\"]=dropWhile;exports[\"span\"]=span;exports[\"zipWith\"]=zipWith;exports[\"zip\"]=zip})(PS[\"Data.List\"]=PS[\"Data.List\"]||{});(function(exports){\"use strict\";exports.toCharArray=function(s){return s.split(\"\")};exports.singleton=function(c){return c};exports.length=function(s){return s.length};exports.countPrefix=function(p){return function(s){var i=0;while(i=l||(e$prime<0||(e$prime>l||b$prime>e$prime)));if($7){return Data_Maybe.Nothing.value}return new Data_Maybe.Just($foreign[\"_slice\"](b)(e)(s))}}};var indexOf=$foreign[\"_indexOf\"](Data_Maybe.Just.create)(Data_Maybe.Nothing.value);var stripPrefix=function(v){return function(str){var v1=indexOf(v)(str);if(v1 instanceof Data_Maybe.Just&&v1.value0===0){return Data_Maybe.Just.create($foreign.drop($foreign.length(v))(str))}return Data_Maybe.Nothing.value}};var contains=function(pat){return function($16){return Data_Maybe.isJust(indexOf(pat)($16))}};exports[\"stripPrefix\"]=stripPrefix;exports[\"contains\"]=contains;exports[\"indexOf\"]=indexOf;exports[\"takeWhile\"]=takeWhile;exports[\"slice\"]=slice;exports[\"singleton\"]=$foreign.singleton;exports[\"toCharArray\"]=$foreign.toCharArray;exports[\"drop\"]=$foreign.drop})(PS[\"Data.String.CodeUnits\"]=PS[\"Data.String.CodeUnits\"]||{});(function(exports){\"use strict\";exports.error=function(msg){return new Error(msg)};exports.throwException=function(e){return function(){throw e}}})(PS[\"Effect.Exception\"]=PS[\"Effect.Exception\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Effect.Exception\"];var Control_Applicative=PS[\"Control.Applicative\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Either=PS[\"Data.Either\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Show=PS[\"Data.Show\"];var Effect=PS[\"Effect\"];var Prelude=PS[\"Prelude\"];exports[\"error\"]=$foreign.error;exports[\"throwException\"]=$foreign.throwException})(PS[\"Effect.Exception\"]=PS[\"Effect.Exception\"]||{});(function(exports){\"use strict\";exports.unsafePerformEffect=function(f){return f()}})(PS[\"Effect.Unsafe\"]=PS[\"Effect.Unsafe\"]||{});(function(exports){\"use strict\";var $foreign=PS[\"Effect.Unsafe\"];var Effect=PS[\"Effect\"];exports[\"unsafePerformEffect\"]=$foreign.unsafePerformEffect})(PS[\"Effect.Unsafe\"]=PS[\"Effect.Unsafe\"]||{});(function(exports){\"use strict\";var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Effect_Exception=PS[\"Effect.Exception\"];var Effect_Unsafe=PS[\"Effect.Unsafe\"];var unsafeThrowException=function($0){return Effect_Unsafe.unsafePerformEffect(Effect_Exception.throwException($0))};var unsafeThrow=function($1){return unsafeThrowException(Effect_Exception.error($1))};exports[\"unsafeThrowException\"]=unsafeThrowException;exports[\"unsafeThrow\"]=unsafeThrow})(PS[\"Effect.Exception.Unsafe\"]=PS[\"Effect.Exception.Unsafe\"]||{});(function(exports){\"use strict\";var Control_Applicative=PS[\"Control.Applicative\"];var Control_Bind=PS[\"Control.Bind\"];var Control_Semigroupoid=PS[\"Control.Semigroupoid\"];var Data_Boolean=PS[\"Data.Boolean\"];var Data_Digit=PS[\"Data.Digit\"];var Data_Eq=PS[\"Data.Eq\"];var Data_EuclideanRing=PS[\"Data.EuclideanRing\"];var Data_Foldable=PS[\"Data.Foldable\"];var Data_Function=PS[\"Data.Function\"];var Data_Functor=PS[\"Data.Functor\"];var Data_Generic_Rep=PS[\"Data.Generic.Rep\"];var Data_HeytingAlgebra=PS[\"Data.HeytingAlgebra\"];var Data_Int=PS[\"Data.Int\"];var Data_List=PS[\"Data.List\"];var Data_List_Types=PS[\"Data.List.Types\"];var Data_Maybe=PS[\"Data.Maybe\"];var Data_Monoid=PS[\"Data.Monoid\"];var Data_Ord=PS[\"Data.Ord\"];var Data_Ordering=PS[\"Data.Ordering\"];var Data_Ring=PS[\"Data.Ring\"];var Data_Semigroup=PS[\"Data.Semigroup\"];var Data_Semiring=PS[\"Data.Semiring\"];var Data_Show=PS[\"Data.Show\"];var Data_String=PS[\"Data.String\"];var Data_String_CodeUnits=PS[\"Data.String.CodeUnits\"];var Data_String_Pattern=PS[\"Data.String.Pattern\"];var Data_Traversable=PS[\"Data.Traversable\"];var Data_Tuple=PS[\"Data.Tuple\"];var Data_Unfoldable=PS[\"Data.Unfoldable\"];var Effect_Exception_Unsafe=PS[\"Effect.Exception.Unsafe\"];var Global=PS[\"Global\"];var Partial_Unsafe=PS[\"Partial.Unsafe\"];var Prelude=PS[\"Prelude\"];var Plus=function(){function Plus(){}Plus.value=new Plus;return Plus}();var Minus=function(){function Minus(){}Minus.value=new Minus;return Minus}();var Float=function(){function Float(){}Float.value=new Float;return Float}();var Integral=function(){function Integral(){}Integral.value=new Integral;return Integral}();var Scientific=function(){function Scientific(){}Scientific.value=new Scientific;return Scientific}();var zeroHugeNum={digits:new Data_List_Types.Cons(Data_Digit[\"_zero\"],new Data_List_Types.Cons(Data_Digit[\"_zero\"],Data_List_Types.Nil.value)),decimal:1,sign:Plus.value};var unsafeRemoveFrontZeroes=Data_List.dropWhile(function(v){return Data_Eq.eq(Data_Digit.eqDigit)(v)(Data_Digit[\"_zero\"])});var trivialFraction=function(v){var decimals=Data_List.reverse(Data_List.drop(v.decimal)(v.digits));var meaty=Data_List.dropWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(decimals);return Data_List[\"null\"](meaty)};var toString=function(v){var sign=function(){if(v.sign instanceof Plus){return Data_Monoid.mempty(Data_List_Types.monoidList)}if(v.sign instanceof Minus){return Control_Applicative.pure(Data_List_Types.applicativeList)(\"-\")}throw new Error(\"Failed pattern match at Data.HugeNum (line 174, column 14 - line 176, column 49): \"+[v.sign.constructor.name])}();var charray=Data_Functor.map(Data_List_Types.functorList)(Data_Digit.toChar)(v.digits);var numray=Data_Maybe.fromJust()(Data_List.insertAt(v.decimal)(\".\")(charray));return Data_Foldable.foldMap(Data_List_Types.foldableList)(Data_Monoid.monoidString)(Data_String_CodeUnits.singleton)(Data_Semigroup.append(Data_List_Types.semigroupList)(sign)(numray))};var timesSign=function(v){return function(v1){if(v instanceof Plus&&v1 instanceof Plus){return Plus.value}if(v instanceof Minus&&v1 instanceof Minus){return Plus.value}return Minus.value}};var takeMeatyParts=function(arr){return Data_List.reverse(Data_List.dropWhile(function(v){return Data_Eq.eq(Data_Digit.eqDigit)(v)(Data_Digit[\"_zero\"])})(Data_List.reverse(arr)))};var timesPowOfTen=function(n){return function(v){var newDecimal=v.decimal+n|0;var newZeroesLength=function(){var $97=newDecimal>=Data_List.length(takeMeatyParts(v.digits));if($97){return newDecimal-Data_List.length(takeMeatyParts(v.digits))|0}return 0}();var newZeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(newZeroesLength)(Data_Digit[\"_zero\"]);var z={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(v.digits)(newZeroes),sign:v.sign,decimal:newDecimal};return z}};var smallEnough=function(v){if(v.decimal===1&&Data_List.length(v.digits)===2){return true}return false};var rec=function(v){return v};var parseScientific=function(n){var split=Data_List.span(function(v){return v!==\"e\"})(Data_List.fromFoldable(Data_Foldable.foldableArray)(Data_String_CodeUnits.toCharArray(Data_Show.show(Data_Show.showNumber)(n))));var signSplit=Data_Maybe.fromJust()(Data_List.uncons(Data_List.drop(1)(split.rest)));var sign=function(){var $102=n<0;if($102){return Minus.value}return Plus.value}();var exponent=Data_Int.round(Global.readFloat(Data_Foldable.foldMap(Data_List_Types.foldableList)(Data_Monoid.monoidString)(Data_String_CodeUnits.singleton)(signSplit.tail)));var expSign=function(){if(signSplit.head===\"+\"){return Plus.value}return Minus.value}();var base=Data_List.filter(function(v){return v!==\".\"})(split.init);var z={exponent:exponent,expSign:expSign,base:base,sign:sign};return z};var parsePlusPlus=function(exp){return function(base){var zeroCardinality=(exp-Data_List.length(base)|0)+2|0;var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(zeroCardinality)(Data_Digit[\"_zero\"]);var digits=Data_Semigroup.append(Data_List_Types.semigroupList)(Data_List.mapMaybe(Data_Digit.fromChar)(base))(zeroes);var decimal=1+exp|0;var r={digits:digits,decimal:decimal,sign:Plus.value};return r}};var parsePlusMinus=function(exp){return function(base){var r=parsePlusPlus(exp)(base);return{digits:Data_Semigroup.append(Data_List_Types.semigroupList)(r.digits)(Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"])),decimal:r.decimal,sign:Minus.value}}};var parseNumber=function(n){if(Data_String_CodeUnits.contains(\"e\")(Data_Show.show(Data_Show.showNumber)(n))){return Scientific.value}if(Data_String_CodeUnits.contains(\".\")(Data_Show.show(Data_Show.showNumber)(n))){return Float.value}if(Data_Boolean.otherwise){return Integral.value}throw new Error(\"Failed pattern match at Data.HugeNum (line 204, column 1 - line 204, column 37): \"+[n.constructor.name])};var parseMinusPlus=function(exp){return function(base){var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(exp)(Data_Digit[\"_zero\"]);var digits=Data_Semigroup.append(Data_List_Types.semigroupList)(zeroes)(Data_List.mapMaybe(Data_Digit.fromChar)(base));var r={digits:digits,decimal:1,sign:Plus.value};return r}};var parseMinusMinus=function(exp){return function(base){var r=parseMinusPlus(exp)(base);return{digits:r.digits,decimal:r.decimal,sign:Minus.value}}};var scientificToHugeNum=function(n){var parsed=parseScientific(n);var r=function(){if(parsed.expSign instanceof Plus){if(parsed.sign instanceof Plus){return parsePlusPlus(parsed.exponent)(parsed.base)}return parsePlusMinus(parsed.exponent)(parsed.base)}if(parsed.sign instanceof Plus){return parseMinusPlus(parsed.exponent)(parsed.base)}return parseMinusMinus(parsed.exponent)(parsed.base)}();return r};var oneHugeNum={digits:new Data_List_Types.Cons(Data_Digit[\"_one\"],new Data_List_Types.Cons(Data_Digit[\"_zero\"],Data_List_Types.Nil.value)),decimal:1,sign:Plus.value};var neg=function(v){if(v.sign instanceof Minus){return{digits:v.digits,decimal:v.decimal,sign:Plus.value}}return{digits:v.digits,decimal:v.decimal,sign:Minus.value}};var meatyDecimals=function(v){var decimals=Data_List.reverse(Data_List.drop(v.decimal)(v.digits));var meaty=Data_List.dropWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(decimals);return Data_List.length(meaty)};var makeHugeInteger$prime=function(v){var digits=Data_Semigroup.append(Data_List_Types.semigroupList)(unsafeRemoveFrontZeroes(v.digits))(Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"]));var decimal=Data_List.length(digits)-1|0;var z={digits:digits,decimal:decimal,sign:v.sign};return z};var lessPrecise=function(v){return function(v1){return Data_List.length(Data_List.drop(v.decimal)(v.digits))=0;var split=function(){if(pos){return Data_List.span(function(v){return v!==\".\"})(Data_List.fromFoldable(Data_Foldable.foldableArray)(Data_String_CodeUnits.toCharArray(Data_Show.show(Data_Show.showNumber)(n))))}return Data_List.span(function(v){return v!==\".\"})(Data_List.drop(1)(Data_List.fromFoldable(Data_Foldable.foldableArray)(Data_String_CodeUnits.toCharArray(Data_Show.show(Data_Show.showNumber)(n)))))}();var small=Data_List.drop(1)(split.rest);var decimal=Data_List.length(split.init);var digits=Data_List.mapMaybe(Data_Digit.fromChar)(Data_Semigroup.append(Data_List_Types.semigroupList)(split.init)(small));var r={digits:digits,decimal:decimal,sign:sign};return r};var fromNumber=function(n){var v=parseNumber(n);if(v instanceof Float){return floatToHugeNum(n)}if(v instanceof Scientific){return scientificToHugeNum(n)}if(v instanceof Integral){return integralToHugeNum(n)}throw new Error(\"Failed pattern match at Data.HugeNum (line 283, column 16 - line 286, column 52): \"+[v.constructor.name])};var eqSign=new Data_Eq.Eq(function(v){return function(v1){if(v instanceof Plus&&v1 instanceof Plus){return true}if(v instanceof Minus&&v1 instanceof Minus){return true}return false}});var ordSign=new Data_Ord.Ord(function(){return eqSign},function(v){return function(v1){if(v instanceof Plus&&v1 instanceof Minus){return Data_Ordering.GT.value}if(v instanceof Minus&&v1 instanceof Plus){return Data_Ordering.LT.value}return Data_Ordering.EQ.value}});var strictlyEqual=function(v){return function(v1){return v.decimal===v1.decimal&&(Data_Eq.eq(Data_List_Types.eqList(Data_Digit.eqDigit))(v.digits)(v1.digits)&&Data_Eq.eq(eqSign)(v.sign)(v1.sign))}};var dropZeroes=function(){var dropIntegralZeroes=function(v){var integralPart=Data_List.take(v.decimal)(v.digits);var zeroes=Data_List.takeWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(integralPart);var digits=function(){var $148=Data_List.length(integralPart)===Data_List.length(zeroes);if($148){return Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"])}return Data_List.drop(Data_List.length(zeroes))(integralPart)}();var decimal=Data_List.length(digits);var z={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(digits)(Data_List.drop(v.decimal)(v.digits)),decimal:decimal,sign:v.sign};return z};var dropFractionalZeroes=function(v){var fractionalDigits=Data_List.reverse(Data_List.drop(v.decimal)(v.digits));var meatyFraction=Data_List.dropWhile(function(v1){return Data_Eq.eq(Data_Digit.eqDigit)(v1)(Data_Digit[\"_zero\"])})(fractionalDigits);var digits=Data_List.reverse(meatyFraction);var z={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(Data_List.take(v.decimal)(v.digits))(function(){var $150=Data_List[\"null\"](digits);if($150){return Control_Applicative.pure(Data_List_Types.applicativeList)(Data_Digit[\"_zero\"])}return digits}()),decimal:v.decimal,sign:v.sign};return z};return function($213){return dropIntegralZeroes(dropFractionalZeroes($213))}}();var eqHugeNum=new Data_Eq.Eq(function(x){return function(y){if(isZero(x)&&isZero(y)){return true}if(Data_Boolean.otherwise){return strictlyEqual(dropZeroes(x))(dropZeroes(y))}throw new Error(\"Failed pattern match at Data.HugeNum (line 75, column 1 - line 75, column 33): \"+[x.constructor.name,y.constructor.name])}});var digitwiseSubtract=function(v){return function(v1){var tint=Data_Digit.toInt(v1.value0)-Data_Digit.toInt(v.value1)|0;var bint=Data_Digit.toInt(v1.value1);var diff$prime=tint-bint|0;var diff=Data_Maybe.fromJust()(Data_Digit.fromInt(function(){var $155=diff$prime<0;if($155){return diff$prime+10|0}return diff$prime}()));var spill=function(){var $156=diff$prime<0;if($156){return Data_Digit[\"_one\"]}return Data_Digit[\"_zero\"]}();return new Data_Tuple.Tuple(new Data_List_Types.Cons(diff,v.value0),spill)}};var digitwiseAdd=function(v){return function(v1){var tint=Data_Digit.toInt(v1.value0)+Data_Digit.toInt(v.value1)|0;var bint=Data_Digit.toInt(v1.value1);var summ$prime=tint+bint|0;var spill=function(){var $163=summ$prime>9;if($163){return Data_Digit[\"_one\"]}return Data_Digit[\"_zero\"]}();var summ=Data_Maybe.fromJust()(Data_Digit.fromInt(function(){var $164=summ$prime>9;if($164){return summ$prime-10|0}return summ$prime}()));return new Data_Tuple.Tuple(new Data_List_Types.Cons(summ,v.value0),spill)}};var equivalize=function(){var integralize=function(v){if(Data_List.length(Data_List.take(v.fst.decimal)(v.fst.digits))===Data_List.length(Data_List.take(v.snd.decimal)(v.snd.digits))){return{fst:v.fst,snd:v.snd}}if(Data_Boolean.otherwise){var lesser=rec(Data_Ord.min(ordHugeNum)(v.fst)(v.snd));var greater=rec(Data_Ord.max(ordHugeNum)(v.fst)(v.snd));var zeroesLength=Data_List.length(Data_List.take(greater.decimal)(greater.digits))-Data_List.length(Data_List.take(lesser.decimal)(lesser.digits))|0;var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(zeroesLength)(Data_Digit[\"_zero\"]);var lesser$prime={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(zeroes)(lesser.digits),decimal:greater.decimal,sign:lesser.sign};var z={fst:lesser$prime,snd:greater};return z}throw new Error(\"Failed pattern match at Data.HugeNum (line 150, column 3 - line 158, column 57): \"+[v.constructor.name])};var fractionalize=function(v){if(Data_List.length(Data_List.drop(v.fst.decimal)(v.fst.digits))===Data_List.length(Data_List.drop(v.snd.decimal)(v.snd.digits))){return{fst:v.fst,snd:v.snd}}if(Data_Boolean.otherwise){var test=lessPrecise(v.fst)(v.snd);var lesser=function(){if(test){return v.fst}return v.snd}();var greater=function(){if(test){return v.snd}return v.fst}();var lesserDecimal=Data_List.length(Data_List.drop(greater.decimal)(greater.digits))-Data_List.length(Data_List.drop(lesser.decimal)(lesser.digits))|0;var zeroes=Data_Unfoldable.replicate(Data_List_Types.unfoldableList)(lesserDecimal)(Data_Digit[\"_zero\"]);var lesser$prime={digits:Data_Semigroup.append(Data_List_Types.semigroupList)(lesser.digits)(zeroes),decimal:lesser.decimal,sign:lesser.sign};var z={fst:lesser$prime,snd:greater};return z}throw new Error(\"Failed pattern match at Data.HugeNum (line 140, column 3 - line 149, column 57): \"+[v.constructor.name])};return function($214){return integralize(fractionalize($214))}}();var compareHugeNum=function(v){return function(v1){if(Data_Ord.lessThan(ordSign)(v.sign)(v1.sign)){return Data_Ordering.LT.value}if(Data_Ord.greaterThan(ordSign)(v.sign)(v1.sign)){return Data_Ordering.GT.value}if(v.decimal>v1.decimal){return Data_Ordering.GT.value}if(v.decimal(parseInt(v)) );\n\t//let AB = new Array(NM[0]);\n\t//for(let i=0;i(parseInt(v)) );\n\t//}\n\n\tlet AB = [];\n\tfor(let i=0;i(a[0] < b[0]?-1:1));\n\n\tlet money = 0;\n\tlet count = NM[1];\n\tfor(let i=0;count>0;i++){\n\t\tvar num = Math.min(count,AB[i][1]);\n\t\tmoney += num*AB[i][0];\n\t\tcount -= num;\n\t}\n\tconsole.log(money);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1552396367, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/JavaScript/s361146108.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s361146108", "user_id": "u129859897"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "'use strict'\n\nfunction Main(input){\n\tlet temp = input.trim().split(\"\\n\");\n\tlet NM = temp[0].split(\" \").map( (v)=>(parseInt(v)) );\n\t//let AB = new Array(NM[0]);\n\t//for(let i=0;i(parseInt(v)) );\n\t//}\n\n\tlet AB = [];\n\tfor(let i=0;i(a[0] < b[0]?-1:1));\n\n\tlet money = 0;\n\tlet count = NM[1];\n\tfor(let i=0;count>0;i++){\n\t\tvar num = Math.min(count,AB[i][1]);\n\t\tmoney += num*AB[i][0];\n\t\tcount -= num;\n\t}\n\tconsole.log(money);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 664, "cpu_time_ms": 2109, "memory_kb": 56100}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s280313223", "group_id": "codeNet:p03103", "input_text": "\"use strict\";\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n\n input[0] = input[0].split(\" \");\n const n = parseInt(input[0][0], 10);\n const m = parseInt(input[0][1], 10);\n\n let stores = input.slice(1, -1).map(x => x.split(\" \").map(x => parseInt(x, 10)));\n\n stores.sort(function(a, b) {\n return a[0] - b[0];\n });\n\n let numDrink = 0;\n let totalPrice = 0;\n for (let i = 0; i < n; i++) {\n const store = stores[i];\n for (let j = 0; j < store[1]; j++) {\n if (numDrink === m) {\n console.log(totalPrice);\n return;\n }\n\n numDrink++;\n totalPrice += store[0];\n }\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1552169151, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/JavaScript/s280313223.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s280313223", "user_id": "u355735987"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "\"use strict\";\n\nfunction Main(input) {\n input = input.split(\"\\n\");\n\n input[0] = input[0].split(\" \");\n const n = parseInt(input[0][0], 10);\n const m = parseInt(input[0][1], 10);\n\n let stores = input.slice(1, -1).map(x => x.split(\" \").map(x => parseInt(x, 10)));\n\n stores.sort(function(a, b) {\n return a[0] - b[0];\n });\n\n let numDrink = 0;\n let totalPrice = 0;\n for (let i = 0; i < n; i++) {\n const store = stores[i];\n for (let j = 0; j < store[1]; j++) {\n if (numDrink === m) {\n console.log(totalPrice);\n return;\n }\n\n numDrink++;\n totalPrice += store[0];\n }\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 753, "cpu_time_ms": 253, "memory_kb": 52876}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s734246415", "group_id": "codeNet:p03103", "input_text": "function main(input) {\n const args = input.split('\\n');\n var one = args[0].split(' ');\n\n var N = parseInt(one[0], 10);\n var M = parseInt(one[1], 10);\n var purchase_count = 0;\n var purchase_money = 0;\n\n // 店情報\n var shop_info = {\n Money: '',\n Max_count: ''\n };\n\n var shops_info = [];\n\n for (var i = 0; i < N; i++) {\n Drinks = args[i + 1].split(' ');\n shops_info[i] = { Money: parseInt(Drinks[0], 10), Max_count: parseInt(Drinks[1], 10)}\n }\n\n shops_info.sort((a, b) => { return (a.Money < b.Money) ? -1 : 1;})\n\n var target_shop;\n\n for (var i = 0; i < N; i++) {\n target_shop = shops_info[i]\n if(target_shop.Max_count + purchase_count <= M) {\n purchase_money += target_shop.Max_count * target_shop.Money;\n purchase_count += target_shop.Max_count;\n } else {\n target_count = M - purchase_count;\n purchase_money += target_shop.Money * target_count;\n break;\n }\n }\n\n console.log(purchase_money);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1552166818, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03103.html", "problem_id": "p03103", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03103/input.txt", "sample_output_relpath": "derived/input_output/data/p03103/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03103/JavaScript/s734246415.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s734246415", "user_id": "u044133843"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "function main(input) {\n const args = input.split('\\n');\n var one = args[0].split(' ');\n\n var N = parseInt(one[0], 10);\n var M = parseInt(one[1], 10);\n var purchase_count = 0;\n var purchase_money = 0;\n\n // 店情報\n var shop_info = {\n Money: '',\n Max_count: ''\n };\n\n var shops_info = [];\n\n for (var i = 0; i < N; i++) {\n Drinks = args[i + 1].split(' ');\n shops_info[i] = { Money: parseInt(Drinks[0], 10), Max_count: parseInt(Drinks[1], 10)}\n }\n\n shops_info.sort((a, b) => { return (a.Money < b.Money) ? -1 : 1;})\n\n var target_shop;\n\n for (var i = 0; i < N; i++) {\n target_shop = shops_info[i]\n if(target_shop.Max_count + purchase_count <= M) {\n purchase_money += target_shop.Max_count * target_shop.Money;\n purchase_count += target_shop.Max_count;\n } else {\n target_count = M - purchase_count;\n purchase_money += target_shop.Money * target_count;\n break;\n }\n }\n\n console.log(purchase_money);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "sample_input": "2 5\n4 9\n2 4\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03103", "source_text": "Score : 300 points\n\nProblem Statement\n\nHearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks.\n\nThere are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each.\n\nWhat is the minimum amount of money with which he can buy M cans of energy drinks?\n\nIt is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N, M \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^5\n\nB_1 + ... + B_N \\geq M\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_N B_N\n\nOutput\n\nPrint the minimum amount of money with which Takahashi can buy M cans of energy drinks.\n\nSample Input 1\n\n2 5\n4 9\n2 4\n\nSample Output 1\n\n12\n\nWith 12 yen, we can buy one drink at the first store and four drinks at the second store, for the total of five drinks. However, we cannot buy 5 drinks with 11 yen or less.\n\nSample Input 2\n\n4 30\n6 18\n2 5\n3 10\n7 9\n\nSample Output 2\n\n130\n\nSample Input 3\n\n1 100000\n1000000000 100000\n\nSample Output 3\n\n100000000000000\n\nThe output may not fit into a 32-bit integer type.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1120, "cpu_time_ms": 2109, "memory_kb": 51016}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s644825207", "group_id": "codeNet:p03106", "input_text": "\"use strict\";\n\nconst main = arg => {\n const A = parseInt(arg.split(\"\\n\")[0].split(\" \")[0]);\n const B = parseInt(arg.split(\"\\n\")[0].split(\" \")[1]);\n const K = parseInt(arg.split(\"\\n\")[0].split(\" \")[2]);\n const list = [];\n \n for(let i=1; i<=Math.min(A,B); i++) {\n if(A % i == 0 && B % i == 0) {\n list.push(i);\n }\n }\n \n console.log(list[list.length - K]);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1551644813, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03106.html", "problem_id": "p03106", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03106/input.txt", "sample_output_relpath": "derived/input_output/data/p03106/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03106/JavaScript/s644825207.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s644825207", "user_id": "u598795006"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n const A = parseInt(arg.split(\"\\n\")[0].split(\" \")[0]);\n const B = parseInt(arg.split(\"\\n\")[0].split(\" \")[1]);\n const K = parseInt(arg.split(\"\\n\")[0].split(\" \")[2]);\n const list = [];\n \n for(let i=1; i<=Math.min(A,B); i++) {\n if(A % i == 0 && B % i == 0) {\n list.push(i);\n }\n }\n \n console.log(list[list.length - K]);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nFind the K-th largest positive integer that divides both A and B.\n\nThe input guarantees that there exists such a number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 100\n\nThe K-th largest positive integer that divides both A and B exists.\n\nK \\geq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the K-th largest positive integer that divides both A and B.\n\nSample Input 1\n\n8 12 2\n\nSample Output 1\n\n2\n\nThree positive integers divides both 8 and 12: 1, 2 and 4.\nAmong them, the second largest is 2.\n\nSample Input 2\n\n100 50 4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1 1\n\nSample Output 3\n\n1", "sample_input": "8 12 2\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03106", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given positive integers A and B.\n\nFind the K-th largest positive integer that divides both A and B.\n\nThe input guarantees that there exists such a number.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq A, B \\leq 100\n\nThe K-th largest positive integer that divides both A and B exists.\n\nK \\geq 1\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the K-th largest positive integer that divides both A and B.\n\nSample Input 1\n\n8 12 2\n\nSample Output 1\n\n2\n\nThree positive integers divides both 8 and 12: 1, 2 and 4.\nAmong them, the second largest is 2.\n\nSample Input 2\n\n100 50 4\n\nSample Output 2\n\n5\n\nSample Input 3\n\n1 1 1\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 462, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s606194359", "group_id": "codeNet:p03107", "input_text": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nS = lines.shift()\ncnt = 0\nwhile(m = S.match(/(01|10)/g)) {\n cnt += m.length * 2\n S = S.replace(/(01|10)/g, '')\n}\nconsole.log(cnt)\n", "language": "JavaScript", "metadata": {"date": 1573405156, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03107.html", "problem_id": "p03107", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03107/input.txt", "sample_output_relpath": "derived/input_output/data/p03107/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03107/JavaScript/s606194359.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s606194359", "user_id": "u461478706"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "input = require('fs').readFileSync('/dev/stdin', 'utf8')\nlines = input.split('\\n')\nS = lines.shift()\ncnt = 0\nwhile(m = S.match(/(01|10)/g)) {\n cnt += m.length * 2\n S = S.replace(/(01|10)/g, '')\n}\nconsole.log(cnt)\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "sample_input": "0011\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03107", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N cubes stacked vertically on a desk.\n\nYou are given a string S of length N. The color of the i-th cube from the bottom is red if the i-th character in S is 0, and blue if that character is 1.\n\nYou can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.\n\nAt most how many cubes can be removed?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n|S| = N\n\nEach character in S is 0 or 1.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint the maximum number of cubes that can be removed.\n\nSample Input 1\n\n0011\n\nSample Output 1\n\n4\n\nAll four cubes can be removed, by performing the operation as follows:\n\nRemove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.\n\nRemove the first and second cubes from the bottom.\n\nSample Input 2\n\n11011010001011\n\nSample Output 2\n\n12\n\nSample Input 3\n\n0\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 219, "cpu_time_ms": 2108, "memory_kb": 24396}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s525009166", "group_id": "codeNet:p03108", "input_text": "\n// 配列に全部の島のデータを突っ込む\n// 各島はparent,sizeから成る、自分がどの島かはインデックスで判断。\n\nfunction UnionFind(n){\n this.islands = [];\n for(var i=0; i x.split(' ').map( x => parseInt(x, 10) ) );\n const N = formatted_input[0][0];\n const M = formatted_input[0][1];\n var reverse_bridges = [];\n\n for(var i=0;i ", "language": "JavaScript", "metadata": {"date": 1556153981, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03108.html", "problem_id": "p03108", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03108/input.txt", "sample_output_relpath": "derived/input_output/data/p03108/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03108/JavaScript/s525009166.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s525009166", "user_id": "u021358975"}, "prompt_components": {"gold_output": "0\n0\n4\n5\n6\n", "input_to_evaluate": "\n// 配列に全部の島のデータを突っ込む\n// 各島はparent,sizeから成る、自分がどの島かはインデックスで判断。\n\nfunction UnionFind(n){\n this.islands = [];\n for(var i=0; i x.split(' ').map( x => parseInt(x, 10) ) );\n const N = formatted_input[0][0];\n const M = formatted_input[0][1];\n var reverse_bridges = [];\n\n for(var i=0;i ", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "sample_input": "4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n"}, "reference_outputs": ["0\n0\n4\n5\n6\n"], "source_document_id": "p03108", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands and M bridges.\n\nThe i-th bridge connects the A_i-th and B_i-th islands bidirectionally.\n\nInitially, we can travel between any two islands using some of these bridges.\n\nHowever, the results of a survey show that these bridges will all collapse because of aging, in the order from the first bridge to the M-th bridge.\n\nLet the inconvenience be the number of pairs of islands (a, b) (a < b) such that we are no longer able to travel between the a-th and b-th islands using some of the bridges remaining.\n\nFor each i (1 \\leq i \\leq M), find the inconvenience just after the i-th bridge collapses.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq A_i < B_i \\leq N\n\nAll pairs (A_i, B_i) are distinct.\n\nThe inconvenience is initially 0.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\nA_2 B_2\n\\vdots\nA_M B_M\n\nOutput\n\nIn the order i = 1, 2, ..., M, print the inconvenience just after the i-th bridge collapses.\nNote that the answer may not fit into a 32-bit integer type.\n\nSample Input 1\n\n4 5\n1 2\n3 4\n1 3\n2 3\n1 4\n\nSample Output 1\n\n0\n0\n4\n5\n6\n\nFor example, when the first to third bridges have collapsed, the inconvenience is 4 since we can no longer travel between the pairs (1, 2), (1, 3), (2, 4) and (3, 4).\n\nSample Input 2\n\n6 5\n2 3\n1 2\n5 6\n3 4\n4 5\n\nSample Output 2\n\n8\n9\n12\n14\n15\n\nSample Input 3\n\n2 1\n1 2\n\nSample Output 3\n\n1", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2382, "cpu_time_ms": 215, "memory_kb": 53468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s342477773", "group_id": "codeNet:p03109", "input_text": "function Main(input) {\n\tinput = new Date(input).getTime();\n var check = new Date(\"2019/04/30\").getTime();\n console.log((input <= check) ? \"Heisei\" : \"TBD\");\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1567013579, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/JavaScript/s342477773.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s342477773", "user_id": "u222822036"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "function Main(input) {\n\tinput = new Date(input).getTime();\n var check = new Date(\"2019/04/30\").getTime();\n console.log((input <= check) ? \"Heisei\" : \"TBD\");\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 221, "cpu_time_ms": 54, "memory_kb": 7368}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s588829211", "group_id": "codeNet:p03109", "input_text": "function Main(input){\n var inputs = input.split(\" \");\n var date = inputs.shift();\n\tif(date > \"2019/04/30\"){\n console.log(\"TBD\");\n }else{\n console.log(\"Heisei\");\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557767073, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/JavaScript/s588829211.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s588829211", "user_id": "u720390023"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "function Main(input){\n var inputs = input.split(\" \");\n var date = inputs.shift();\n\tif(date > \"2019/04/30\"){\n console.log(\"TBD\");\n }else{\n console.log(\"Heisei\");\n }\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 239, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s048518110", "group_id": "codeNet:p03109", "input_text": "a = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split('/').map(Number);\nconsole.log(a[0] >= 2019 && a[1] >= 5 ? 'TBD' : 'Heisei');", "language": "JavaScript", "metadata": {"date": 1551038803, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/JavaScript/s048518110.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s048518110", "user_id": "u646148705"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "a = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split('/').map(Number);\nconsole.log(a[0] >= 2019 && a[1] >= 5 ? 'TBD' : 'Heisei');", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 135, "cpu_time_ms": 215, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s064405833", "group_id": "codeNet:p03109", "input_text": "let main = (standardInput) => {\n let date = standardInput.split('/').join('')\n if (Number(date) >= 20190430) console.log('TBD')\n else console.log('Heisei')\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'UTF-8'))", "language": "JavaScript", "metadata": {"date": 1551038797, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03109.html", "problem_id": "p03109", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03109/input.txt", "sample_output_relpath": "derived/input_output/data/p03109/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03109/JavaScript/s064405833.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s064405833", "user_id": "u355387749"}, "prompt_components": {"gold_output": "Heisei\n", "input_to_evaluate": "let main = (standardInput) => {\n let date = standardInput.split('/').join('')\n if (Number(date) >= 20190430) console.log('TBD')\n else console.log('Heisei')\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'UTF-8'))", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "sample_input": "2019/04/30\n"}, "reference_outputs": ["Heisei\n"], "source_document_id": "p03109", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S as input. This represents a valid date in the year 2019 in the yyyy/mm/dd format. (For example, April 30, 2019 is represented as 2019/04/30.)\n\nWrite a program that prints Heisei if the date represented by S is not later than April 30, 2019, and prints TBD otherwise.\n\nConstraints\n\nS is a string that represents a valid date in the year 2019 in the yyyy/mm/dd format.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nPrint Heisei if the date represented by S is not later than April 30, 2019, and print TBD otherwise.\n\nSample Input 1\n\n2019/04/30\n\nSample Output 1\n\nHeisei\n\nSample Input 2\n\n2019/11/01\n\nSample Output 2\n\nTBD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 217, "cpu_time_ms": 199, "memory_kb": 20936}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s885750824", "group_id": "codeNet:p03111", "input_text": "function Main(input){\n input = input.split(\"\\n\");\n inputStr = input[0].split(\" \");\n const N = Number.parseInt(inputStr[0]);\n const A = Number.parseInt(inputStr[1]);\n const B = Number.parseInt(inputStr[2]);\n const C = Number.parseInt(inputStr[3]);\n var tg = [A,B,C];\n var bb = [];\n //N本の竹の長さを配列bbに格納する\n for( var i=0 ; i0){ \n tg.splice(i,1);\n bb.splice(tmp,1);\n }\n }\n\n //console.log(\"排除\",tg);\n \n //育った要素から順にtgから削除していく。\n var iposi = 0;\n \n while( tg.length > 0){\n for(var i=0 ; i t2 ){\n t1 = t2;\n iposi = i;\n pmemo[0] = j;\n }\n }\n \n \n //2本の竹を足して再度考えてみる\n if(t1>10){\n var c_flg = false;\n for(var k=0 ; k t2 ){\n t1 = t2;\n pmemo[0] = k;\n pmemo[1] = r;\n iposi = i;\n c_flg = true;\n }\n }\n }\n }\n } \n \n //絶対値との差異(t1)をMPとして足しこみ、bbから要素を削除する\n if(c_flg === true){\n //console.log(\"2本を1本に\");\n MP += 10;\n //最後の1つ手前に追加\n bb.splice(bb.length-1,0,bb[pmemo[0]]+bb[pmemo[1]]);\n //追加した元ねたの削除\n bb.splice(pmemo[1],1);\n bb.splice(pmemo[0],1);\n } else {\n MP += t1;\n tg.splice(iposi,1);\n //console.log(\"bbから消す値=\",bb[pmemo[0]]);\n\n //console.log(\"bbの何処の値を消す\",pmemo[0]);\n\n bb.splice(pmemo[0],1);\n i++;\n }\n //console.log(\"処理後tg\",tg);\n //console.log(\"処理後bb\",bb);\n c_flg = false;\n pmemo[0]=0;\n pmemo[1]=0;\n iposi = 0;\n }\n console.log(MP);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1570462598, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03111.html", "problem_id": "p03111", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03111/input.txt", "sample_output_relpath": "derived/input_output/data/p03111/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03111/JavaScript/s885750824.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s885750824", "user_id": "u424467986"}, "prompt_components": {"gold_output": "23\n", "input_to_evaluate": "function Main(input){\n input = input.split(\"\\n\");\n inputStr = input[0].split(\" \");\n const N = Number.parseInt(inputStr[0]);\n const A = Number.parseInt(inputStr[1]);\n const B = Number.parseInt(inputStr[2]);\n const C = Number.parseInt(inputStr[3]);\n var tg = [A,B,C];\n var bb = [];\n //N本の竹の長さを配列bbに格納する\n for( var i=0 ; i0){ \n tg.splice(i,1);\n bb.splice(tmp,1);\n }\n }\n\n //console.log(\"排除\",tg);\n \n //育った要素から順にtgから削除していく。\n var iposi = 0;\n \n while( tg.length > 0){\n for(var i=0 ; i t2 ){\n t1 = t2;\n iposi = i;\n pmemo[0] = j;\n }\n }\n \n \n //2本の竹を足して再度考えてみる\n if(t1>10){\n var c_flg = false;\n for(var k=0 ; k t2 ){\n t1 = t2;\n pmemo[0] = k;\n pmemo[1] = r;\n iposi = i;\n c_flg = true;\n }\n }\n }\n }\n } \n \n //絶対値との差異(t1)をMPとして足しこみ、bbから要素を削除する\n if(c_flg === true){\n //console.log(\"2本を1本に\");\n MP += 10;\n //最後の1つ手前に追加\n bb.splice(bb.length-1,0,bb[pmemo[0]]+bb[pmemo[1]]);\n //追加した元ねたの削除\n bb.splice(pmemo[1],1);\n bb.splice(pmemo[0],1);\n } else {\n MP += t1;\n tg.splice(iposi,1);\n //console.log(\"bbから消す値=\",bb[pmemo[0]]);\n\n //console.log(\"bbの何処の値を消す\",pmemo[0]);\n\n bb.splice(pmemo[0],1);\n i++;\n }\n //console.log(\"処理後tg\",tg);\n //console.log(\"処理後bb\",bb);\n c_flg = false;\n pmemo[0]=0;\n pmemo[1]=0;\n iposi = 0;\n }\n console.log(MP);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "sample_input": "5 100 90 80\n98\n40\n30\n21\n80\n"}, "reference_outputs": ["23\n"], "source_document_id": "p03111", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou have N bamboos. The lengths (in centimeters) of these are l_1, l_2, ..., l_N, respectively.\n\nYour objective is to use some of these bamboos (possibly all) to obtain three bamboos of length A, B, C. For that, you can use the following three kinds of magics any number:\n\nExtension Magic: Consumes 1 MP (magic point). Choose one bamboo and increase its length by 1.\n\nShortening Magic: Consumes 1 MP. Choose one bamboo of length at least 2 and decrease its length by 1.\n\nComposition Magic: Consumes 10 MP. Choose two bamboos and combine them into one bamboo. The length of this new bamboo is equal to the sum of the lengths of the two bamboos combined. (Afterwards, further magics can be used on this bamboo.)\n\nAt least how much MP is needed to achieve the objective?\n\nConstraints\n\n3 \\leq N \\leq 8\n\n1 \\leq C < B < A \\leq 1000\n\n1 \\leq l_i \\leq 1000\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B C\nl_1\nl_2\n:\nl_N\n\nOutput\n\nPrint the minimum amount of MP needed to achieve the objective.\n\nSample Input 1\n\n5 100 90 80\n98\n40\n30\n21\n80\n\nSample Output 1\n\n23\n\nWe are obtaining three bamboos of lengths 100, 90, 80 from five bamboos 98, 40, 30, 21, 80. We already have a bamboo of length 80, and we can obtain bamboos of lengths 100, 90 by using the magics as follows at the total cost of 23 MP, which is optimal.\n\nUse Extension Magic twice on the bamboo of length 98 to obtain a bamboo of length 100. (MP consumed: 2)\n\nUse Composition Magic on the bamboos of lengths 40, 30 to obtain a bamboo of length 70. (MP consumed: 10)\n\nUse Shortening Magic once on the bamboo of length 21 to obtain a bamboo of length 20. (MP consumed: 1)\n\nUse Composition Magic on the bamboo of length 70 obtained in step 2 and the bamboo of length 20 obtained in step 3 to obtain a bamboo of length 90. (MP consumed: 10)\n\nSample Input 2\n\n8 100 90 80\n100\n100\n90\n90\n90\n80\n80\n80\n\nSample Output 2\n\n0\n\nIf we already have all bamboos of the desired lengths, the amount of MP needed is 0. As seen here, we do not necessarily need to use all the bamboos.\n\nSample Input 3\n\n8 1000 800 100\n300\n333\n400\n444\n500\n555\n600\n666\n\nSample Output 3\n\n243", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2489, "cpu_time_ms": 57, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s028275377", "group_id": "codeNet:p03112", "input_text": "\"use strict\";\nfunction binarySearch(array, value) {\n let start = 0;\n let stop = array.length - 1;\n let middle = Math.floor((start + stop) / 2);\n while (array[middle] !== value && start < stop) {\n if (value < array[middle]) {\n stop = middle - 1;\n } else {\n start = middle + 1;\n }\n middle = Math.floor((start + stop) / 2);\n }\n if (array[middle] > value) return middle; \n if (array[middle] < value) return middle + 1; \n return (array[middle] !== value) ? middle + 1 : middle;\n}\nfunction Main(input) {\n const INF = Number.MAX_SAFE_INTEGER;\n let lines = input.split(\"\\n\");\n let ABQ = lines.shift().split(/\\s/).map((v) => v - 0);\n let A = ABQ[0];\n let B = ABQ[1];\n let Q = ABQ[2];\n let s = [-INF];\n for (let a = 1; a <= A; a++) {\n s.push(lines.shift() - 0);\n }\n s.push(INF);\n let t = [-INF];\n for (let b = 1; b <= B; b++) {\n t.push(lines.shift() - 0);\n }\n t.push(INF);\n const min = (a, b, c) => {\n return Math.min(a, Math.min(b, c));\n }\n for (let q = 0; q < Q; q++) {\n let x = lines.shift() - 0;\n let b = binarySearch(s, x);\n let d = binarySearch(t, x);\n let res = INF;\n for (let S of [s[b - 1], s[b]]) {\n for (let T of [t[d - 1], t[d]]) {\n const d1 = Math.abs(S - x) + Math.abs(T - S);\n const d2 = Math.abs(T - x) + Math.abs(S - T);\n res = min(res, d1, d2);\n }\n }\n console.log(res);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1551101357, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03112.html", "problem_id": "p03112", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03112/input.txt", "sample_output_relpath": "derived/input_output/data/p03112/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03112/JavaScript/s028275377.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s028275377", "user_id": "u043150661"}, "prompt_components": {"gold_output": "350\n1400\n301\n399\n", "input_to_evaluate": "\"use strict\";\nfunction binarySearch(array, value) {\n let start = 0;\n let stop = array.length - 1;\n let middle = Math.floor((start + stop) / 2);\n while (array[middle] !== value && start < stop) {\n if (value < array[middle]) {\n stop = middle - 1;\n } else {\n start = middle + 1;\n }\n middle = Math.floor((start + stop) / 2);\n }\n if (array[middle] > value) return middle; \n if (array[middle] < value) return middle + 1; \n return (array[middle] !== value) ? middle + 1 : middle;\n}\nfunction Main(input) {\n const INF = Number.MAX_SAFE_INTEGER;\n let lines = input.split(\"\\n\");\n let ABQ = lines.shift().split(/\\s/).map((v) => v - 0);\n let A = ABQ[0];\n let B = ABQ[1];\n let Q = ABQ[2];\n let s = [-INF];\n for (let a = 1; a <= A; a++) {\n s.push(lines.shift() - 0);\n }\n s.push(INF);\n let t = [-INF];\n for (let b = 1; b <= B; b++) {\n t.push(lines.shift() - 0);\n }\n t.push(INF);\n const min = (a, b, c) => {\n return Math.min(a, Math.min(b, c));\n }\n for (let q = 0; q < Q; q++) {\n let x = lines.shift() - 0;\n let b = binarySearch(s, x);\n let d = binarySearch(t, x);\n let res = INF;\n for (let S of [s[b - 1], s[b]]) {\n for (let T of [t[d - 1], t[d]]) {\n const d1 = Math.abs(S - x) + Math.abs(T - S);\n const d2 = Math.abs(T - x) + Math.abs(S - T);\n res = min(res, d1, d2);\n }\n }\n console.log(res);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "sample_input": "2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n"}, "reference_outputs": ["350\n1400\n301\n399\n"], "source_document_id": "p03112", "source_text": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1604, "cpu_time_ms": 2110, "memory_kb": 38104}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s688885170", "group_id": "codeNet:p03112", "input_text": "\"use strict\";\nfunction I(s,f){this._s=s.split(\"\\n\");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(\" \");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(\" \").map(this._f)};module.exports=I;\nvar bigInt=function(undefined){\"use strict\";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),DEFAULT_ALPHABET=\"0123456789abcdefghijklmnopqrstuvwxyz\";var supportsNativeBigInt=typeof BigInt===\"function\";function Integer(v,radix,alphabet,caseSensitive){if(typeof v===\"undefined\")return Integer[0];if(typeof radix!==\"undefined\")return+radix===10&&!alphabet?parseValue(v):parseBase(v,radix,alphabet,caseSensitive);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function NativeBigInt(value){this.value=value}NativeBigInt.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;NativeBigInt.prototype.add=function(v){return new NativeBigInt(this.value+parseValue(v).value)};NativeBigInt.prototype.plus=NativeBigInt.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value===\"number\"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;NativeBigInt.prototype.subtract=function(v){return new NativeBigInt(this.value-parseValue(v).value)};NativeBigInt.prototype.minus=NativeBigInt.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};NativeBigInt.prototype.negate=function(){return new NativeBigInt(-this.value)};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};NativeBigInt.prototype.abs=function(){return new NativeBigInt(this.value>=0?this.value:-this.value)};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);if(supportsNativeBigInt){return[new NativeBigInt(self.value/n.value),new NativeBigInt(self.value%n.value)]}var a=self.value,b=n.value;var quotient;if(b===0)throw new Error(\"Cannot divide by zero\");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absa**b\")}NativeBigInt.prototype.pow=function(v){var n=parseValue(v);var a=this.value,b=n.value;if(b===BigInt(0))return Integer[1];if(a===BigInt(0))return Integer[0];if(a===BigInt(1))return Integer[1];if(a===BigInt(-1))return n.isEven()?Integer[1]:Integer[-1];if(n.isNegative())return new NativeBigInt(BigInt(0));return new NativeBigInt(pow(a,b))};BigInteger.prototype.modPow=function(exp,mod){exp=parseValue(exp);mod=parseValue(mod);if(mod.isZero())throw new Error(\"Cannot take modPow with modulus 0\");var r=Integer[1],base=this.mod(mod);while(exp.isPositive()){if(base.isZero())return Integer[0];if(exp.isOdd())r=r.multiply(base).mod(mod);exp=exp.divide(2);base=base.square().mod(mod)}return r};NativeBigInt.prototype.modPow=SmallInteger.prototype.modPow=BigInteger.prototype.modPow;function compareAbs(a,b){if(a.length!==b.length){return a.length>b.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};NativeBigInt.prototype.compareAbs=function(v){var a=this.value;var b=parseValue(v).value;a=a>=0?a:-a;b=b>=0?b:-b;return a===b?0:a>b?1:-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;NativeBigInt.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var a=this.value;var b=parseValue(v).value;return a===b?0:a>b?1:-1};NativeBigInt.prototype.compareTo=NativeBigInt.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};NativeBigInt.prototype.eq=NativeBigInt.prototype.equals=SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};NativeBigInt.prototype.neq=NativeBigInt.prototype.notEquals=SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};NativeBigInt.prototype.gt=NativeBigInt.prototype.greater=SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};NativeBigInt.prototype.lt=NativeBigInt.prototype.lesser=SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};NativeBigInt.prototype.geq=NativeBigInt.prototype.greaterOrEquals=SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};NativeBigInt.prototype.leq=NativeBigInt.prototype.lesserOrEquals=SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};NativeBigInt.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};NativeBigInt.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};NativeBigInt.prototype.isPositive=SmallInteger.prototype.isPositive;BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};NativeBigInt.prototype.isNegative=SmallInteger.prototype.isNegative;BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};NativeBigInt.prototype.isUnit=function(){return this.abs().value===BigInt(1)};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};NativeBigInt.prototype.isZero=function(){return this.value===BigInt(0)};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);if(n.isZero())return false;if(n.isUnit())return true;if(n.compareAbs(2)===0)return this.isEven();return this.mod(n).isZero()};NativeBigInt.prototype.isDivisibleBy=SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(49))return true}function millerRabinTest(n,a){var nPrev=n.prev(),b=nPrev,r=0,d,t,i,x;while(b.isEven())b=b.divide(2),r++;next:for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};NativeBigInt.prototype.prev=function(){return new NativeBigInt(this.value-BigInt(1))};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return Math.abs(n)<=BASE}BigInteger.prototype.shiftLeft=function(v){var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};NativeBigInt.prototype.shiftLeft=SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(v){var remQuo;var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};NativeBigInt.prototype.shiftRight=SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};NativeBigInt.prototype.not=SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};NativeBigInt.prototype.and=SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};NativeBigInt.prototype.or=SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};NativeBigInt.prototype.xor=SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v===\"number\"?v|LOBMASK_I:typeof v===\"bigint\"?v|BigInt(LOBMASK_I):v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};NativeBigInt.prototype.bitLength=SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b){a=parseValue(a);b=parseValue(b);var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(Math.random()*range));var digits=toBase(range,BASE).value;var result=[],restricted=true;for(var i=0;i=absBase){if(c===\"1\"&&absBase===1)continue;throw new Error(c+\" is not a valid digit in base \"+base+\".\")}}}base=parseValue(base);var digits=[];var isNegative=text[0]===\"-\";for(i=isNegative?1:0;i\"&&i=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit,alphabet){alphabet=alphabet||DEFAULT_ALPHABET;if(digit\"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error(\"Cannot convert nonzero numbers to base 0.\")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(n.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.isUnit()){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(n.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base,alphabet){var arr=toBase(n,base);return(arr.isNegative?\"-\":\"\")+arr.value.map(function(x){return stringify(x,alphabet)}).join(\"\")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};NativeBigInt.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!==10)return toBaseString(this,radix,alphabet);var v=this.value,l=v.length,str=String(v[--l]),zeros=\"0000000\",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?\"-\":\"\";return sign+str};SmallInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!=10)return toBaseString(this,radix,alphabet);return String(this.value)};NativeBigInt.prototype.toString=SmallInteger.prototype.toString;NativeBigInt.prototype.toJSON=BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;NativeBigInt.prototype.valueOf=NativeBigInt.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return supportsNativeBigInt?new NativeBigInt(BigInt(x)):new SmallInteger(x);throw new Error(\"Invalid integer: \"+v)}var sign=v[0]===\"-\";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error(\"Invalid integer: \"+split.join(\"e\"));if(split.length===2){var exp=split[1];if(exp[0]===\"+\")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error(\"Invalid integer: \"+exp+\" is not a valid exponent.\");var text=split[0];var decimalPlace=text.indexOf(\".\");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error(\"Cannot include negative exponent part for integers\");text+=new Array(exp+1).join(\"0\");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error(\"Invalid integer: \"+v);if(supportsNativeBigInt){return new NativeBigInt(BigInt(sign?\"-\"+v:v))}var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(supportsNativeBigInt){return new NativeBigInt(BigInt(v))}if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+\" is not an integer.\");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v===\"number\"){return parseNumberValue(v)}if(typeof v===\"string\"){return parseStringValue(v)}if(typeof v===\"bigint\"){return new NativeBigInt(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=parseValue(i);if(i>0)Integer[-i]=parseValue(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger||x instanceof NativeBigInt};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!==\"undefined\"&&module.hasOwnProperty(\"exports\")){module.exports=bigInt}if(typeof define===\"function\"&&define.amd){define(\"big-integer\",[],function(){return bigInt})}\n\nfunction binarySearch(arr, key, low, high) {\n if (low === high) {\n if (low === 0 && key < arr[0]) return -1;\n else return low;\n }\n\n const mid = Math.floor((low + high) / 2);\n if (arr[mid] < key && (!arr[mid + 1] || arr[mid + 1] > key) ) {\n return mid;\n }\n\n if (arr[mid] < key) {\n return binarySearch(arr, key, mid + 1, high);\n } else {\n return binarySearch(arr, key, low, mid);\n }\n}\n\nfunction main(input) {\n const o = new I(input);\n\n const A = o.a();\n const B = o.a();\n const Q = o.a();\n\n const s = [];\n const t = [];\n const x = [];\n\n for (let i=0;i= 0 ? bigInt(s[sI]) : null;\n let rightS = sI < s.length - 1 ? bigInt(s[sI + 1]) : null;\n let leftT = tI >= 0 ? bigInt(t[tI]) : null;\n let rightT = tI < t.length - 1 ? bigInt(t[tI + 1]) : null;\n\n let xi = bigInt(x[i]);\n // console.log({leftS: leftS && leftS.toString(), rightS: rightS && rightS.toString(), leftT: leftT && leftT.toString(), rightT: rightT && rightT.toString()})\n let min = bigInt(999999999999);\n if (leftS && leftT) {\n let temp = xi.minus(leftS.lesser(leftT) ? leftS : leftT);\n if ( temp.compare(min) < 0 ) min = temp;\n }\n if (leftS && rightT) {\n let temp = xi.minus(leftS).plus(rightT.minus(leftS));\n if ( temp.compare(min) < 0 ) min = temp;\n temp = rightT.minus(xi).plus(rightT.minus(leftS));\n if ( temp.compare(min) < 0 ) min = temp;\n }\n\n if (rightS && leftT) {\n let temp = xi.minus(leftT).plus(rightS.minus(leftT));\n if ( temp.compare(min) < 0 ) min = temp;\n temp = rightS.minus(xi).plus(rightS.minus(leftT));\n\n if ( temp.compare(min) < 0 ) min = temp;\n }\n\n if (rightS && rightT) {\n let temp = rightS.greater(rightT) ? rightS : rightT;\n temp = temp.minus(xi);\n if ( temp.compare(min) < 0 ) min = temp;\n }\n\n console.log(min.toString());\n }\n\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1551043215, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03112.html", "problem_id": "p03112", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03112/input.txt", "sample_output_relpath": "derived/input_output/data/p03112/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03112/JavaScript/s688885170.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s688885170", "user_id": "u439911726"}, "prompt_components": {"gold_output": "350\n1400\n301\n399\n", "input_to_evaluate": "\"use strict\";\nfunction I(s,f){this._s=s.split(\"\\n\");this._c=0;this._l=0;this._f=f||Number}I.prototype.a=function(){var l=this._s[this._l];if(!l)return;var t=l.trim().split(\" \");var a=t[this._c];this._c++;if(t.length===this._c){this._c=0;this._l++}return this._f(a)};I.prototype.l=function(){var l=this._s[this._l];if(!l)return;this._c=0;this._l++;return l.split(\" \").map(this._f)};module.exports=I;\nvar bigInt=function(undefined){\"use strict\";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),DEFAULT_ALPHABET=\"0123456789abcdefghijklmnopqrstuvwxyz\";var supportsNativeBigInt=typeof BigInt===\"function\";function Integer(v,radix,alphabet,caseSensitive){if(typeof v===\"undefined\")return Integer[0];if(typeof radix!==\"undefined\")return+radix===10&&!alphabet?parseValue(v):parseBase(v,radix,alphabet,caseSensitive);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function NativeBigInt(value){this.value=value}NativeBigInt.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;NativeBigInt.prototype.add=function(v){return new NativeBigInt(this.value+parseValue(v).value)};NativeBigInt.prototype.plus=NativeBigInt.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value===\"number\"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;NativeBigInt.prototype.subtract=function(v){return new NativeBigInt(this.value-parseValue(v).value)};NativeBigInt.prototype.minus=NativeBigInt.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};NativeBigInt.prototype.negate=function(){return new NativeBigInt(-this.value)};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};NativeBigInt.prototype.abs=function(){return new NativeBigInt(this.value>=0?this.value:-this.value)};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);if(supportsNativeBigInt){return[new NativeBigInt(self.value/n.value),new NativeBigInt(self.value%n.value)]}var a=self.value,b=n.value;var quotient;if(b===0)throw new Error(\"Cannot divide by zero\");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absa**b\")}NativeBigInt.prototype.pow=function(v){var n=parseValue(v);var a=this.value,b=n.value;if(b===BigInt(0))return Integer[1];if(a===BigInt(0))return Integer[0];if(a===BigInt(1))return Integer[1];if(a===BigInt(-1))return n.isEven()?Integer[1]:Integer[-1];if(n.isNegative())return new NativeBigInt(BigInt(0));return new NativeBigInt(pow(a,b))};BigInteger.prototype.modPow=function(exp,mod){exp=parseValue(exp);mod=parseValue(mod);if(mod.isZero())throw new Error(\"Cannot take modPow with modulus 0\");var r=Integer[1],base=this.mod(mod);while(exp.isPositive()){if(base.isZero())return Integer[0];if(exp.isOdd())r=r.multiply(base).mod(mod);exp=exp.divide(2);base=base.square().mod(mod)}return r};NativeBigInt.prototype.modPow=SmallInteger.prototype.modPow=BigInteger.prototype.modPow;function compareAbs(a,b){if(a.length!==b.length){return a.length>b.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};NativeBigInt.prototype.compareAbs=function(v){var a=this.value;var b=parseValue(v).value;a=a>=0?a:-a;b=b>=0?b:-b;return a===b?0:a>b?1:-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;NativeBigInt.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var a=this.value;var b=parseValue(v).value;return a===b?0:a>b?1:-1};NativeBigInt.prototype.compareTo=NativeBigInt.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};NativeBigInt.prototype.eq=NativeBigInt.prototype.equals=SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};NativeBigInt.prototype.neq=NativeBigInt.prototype.notEquals=SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};NativeBigInt.prototype.gt=NativeBigInt.prototype.greater=SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};NativeBigInt.prototype.lt=NativeBigInt.prototype.lesser=SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};NativeBigInt.prototype.geq=NativeBigInt.prototype.greaterOrEquals=SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};NativeBigInt.prototype.leq=NativeBigInt.prototype.lesserOrEquals=SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};NativeBigInt.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};NativeBigInt.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};NativeBigInt.prototype.isPositive=SmallInteger.prototype.isPositive;BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};NativeBigInt.prototype.isNegative=SmallInteger.prototype.isNegative;BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};NativeBigInt.prototype.isUnit=function(){return this.abs().value===BigInt(1)};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};NativeBigInt.prototype.isZero=function(){return this.value===BigInt(0)};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);if(n.isZero())return false;if(n.isUnit())return true;if(n.compareAbs(2)===0)return this.isEven();return this.mod(n).isZero()};NativeBigInt.prototype.isDivisibleBy=SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(49))return true}function millerRabinTest(n,a){var nPrev=n.prev(),b=nPrev,r=0,d,t,i,x;while(b.isEven())b=b.divide(2),r++;next:for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};NativeBigInt.prototype.prev=function(){return new NativeBigInt(this.value-BigInt(1))};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return Math.abs(n)<=BASE}BigInteger.prototype.shiftLeft=function(v){var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}if(n<0)return this.shiftRight(-n);var result=this;if(result.isZero())return result;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};NativeBigInt.prototype.shiftLeft=SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(v){var remQuo;var n=parseValue(v).toJSNumber();if(!shift_isSmall(n)){throw new Error(String(n)+\" is too large for shifting.\")}if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero()||result.isNegative()&&result.isUnit())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};NativeBigInt.prototype.shiftRight=SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};NativeBigInt.prototype.not=SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};NativeBigInt.prototype.and=SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};NativeBigInt.prototype.or=SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};NativeBigInt.prototype.xor=SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v===\"number\"?v|LOBMASK_I:typeof v===\"bigint\"?v|BigInt(LOBMASK_I):v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function integerLogarithm(value,base){if(base.compareTo(value)<=0){var tmp=integerLogarithm(value,base.square(base));var p=tmp.p;var e=tmp.e;var t=p.multiply(base);return t.compareTo(value)<=0?{p:t,e:e*2+1}:{p:p,e:e*2}}return{p:bigInt(1),e:0}}BigInteger.prototype.bitLength=function(){var n=this;if(n.compareTo(bigInt(0))<0){n=n.negate().subtract(bigInt(1))}if(n.compareTo(bigInt(0))===0){return bigInt(0)}return bigInt(integerLogarithm(n,bigInt(2)).e).add(bigInt(1))};NativeBigInt.prototype.bitLength=SmallInteger.prototype.bitLength=BigInteger.prototype.bitLength;function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b){a=parseValue(a);b=parseValue(b);var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(Math.random()*range));var digits=toBase(range,BASE).value;var result=[],restricted=true;for(var i=0;i=absBase){if(c===\"1\"&&absBase===1)continue;throw new Error(c+\" is not a valid digit in base \"+base+\".\")}}}base=parseValue(base);var digits=[];var isNegative=text[0]===\"-\";for(i=isNegative?1:0;i\"&&i=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit,alphabet){alphabet=alphabet||DEFAULT_ALPHABET;if(digit\"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return{value:[0],isNegative:false};throw new Error(\"Cannot convert nonzero numbers to base 0.\")}if(base.equals(-1)){if(n.isZero())return{value:[0],isNegative:false};if(n.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-n.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:false};var arr=Array.apply(null,Array(n.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);arr.unshift([1]);return{value:[].concat.apply([],arr),isNegative:false}}var neg=false;if(n.isNegative()&&base.isPositive()){neg=true;n=n.abs()}if(base.isUnit()){if(n.isZero())return{value:[0],isNegative:false};return{value:Array.apply(null,Array(n.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:neg}}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(digit.toJSNumber())}out.push(left.toJSNumber());return{value:out.reverse(),isNegative:neg}}function toBaseString(n,base,alphabet){var arr=toBase(n,base);return(arr.isNegative?\"-\":\"\")+arr.value.map(function(x){return stringify(x,alphabet)}).join(\"\")}BigInteger.prototype.toArray=function(radix){return toBase(this,radix)};SmallInteger.prototype.toArray=function(radix){return toBase(this,radix)};NativeBigInt.prototype.toArray=function(radix){return toBase(this,radix)};BigInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!==10)return toBaseString(this,radix,alphabet);var v=this.value,l=v.length,str=String(v[--l]),zeros=\"0000000\",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?\"-\":\"\";return sign+str};SmallInteger.prototype.toString=function(radix,alphabet){if(radix===undefined)radix=10;if(radix!=10)return toBaseString(this,radix,alphabet);return String(this.value)};NativeBigInt.prototype.toString=SmallInteger.prototype.toString;NativeBigInt.prototype.toJSON=BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return parseInt(this.toString(),10)};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;NativeBigInt.prototype.valueOf=NativeBigInt.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return supportsNativeBigInt?new NativeBigInt(BigInt(x)):new SmallInteger(x);throw new Error(\"Invalid integer: \"+v)}var sign=v[0]===\"-\";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error(\"Invalid integer: \"+split.join(\"e\"));if(split.length===2){var exp=split[1];if(exp[0]===\"+\")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error(\"Invalid integer: \"+exp+\" is not a valid exponent.\");var text=split[0];var decimalPlace=text.indexOf(\".\");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error(\"Cannot include negative exponent part for integers\");text+=new Array(exp+1).join(\"0\");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error(\"Invalid integer: \"+v);if(supportsNativeBigInt){return new NativeBigInt(BigInt(sign?\"-\"+v:v))}var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}trim(r);return new BigInteger(r,sign)}function parseNumberValue(v){if(supportsNativeBigInt){return new NativeBigInt(BigInt(v))}if(isPrecise(v)){if(v!==truncate(v))throw new Error(v+\" is not an integer.\");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v===\"number\"){return parseNumberValue(v)}if(typeof v===\"string\"){return parseStringValue(v)}if(typeof v===\"bigint\"){return new NativeBigInt(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=parseValue(i);if(i>0)Integer[-i]=parseValue(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger||x instanceof NativeBigInt};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!==\"undefined\"&&module.hasOwnProperty(\"exports\")){module.exports=bigInt}if(typeof define===\"function\"&&define.amd){define(\"big-integer\",[],function(){return bigInt})}\n\nfunction binarySearch(arr, key, low, high) {\n if (low === high) {\n if (low === 0 && key < arr[0]) return -1;\n else return low;\n }\n\n const mid = Math.floor((low + high) / 2);\n if (arr[mid] < key && (!arr[mid + 1] || arr[mid + 1] > key) ) {\n return mid;\n }\n\n if (arr[mid] < key) {\n return binarySearch(arr, key, mid + 1, high);\n } else {\n return binarySearch(arr, key, low, mid);\n }\n}\n\nfunction main(input) {\n const o = new I(input);\n\n const A = o.a();\n const B = o.a();\n const Q = o.a();\n\n const s = [];\n const t = [];\n const x = [];\n\n for (let i=0;i= 0 ? bigInt(s[sI]) : null;\n let rightS = sI < s.length - 1 ? bigInt(s[sI + 1]) : null;\n let leftT = tI >= 0 ? bigInt(t[tI]) : null;\n let rightT = tI < t.length - 1 ? bigInt(t[tI + 1]) : null;\n\n let xi = bigInt(x[i]);\n // console.log({leftS: leftS && leftS.toString(), rightS: rightS && rightS.toString(), leftT: leftT && leftT.toString(), rightT: rightT && rightT.toString()})\n let min = bigInt(999999999999);\n if (leftS && leftT) {\n let temp = xi.minus(leftS.lesser(leftT) ? leftS : leftT);\n if ( temp.compare(min) < 0 ) min = temp;\n }\n if (leftS && rightT) {\n let temp = xi.minus(leftS).plus(rightT.minus(leftS));\n if ( temp.compare(min) < 0 ) min = temp;\n temp = rightT.minus(xi).plus(rightT.minus(leftS));\n if ( temp.compare(min) < 0 ) min = temp;\n }\n\n if (rightS && leftT) {\n let temp = xi.minus(leftT).plus(rightS.minus(leftT));\n if ( temp.compare(min) < 0 ) min = temp;\n temp = rightS.minus(xi).plus(rightS.minus(leftT));\n\n if ( temp.compare(min) < 0 ) min = temp;\n }\n\n if (rightS && rightT) {\n let temp = rightS.greater(rightT) ? rightS : rightT;\n temp = temp.minus(xi);\n if ( temp.compare(min) < 0 ) min = temp;\n }\n\n console.log(min.toString());\n }\n\n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "sample_input": "2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n"}, "reference_outputs": ["350\n1400\n301\n399\n"], "source_document_id": "p03112", "source_text": "Score : 400 points\n\nProblem Statement\n\nAlong a road running in an east-west direction, there are A shrines and B temples.\nThe i-th shrine from the west is located at a distance of s_i meters from the west end of the road, and the i-th temple from the west is located at a distance of t_i meters from the west end of the road.\n\nAnswer the following Q queries:\n\nQuery i (1 \\leq i \\leq Q): If we start from a point at a distance of x_i meters from the west end of the road and freely travel along the road, what is the minimum distance that needs to be traveled in order to visit one shrine and one temple? (It is allowed to pass by more shrines and temples than required.)\n\nConstraints\n\n1 \\leq A, B \\leq 10^5\n\n1 \\leq Q \\leq 10^5\n\n1 \\leq s_1 < s_2 < ... < s_A \\leq 10^{10}\n\n1 \\leq t_1 < t_2 < ... < t_B \\leq 10^{10}\n\n1 \\leq x_i \\leq 10^{10}\n\ns_1, ..., s_A, t_1, ..., t_B, x_1, ..., x_Q are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B Q\ns_1\n:\ns_A\nt_1\n:\nt_B\nx_1\n:\nx_Q\n\nOutput\n\nPrint Q lines. The i-th line should contain the answer to the i-th query.\n\nSample Input 1\n\n2 3 4\n100\n600\n400\n900\n1000\n150\n2000\n899\n799\n\nSample Output 1\n\n350\n1400\n301\n399\n\nThere are two shrines and three temples. The shrines are located at distances of 100, 600 meters from the west end of the road, and the temples are located at distances of 400, 900, 1000 meters from the west end of the road.\n\nQuery 1: If we start from a point at a distance of 150 meters from the west end of the road, the optimal move is first to walk 50 meters west to visit a shrine, then to walk 300 meters east to visit a temple.\n\nQuery 2: If we start from a point at a distance of 2000 meters from the west end of the road, the optimal move is first to walk 1000 meters west to visit a temple, then to walk 400 meters west to visit a shrine. We will pass by another temple on the way, but it is fine.\n\nQuery 3: If we start from a point at a distance of 899 meters from the west end of the road, the optimal move is first to walk 1 meter east to visit a temple, then to walk 300 meters west to visit a shrine.\n\nQuery 4: If we start from a point at a distance of 799 meters from the west end of the road, the optimal move is first to walk 199 meters west to visit a shrine, then to walk 200 meters west to visit a temple.\n\nSample Input 2\n\n1 1 3\n1\n10000000000\n2\n9999999999\n5000000000\n\nSample Output 2\n\n10000000000\n10000000000\n14999999998\n\nThe road is quite long, and we may need to travel a distance that does not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 34296, "cpu_time_ms": 1649, "memory_kb": 67944}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s596684492", "group_id": "codeNet:p03127", "input_text": "\"use strict\"\nconst create = () => {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nfunction gcd(m, n) {\n if (m < n) [m, n] = [n, m]\n let r\n while (n > 0) {\n r = m % n\n m = n\n n = r\n }\n return m\n}\nconst Main = () => {\n let n = nextInt()\n let a = nextIntArray()\n let ans = gcd(a[0], a[1])\n for(let i = 2; i {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\nfunction gcd(m, n) {\n if (m < n) [m, n] = [n, m]\n let r\n while (n > 0) {\n r = m % n\n m = n\n n = r\n }\n return m\n}\nconst Main = () => {\n let n = nextInt()\n let a = nextIntArray()\n let ans = gcd(a[0], a[1])\n for(let i = 2; i parseInt(val, 10)).sort((a, b) => b - a);\n\nwhile (A[1] !== 0) {\n A[0] = A[0] % A[1];\n A.sort((a, b) => b - a);\n}\n\nconsole.log(A[0]);\n", "language": "JavaScript", "metadata": {"date": 1550370214, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03127.html", "problem_id": "p03127", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03127/input.txt", "sample_output_relpath": "derived/input_output/data/p03127/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03127/JavaScript/s203301387.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s203301387", "user_id": "u445747215"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\n// read lines from stdin\nconst input = require(\"fs\")\n .readFileSync(\"/dev/stdin\", \"utf8\")\n .split(\"\\n\");\n\nconst N = parseInt(input[0], 10);\n\nconst A = input[1].split(\" \").map((val) => parseInt(val, 10)).sort((a, b) => b - a);\n\nwhile (A[1] !== 0) {\n A[0] = A[0] % A[1];\n A.sort((a, b) => b - a);\n}\n\nconsole.log(A[0]);\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "sample_input": "4\n2 10 8 40\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03127", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N monsters, numbered 1, 2, ..., N.\n\nInitially, the health of Monster i is A_i.\n\nBelow, a monster with at least 1 health is called alive.\n\nUntil there is only one alive monster, the following is repeated:\n\nA random alive monster attacks another random alive monster.\n\nAs a result, the health of the monster attacked is reduced by the amount equal to the current health of the monster attacking.\n\nFind the minimum possible final health of the last monster alive.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible final health of the last monster alive.\n\nSample Input 1\n\n4\n2 10 8 40\n\nSample Output 1\n\n2\n\nWhen only the first monster keeps on attacking, the final health of the last monster will be 2, which is minimum.\n\nSample Input 2\n\n4\n5 13 8 1000000000\n\nSample Output 2\n\n1\n\nSample Input 3\n\n3\n1000000000 1000000000 1000000000\n\nSample Output 3\n\n1000000000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 336, "cpu_time_ms": 2109, "memory_kb": 29704}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s205207674", "group_id": "codeNet:p03129", "input_text": "function main(input){\n var tmp = input.split(/\\n/).map(str=>{return parseInt(str)});\n console.log(tmp[0] >= (tmp[1] * 2 - 1) ? 'YES' : 'NO');\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1549771926, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03129.html", "problem_id": "p03129", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03129/input.txt", "sample_output_relpath": "derived/input_output/data/p03129/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03129/JavaScript/s205207674.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s205207674", "user_id": "u556291971"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "function main(input){\n var tmp = input.split(/\\n/).map(str=>{return parseInt(str)});\n console.log(tmp[0] >= (tmp[1] * 2 - 1) ? 'YES' : 'NO');\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "sample_input": "3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03129", "source_text": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 205, "cpu_time_ms": 228, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s874144719", "group_id": "codeNet:p03129", "input_text": "function main(input){\n var tmp = input.split(/\\n/).map(str=>{return parseInt(str)});\n console.log(Math.ceil(tmp[0] / tmp[1]) >= 2 ? 'YES' : 'NO');\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1549770634, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03129.html", "problem_id": "p03129", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03129/input.txt", "sample_output_relpath": "derived/input_output/data/p03129/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03129/JavaScript/s874144719.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s874144719", "user_id": "u556291971"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "function main(input){\n var tmp = input.split(/\\n/).map(str=>{return parseInt(str)});\n console.log(Math.ceil(tmp[0] / tmp[1]) >= 2 ? 'YES' : 'NO');\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "sample_input": "3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03129", "source_text": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 210, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s543247437", "group_id": "codeNet:p03129", "input_text": "function Main(input) {\n var inputs = input.split(' '),\n len = inputs.length\n var N, K\n // if (len > 2 || len === 0) {\n // console.log('NO')\n // return\n // }\n // for (var i = 0; i < len; i++) {\n // if (/^\\d+$/.test(inputs[i]) !== -1) {\n // console.log('NO')\n // return\n // }\n // }\n // try {\n N = parseInt(inputs[0], 10)\n K = parseInt(inputs[1], 10)\n // } catch (e) {\n // console.log('NO')\n // return\n // }\n\n if (N < 1 && N > 100) {\n console.log('NO')\n return\n }\n if (K < 1 && K > 100) {\n console.log('NO')\n return\n }\n\n if (N > K) {\n console.log('YES')\n return\n }\n console.log('NO')\n return\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))", "language": "JavaScript", "metadata": {"date": 1549766729, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03129.html", "problem_id": "p03129", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03129/input.txt", "sample_output_relpath": "derived/input_output/data/p03129/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03129/JavaScript/s543247437.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s543247437", "user_id": "u769712662"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "function Main(input) {\n var inputs = input.split(' '),\n len = inputs.length\n var N, K\n // if (len > 2 || len === 0) {\n // console.log('NO')\n // return\n // }\n // for (var i = 0; i < len; i++) {\n // if (/^\\d+$/.test(inputs[i]) !== -1) {\n // console.log('NO')\n // return\n // }\n // }\n // try {\n N = parseInt(inputs[0], 10)\n K = parseInt(inputs[1], 10)\n // } catch (e) {\n // console.log('NO')\n // return\n // }\n\n if (N < 1 && N > 100) {\n console.log('NO')\n return\n }\n if (K < 1 && K > 100) {\n console.log('NO')\n return\n }\n\n if (N > K) {\n console.log('YES')\n return\n }\n console.log('NO')\n return\n}\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))", "problem_context": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "sample_input": "3 2\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03129", "source_text": "Score : 100 points\n\nProblem Statement\n\nDetermine if we can choose K different integers between 1 and N (inclusive) so that no two of them differ by 1.\n\nConstraints\n\n1\\leq N,K\\leq 100\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nIf we can choose K integers as above, print YES; otherwise, print NO.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\nYES\n\nWe can choose 1 and 3.\n\nSample Input 2\n\n5 5\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n31 10\n\nSample Output 3\n\nYES\n\nSample Input 4\n\n10 90\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 713, "cpu_time_ms": 180, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s485706631", "group_id": "codeNet:p03130", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nvar lines = [];\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nreader.on('line', (line) => {\n lines.push(line);\n});\nreader.on('close', () => {\n var road_1 = lines[0].split(' ');\n var road_2 = lines[1].split(' ');\n var road_3 = lines[2].split(' ');\nvar arr = new Array(6);\narr [0] = parseInt(road_1[0]);\narr [1] = parseInt(road_1[1]);\narr [2] = parseInt(road_2[0]);\narr [3] = parseInt(road_2[1]);\narr [4] = parseInt(road_3[0]);\narr [5] = parseInt(road_3[1]);\nvar cnt = new Array(4).fill(0);\n// console.log(arr);\n for (var i = 0 ; i < 6 ; i++) {\nvar num = arr[i] - 1;\ncnt[num] += 1 ;\n}\n// console.log(cnt);\nif (cnt[0] > 2 || cnt[1] > 2 || cnt[2] > 2 || cnt[3] > 2) {\nconsole.log(\"NO\")\n} else {\nconsole.log(\"YES\")\n}\n\n});", "language": "JavaScript", "metadata": {"date": 1549767721, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03130.html", "problem_id": "p03130", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03130/input.txt", "sample_output_relpath": "derived/input_output/data/p03130/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03130/JavaScript/s485706631.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s485706631", "user_id": "u480200496"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\nvar lines = [];\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\nreader.on('line', (line) => {\n lines.push(line);\n});\nreader.on('close', () => {\n var road_1 = lines[0].split(' ');\n var road_2 = lines[1].split(' ');\n var road_3 = lines[2].split(' ');\nvar arr = new Array(6);\narr [0] = parseInt(road_1[0]);\narr [1] = parseInt(road_1[1]);\narr [2] = parseInt(road_2[0]);\narr [3] = parseInt(road_2[1]);\narr [4] = parseInt(road_3[0]);\narr [5] = parseInt(road_3[1]);\nvar cnt = new Array(4).fill(0);\n// console.log(arr);\n for (var i = 0 ; i < 6 ; i++) {\nvar num = arr[i] - 1;\ncnt[num] += 1 ;\n}\n// console.log(cnt);\nif (cnt[0] > 2 || cnt[1] > 2 || cnt[2] > 2 || cnt[3] > 2) {\nconsole.log(\"NO\")\n} else {\nconsole.log(\"YES\")\n}\n\n});", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "sample_input": "4 2\n1 3\n2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03130", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 834, "cpu_time_ms": 61, "memory_kb": 11596}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s708652489", "group_id": "codeNet:p03130", "input_text": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var a = [0,0,0,0,0];\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n return Math.max(...a) <= 2 ? \"YES\" : \"NO\";\n}", "language": "JavaScript", "metadata": {"date": 1549764278, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03130.html", "problem_id": "p03130", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03130/input.txt", "sample_output_relpath": "derived/input_output/data/p03130/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03130/JavaScript/s708652489.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s708652489", "user_id": "u643613120"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var a = [0,0,0,0,0];\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n a[o.a()]++;\n return Math.max(...a) <= 2 ? \"YES\" : \"NO\";\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "sample_input": "4 2\n1 3\n2 3\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03130", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are four towns, numbered 1,2,3 and 4.\nAlso, there are three roads. The i-th road connects different towns a_i and b_i bidirectionally.\nNo two roads connect the same pair of towns. Other than these roads, there is no way to travel between these towns, but any town can be reached from any other town using these roads.\n\nDetermine if we can visit all the towns by traversing each of the roads exactly once.\n\nConstraints\n\n1 \\leq a_i,b_i \\leq 4(1\\leq i\\leq 3)\n\na_i and b_i are different. (1\\leq i\\leq 3)\n\nNo two roads connect the same pair of towns.\n\nAny town can be reached from any other town using the roads.\n\nInput\n\nInput is given from Standard Input in the following format:\n\na_1 b_1\na_2 b_2\na_3 b_3\n\nOutput\n\nIf we can visit all the towns by traversing each of the roads exactly once, print YES; otherwise, print NO.\n\nSample Input 1\n\n4 2\n1 3\n2 3\n\nSample Output 1\n\nYES\n\nWe can visit all the towns in the order 1,3,2,4.\n\nSample Input 2\n\n3 2\n2 4\n1 2\n\nSample Output 2\n\nNO\n\nSample Input 3\n\n2 1\n3 2\n4 3\n\nSample Output 3\n\nYES", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 845, "cpu_time_ms": 1248, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s730398598", "group_id": "codeNet:p03136", "input_text": "//\n\nconst main = (standardInput) => {\n const numberList = standardInput.split(' ');\n const biggestNumber = Math.max.apply(null,numberList);\n const remaingNumber = numberList.filter(n => n !== biggestNumber);\n const sumNumber = remaingNumber.reduce(function(a, x){return a + x;});\n \n if (biggestNumber>sumNumber){\n console.log(\"Yes\");\n }else{\n console.log(\"No\");\n }\n\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'UTF-8'));", "language": "JavaScript", "metadata": {"date": 1584825727, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03136.html", "problem_id": "p03136", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03136/input.txt", "sample_output_relpath": "derived/input_output/data/p03136/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03136/JavaScript/s730398598.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s730398598", "user_id": "u849714662"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "//\n\nconst main = (standardInput) => {\n const numberList = standardInput.split(' ');\n const biggestNumber = Math.max.apply(null,numberList);\n const remaingNumber = numberList.filter(n => n !== biggestNumber);\n const sumNumber = remaingNumber.reduce(function(a, x){return a + x;});\n \n if (biggestNumber>sumNumber){\n console.log(\"Yes\");\n }else{\n console.log(\"No\");\n }\n\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'UTF-8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "sample_input": "4\n3 8 5 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03136", "source_text": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 460, "cpu_time_ms": 258, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s535061297", "group_id": "codeNet:p03136", "input_text": "'use strict';\n\nfunction main(input) {\n const lines = input.split('\\n');\n const N = parseInt(lines[0]);\n const l = lines[1]\n .split(' ')\n .map(Number)\n .sort();\n\n const max = l.pop();\n const sum = l.reduce((prev, curr, i, arr) => prev + curr);\n console.log(max < sum ? 'Yes' : 'No');\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1550081495, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03136.html", "problem_id": "p03136", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03136/input.txt", "sample_output_relpath": "derived/input_output/data/p03136/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03136/JavaScript/s535061297.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s535061297", "user_id": "u765748434"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict';\n\nfunction main(input) {\n const lines = input.split('\\n');\n const N = parseInt(lines[0]);\n const l = lines[1]\n .split(' ')\n .map(Number)\n .sort();\n\n const max = l.pop();\n const sum = l.reduce((prev, curr, i, arr) => prev + curr);\n console.log(max < sum ? 'Yes' : 'No');\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "sample_input": "4\n3 8 5 1\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03136", "source_text": "Score : 200 points\n\nProblem Statement\n\nDetermine if an N-sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane.\n\nYou can use the following theorem:\n\nTheorem: an N-sided polygon satisfying the condition can be drawn if and only if the longest side is strictly shorter than the sum of the lengths of the other N-1 sides.\n\nConstraints\n\nAll values in input are integers.\n\n3 \\leq N \\leq 10\n\n1 \\leq L_i \\leq 100\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nL_1 L_2 ... L_N\n\nOutput\n\nIf an N-sided polygon satisfying the condition can be drawn, print Yes; otherwise, print No.\n\nSample Input 1\n\n4\n3 8 5 1\n\nSample Output 1\n\nYes\n\nSince 8 < 9 = 3 + 5 + 1, it follows from the theorem that such a polygon can be drawn on a plane.\n\nSample Input 2\n\n4\n3 8 4 1\n\nSample Output 2\n\nNo\n\nSince 8 \\geq 8 = 3 + 4 + 1, it follows from the theorem that such a polygon cannot be drawn on a plane.\n\nSample Input 3\n\n10\n1 8 10 5 8 12 34 100 11 3\n\nSample Output 3\n\nNo", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 357, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s069504475", "group_id": "codeNet:p03137", "input_text": "function main(input) {\n const args = input.split('\\n');\n\n var NM = args[0].split(' ');\n var Spins = args[1].split(' ');\n\n var N = parseInt(NM[0]);\n var M = parseInt(NM[1]);\n\n for (var i = 0; i < M; i++) {\n Spins[i] = parseInt(Spins[i]);\n }\n\n Spins.sort(function (a, b) { return a - b; });\n\n var diff = [M-1];\n\n for (var i = 0; i < M - 1; i++) {\n diff[i] = Math.abs(Spins[i] - Spins[i + 1]);\n }\n\n var ans = 0;\n\n if(M < N) {\n N = M;\n }\n\n var index = 0;\n var ans = 0;\n\n for (var i = 0; i < N - 1; i++) {\n index = diff.indexOf(Math.max.apply(null, diff));\n diff[index] = 0;\n }\n for (var i = 0; i < M - 1; i++) {\n ans += diff[i];\n }\n\n console.log(ans);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1549248153, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03137.html", "problem_id": "p03137", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03137/input.txt", "sample_output_relpath": "derived/input_output/data/p03137/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03137/JavaScript/s069504475.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s069504475", "user_id": "u044133843"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function main(input) {\n const args = input.split('\\n');\n\n var NM = args[0].split(' ');\n var Spins = args[1].split(' ');\n\n var N = parseInt(NM[0]);\n var M = parseInt(NM[1]);\n\n for (var i = 0; i < M; i++) {\n Spins[i] = parseInt(Spins[i]);\n }\n\n Spins.sort(function (a, b) { return a - b; });\n\n var diff = [M-1];\n\n for (var i = 0; i < M - 1; i++) {\n diff[i] = Math.abs(Spins[i] - Spins[i + 1]);\n }\n\n var ans = 0;\n\n if(M < N) {\n N = M;\n }\n\n var index = 0;\n var ans = 0;\n\n for (var i = 0; i < N - 1; i++) {\n index = diff.indexOf(Math.max.apply(null, diff));\n diff[index] = 0;\n }\n for (var i = 0; i < M - 1; i++) {\n ans += diff[i];\n }\n\n console.log(ans);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "sample_input": "2 5\n10 12 1 2 14\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03137", "source_text": "Score : 300 points\n\nProblem Statement\n\nWe will play a one-player game using a number line and N pieces.\n\nFirst, we place each of these pieces at some integer coordinate.\n\nHere, multiple pieces can be placed at the same coordinate.\n\nOur objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by repeating the following move:\n\nMove: Choose a piece and let x be its coordinate. Put that piece at coordinate x+1 or x-1.\n\nNote that the coordinates where we initially place the pieces are already regarded as visited.\n\nFind the minimum number of moves required to achieve the objective.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n-10^5 \\leq X_i \\leq 10^5\n\nX_1, X_2, ..., X_M are all different.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nX_1 X_2 ... X_M\n\nOutput\n\nFind the minimum number of moves required to achieve the objective.\n\nSample Input 1\n\n2 5\n10 12 1 2 14\n\nSample Output 1\n\n5\n\nThe objective can be achieved in five moves as follows, and this is the minimum number of moves required.\n\nInitially, put the two pieces at coordinates 1 and 10.\n\nMove the piece at coordinate 1 to 2.\n\nMove the piece at coordinate 10 to 11.\n\nMove the piece at coordinate 11 to 12.\n\nMove the piece at coordinate 12 to 13.\n\nMove the piece at coordinate 13 to 14.\n\nSample Input 2\n\n3 7\n-10 -3 0 9 -100 2 17\n\nSample Output 2\n\n19\n\nSample Input 3\n\n100 1\n-100000\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 811, "cpu_time_ms": 2109, "memory_kb": 17516}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s620412043", "group_id": "codeNet:p03139", "input_text": "function Main(input) {\n const nums = input.split(/\\s/).map(str => { return parseInt(str) });\n console.log(Math.min(nums[1], nums[2]) + ' ' + Math.max(nums[1] + nums[2] - nums[0], 0));\n};\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1549001456, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03139.html", "problem_id": "p03139", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03139/input.txt", "sample_output_relpath": "derived/input_output/data/p03139/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03139/JavaScript/s620412043.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s620412043", "user_id": "u556291971"}, "prompt_components": {"gold_output": "3 0\n", "input_to_evaluate": "function Main(input) {\n const nums = input.split(/\\s/).map(str => { return parseInt(str) });\n console.log(Math.min(nums[1], nums[2]) + ' ' + Math.max(nums[1] + nums[2] - nums[0], 0));\n};\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nWe conducted a survey on newspaper subscriptions.\nMore specifically, we asked each of the N respondents the following two questions:\n\nQuestion 1: Are you subscribing to Newspaper X?\n\nQuestion 2: Are you subscribing to Newspaper Y?\n\nAs the result, A respondents answered \"yes\" to Question 1, and B respondents answered \"yes\" to Question 2.\n\nWhat are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?\n\nWrite a program to answer this question.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq A \\leq N\n\n0 \\leq B \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.\n\nSample Input 1\n\n10 3 5\n\nSample Output 1\n\n3 0\n\nIn this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 3 and at least 0.\n\nSample Input 2\n\n10 7 5\n\nSample Output 2\n\n5 2\n\nIn this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 5 and at least 2.\n\nSample Input 3\n\n100 100 100\n\nSample Output 3\n\n100 100", "sample_input": "10 3 5\n"}, "reference_outputs": ["3 0\n"], "source_document_id": "p03139", "source_text": "Score : 100 points\n\nProblem Statement\n\nWe conducted a survey on newspaper subscriptions.\nMore specifically, we asked each of the N respondents the following two questions:\n\nQuestion 1: Are you subscribing to Newspaper X?\n\nQuestion 2: Are you subscribing to Newspaper Y?\n\nAs the result, A respondents answered \"yes\" to Question 1, and B respondents answered \"yes\" to Question 2.\n\nWhat are the maximum possible number and the minimum possible number of respondents subscribing to both newspapers X and Y?\n\nWrite a program to answer this question.\n\nConstraints\n\n1 \\leq N \\leq 100\n\n0 \\leq A \\leq N\n\n0 \\leq B \\leq N\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN A B\n\nOutput\n\nPrint the maximum possible number and the minimum possible number of respondents subscribing to both newspapers, in this order, with a space in between.\n\nSample Input 1\n\n10 3 5\n\nSample Output 1\n\n3 0\n\nIn this sample, out of the 10 respondents, 3 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 3 and at least 0.\n\nSample Input 2\n\n10 7 5\n\nSample Output 2\n\n5 2\n\nIn this sample, out of the 10 respondents, 7 answered they are subscribing to Newspaper X, and 5 answered they are subscribing to Newspaper Y.\n\nHere, the number of respondents subscribing to both newspapers is at most 5 and at least 2.\n\nSample Input 3\n\n100 100 100\n\nSample Output 3\n\n100 100", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 248, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s860881770", "group_id": "codeNet:p03140", "input_text": "function Main(input){\n input = input.split(\"\\n\");\n var a = input[1].split(\"\");\n var b = input[2].split(\"\");\n var c = input[3].split(\"\");\n var sum = a.length*2;\n for(var i=0;i+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var m = o.a();\n var a = [];\n var b = [];\n var c = Array(n+m-1).fill(9e9);\n for(var i = 0; i < n+m-1; i++){\n var t = o.l().map(a=>a-1);\n if(a[t[1]])a[t[1]].push(t[0]);\n else a[t[1]] = [t[0]];\n if(b[t[0]])b[t[0]].push(t[1]);\n else b[t[0]] = [t[1]];\n }\n var ans = [];\n for(i=0;;i++){\n if(!a[i]){\n var q = b[i];\n ans[i] = 0;\n c[i] = 0;\n break;\n }\n }\n var l = 1, d = 1;\n while(l < n){\n var x = [];\n for(i = 0; i < q.length; i++){\n var y = q[i], f = 1;\n for(var j = 0; j < a[y].length; j++){\n if(c[a[y][j]] >= d){f=0; break;}\n if(c[a[y][j]] === d-1)ans[y] = a[y][j] + 1;\n }\n if(f){c[y] = d; l++; if(b[y])x = x.concat(b[y]);}\n }\n q = x;\n d++;\n }\n return ans.join(\"\\n\");\n}", "language": "JavaScript", "metadata": {"date": 1548644683, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03142.html", "problem_id": "p03142", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03142/input.txt", "sample_output_relpath": "derived/input_output/data/p03142/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03142/JavaScript/s059699518.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s059699518", "user_id": "u643613120"}, "prompt_components": {"gold_output": "0\n1\n2\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var m = o.a();\n var a = [];\n var b = [];\n var c = Array(n+m-1).fill(9e9);\n for(var i = 0; i < n+m-1; i++){\n var t = o.l().map(a=>a-1);\n if(a[t[1]])a[t[1]].push(t[0]);\n else a[t[1]] = [t[0]];\n if(b[t[0]])b[t[0]].push(t[1]);\n else b[t[0]] = [t[1]];\n }\n var ans = [];\n for(i=0;;i++){\n if(!a[i]){\n var q = b[i];\n ans[i] = 0;\n c[i] = 0;\n break;\n }\n }\n var l = 1, d = 1;\n while(l < n){\n var x = [];\n for(i = 0; i < q.length; i++){\n var y = q[i], f = 1;\n for(var j = 0; j < a[y].length; j++){\n if(c[a[y][j]] >= d){f=0; break;}\n if(c[a[y][j]] === d-1)ans[y] = a[y][j] + 1;\n }\n if(f){c[y] = d; l++; if(b[y])x = x.concat(b[y]);}\n }\n q = x;\n d++;\n }\n return ans.join(\"\\n\");\n}", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N.\nEach of the vertices, except the root, has a directed edge coming from its parent.\nNote that the root may not be Vertex 1.\n\nTakahashi has added M new directed edges to this graph.\nEach of these M edges, u \\rightarrow v, extends from some vertex u to its descendant v.\n\nYou are given the directed graph with N vertices and N-1+M edges after Takahashi added edges.\nMore specifically, you are given N-1+M pairs of integers, (A_1, B_1), ..., (A_{N-1+M}, B_{N-1+M}), which represent that the i-th edge extends from Vertex A_i to Vertex B_i.\n\nRestore the original rooted tree.\n\nNotes\n\nFor \"tree\" and other related terms in graph theory, see the article in Wikipedia, for example.\n\nConstraints\n\n3 \\leq N\n\n1 \\leq M\n\nN + M \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\nIf i \\neq j, (A_i, B_i) \\neq (A_j, B_j).\n\nThe graph in input can be obtained by adding M edges satisfying the condition in the problem statement to a rooted tree with N vertices.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_{N-1+M} B_{N-1+M}\n\nOutput\n\nPrint N lines.\nIn the i-th line, print 0 if Vertex i is the root of the original tree, and otherwise print the integer representing the parent of Vertex i in the original tree.\n\nNote that it can be shown that the original tree is uniquely determined.\n\nSample Input 1\n\n3 1\n1 2\n1 3\n2 3\n\nSample Output 1\n\n0\n1\n2\n\nThe graph in this input is shown below:\n\nIt can be seen that this graph is obtained by adding the edge 1 \\rightarrow 3 to the rooted tree 1 \\rightarrow 2 \\rightarrow 3.\n\nSample Input 2\n\n6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n4 6\n6 5\n\nSample Output 2\n\n6\n4\n2\n0\n6\n2", "sample_input": "3 1\n1 2\n1 3\n2 3\n"}, "reference_outputs": ["0\n1\n2\n"], "source_document_id": "p03142", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is a rooted tree (see Notes) with N vertices numbered 1 to N.\nEach of the vertices, except the root, has a directed edge coming from its parent.\nNote that the root may not be Vertex 1.\n\nTakahashi has added M new directed edges to this graph.\nEach of these M edges, u \\rightarrow v, extends from some vertex u to its descendant v.\n\nYou are given the directed graph with N vertices and N-1+M edges after Takahashi added edges.\nMore specifically, you are given N-1+M pairs of integers, (A_1, B_1), ..., (A_{N-1+M}, B_{N-1+M}), which represent that the i-th edge extends from Vertex A_i to Vertex B_i.\n\nRestore the original rooted tree.\n\nNotes\n\nFor \"tree\" and other related terms in graph theory, see the article in Wikipedia, for example.\n\nConstraints\n\n3 \\leq N\n\n1 \\leq M\n\nN + M \\leq 10^5\n\n1 \\leq A_i, B_i \\leq N\n\nA_i \\neq B_i\n\nIf i \\neq j, (A_i, B_i) \\neq (A_j, B_j).\n\nThe graph in input can be obtained by adding M edges satisfying the condition in the problem statement to a rooted tree with N vertices.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nA_1 B_1\n:\nA_{N-1+M} B_{N-1+M}\n\nOutput\n\nPrint N lines.\nIn the i-th line, print 0 if Vertex i is the root of the original tree, and otherwise print the integer representing the parent of Vertex i in the original tree.\n\nNote that it can be shown that the original tree is uniquely determined.\n\nSample Input 1\n\n3 1\n1 2\n1 3\n2 3\n\nSample Output 1\n\n0\n1\n2\n\nThe graph in this input is shown below:\n\nIt can be seen that this graph is obtained by adding the edge 1 \\rightarrow 3 to the rooted tree 1 \\rightarrow 2 \\rightarrow 3.\n\nSample Input 2\n\n6 3\n2 1\n2 3\n4 1\n4 2\n6 1\n2 6\n4 6\n6 5\n\nSample Output 2\n\n6\n4\n2\n0\n6\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1477, "cpu_time_ms": 753, "memory_kb": 73464}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s048627962", "group_id": "codeNet:p03145", "input_text": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nMain();\nfunction Main(){\n var one = nextIntArray();\n var A = one[0];\n var B = one[1];\n myout(A * B / 2);\n}\n", "language": "JavaScript", "metadata": {"date": 1583470536, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/JavaScript/s048627962.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s048627962", "user_id": "u222822036"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input,\n \"index\" : 0,\n \"max\" : input.length,\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n },\n \"hasNext\" : function(){return (this.index < this.max);}\n}\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nMain();\nfunction Main(){\n var one = nextIntArray();\n var A = one[0];\n var B = one[1];\n myout(A * B / 2);\n}\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1589, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s908181502", "group_id": "codeNet:p03145", "input_text": "function Main(input) {\n input = input.trim()\n input = input.split(\" \").map(Number);\n function compareFunc(a, b) {\n return a - b;\n}\ninput.sort(compareFunc);\n console.log(input[2]*input[1])\n}Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1579059873, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/JavaScript/s908181502.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s908181502", "user_id": "u938152299"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function Main(input) {\n input = input.trim()\n input = input.split(\" \").map(Number);\n function compareFunc(a, b) {\n return a - b;\n}\ninput.sort(compareFunc);\n console.log(input[2]*input[1])\n}Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 252, "cpu_time_ms": 54, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s445377570", "group_id": "codeNet:p03145", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n input = input.split(\" \").map(num => Number(num)).sort((a,b) => a-b);\n console.log(input[0] * input[1]/2);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1550800515, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/JavaScript/s445377570.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s445377570", "user_id": "u708467207"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n input = input.split(\" \").map(num => Number(num)).sort((a,b) => a-b);\n console.log(input[0] * input[1]/2);\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 363, "cpu_time_ms": 55, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s529208756", "group_id": "codeNet:p03145", "input_text": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n\n\nvar reader = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on(\"line\", line => {\n let num = line.split(/\\s/).map(i => parseInt(i));\n\n console.log(num[0] * num[1] / 2);\n});\n", "language": "JavaScript", "metadata": {"date": 1548036500, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03145.html", "problem_id": "p03145", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03145/input.txt", "sample_output_relpath": "derived/input_output/data/p03145/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03145/JavaScript/s529208756.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s529208756", "user_id": "u414033039"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n\n\nvar reader = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on(\"line\", line => {\n let num = line.split(/\\s/).map(i => parseInt(i));\n\n console.log(num[0] * num[1] / 2);\n});\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "sample_input": "3 4 5\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03145", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a right triangle ABC with ∠ABC=90°.\n\nGiven the lengths of the three sides, |AB|,|BC| and |CA|, find the area of the right triangle ABC.\n\nIt is guaranteed that the area of the triangle ABC is an integer.\n\nConstraints\n\n1 \\leq |AB|,|BC|,|CA| \\leq 100\n\nAll values in input are integers.\n\nThe area of the triangle ABC is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\n|AB| |BC| |CA|\n\nOutput\n\nPrint the area of the triangle ABC.\n\nSample Input 1\n\n3 4 5\n\nSample Output 1\n\n6\n\nThis triangle has an area of 6.\n\nSample Input 2\n\n5 12 13\n\nSample Output 2\n\n30\n\nThis triangle has an area of 30.\n\nSample Input 3\n\n45 28 53\n\nSample Output 3\n\n630\n\nThis triangle has an area of 630.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 301, "cpu_time_ms": 60, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s496429347", "group_id": "codeNet:p03146", "input_text": "'use strict'\n\nfunction Main(input) {\n const lines = input.split('\\n').map(Number)\n const S = lines[0]\n\n const f = n => {\n if (n % 2 === 0) {\n return n / 2\n } else {\n return 3 * n + 1\n }\n }\n\n let arr = [S]\n for (let i = 1; ; i++) {\n const val = f(arr[i - 1])\n const exists = arr.some(v => v === val)\n if (exists) {\n console.log(i + 1)\n return\n }\n arr[i] = val\n }\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1549066728, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/JavaScript/s496429347.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s496429347", "user_id": "u765748434"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "'use strict'\n\nfunction Main(input) {\n const lines = input.split('\\n').map(Number)\n const S = lines[0]\n\n const f = n => {\n if (n % 2 === 0) {\n return n / 2\n } else {\n return 3 * n + 1\n }\n }\n\n let arr = [S]\n for (let i = 1; ; i++) {\n const val = f(arr[i - 1])\n const exists = arr.some(v => v === val)\n if (exists) {\n console.log(i + 1)\n return\n }\n arr[i] = val\n }\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 471, "cpu_time_ms": 55, "memory_kb": 7624}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s527640989", "group_id": "codeNet:p03146", "input_text": "function main(s) {\n var i = Number(s);\n var c = 0;\n const numList = [s];\n while (i > 0) {\n c += 1;\n if (i % 2 === 0) {\n i = i / 2;\n } else {\n i = n * 3 + 1;\n }\n if (numList.indexOf(i)) return;\n numList.push(i);\n }\n console.log(c);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1548404047, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/JavaScript/s527640989.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s527640989", "user_id": "u466238961"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function main(s) {\n var i = Number(s);\n var c = 0;\n const numList = [s];\n while (i > 0) {\n c += 1;\n if (i % 2 === 0) {\n i = i / 2;\n } else {\n i = n * 3 + 1;\n }\n if (numList.indexOf(i)) return;\n numList.push(i);\n }\n console.log(c);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 323, "cpu_time_ms": 286, "memory_kb": 20552}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s324390578", "group_id": "codeNet:p03146", "input_text": "function f(n) {\n\tif (n % 2 == 0) {\n\t\treturn n / 2\n\t} else {\n\t\treturn 3 * n + 1\n\t}\n}\n\nfunction main(arg) {\n\tvar tmp = Number(arg.split(\"\\n\")[0])\n\tvar arr = []\n\n\tfor(i = 0; i < 1000; i++) {\n\t\tif (i === 0) {\n\t\t\tarr.push(tmp)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar ai = f(arr[i - 1]);\n\n\t\tif (arr.includes(ai)) {\n\t\t\tbreak\n\t\t}\n\t\tarr.push(ai)\n \t}\n\n\t console.log(arr.length + 1)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1548036843, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03146.html", "problem_id": "p03146", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03146/input.txt", "sample_output_relpath": "derived/input_output/data/p03146/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03146/JavaScript/s324390578.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s324390578", "user_id": "u063969814"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function f(n) {\n\tif (n % 2 == 0) {\n\t\treturn n / 2\n\t} else {\n\t\treturn 3 * n + 1\n\t}\n}\n\nfunction main(arg) {\n\tvar tmp = Number(arg.split(\"\\n\")[0])\n\tvar arr = []\n\n\tfor(i = 0; i < 1000; i++) {\n\t\tif (i === 0) {\n\t\t\tarr.push(tmp)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar ai = f(arr[i - 1]);\n\n\t\tif (arr.includes(ai)) {\n\t\t\tbreak\n\t\t}\n\t\tarr.push(ai)\n \t}\n\n\t console.log(arr.length + 1)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "sample_input": "8\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03146", "source_text": "Score : 200 points\n\nProblem Statement\n\nA sequence a=\\{a_1,a_2,a_3,......\\} is determined as follows:\n\nThe first term s is given as input.\n\nLet f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd.\n\na_i = s when i = 1, and a_i = f(a_{i-1}) when i > 1.\n\nFind the minimum integer m that satisfies the following condition:\n\nThere exists an integer n such that a_m = a_n (m > n).\n\nConstraints\n\n1 \\leq s \\leq 100\n\nAll values in input are integers.\n\nIt is guaranteed that all elements in a and the minimum m that satisfies the condition are at most 1000000.\n\nInput\n\nInput is given from Standard Input in the following format:\n\ns\n\nOutput\n\nPrint the minimum integer m that satisfies the condition.\n\nSample Input 1\n\n8\n\nSample Output 1\n\n5\n\na=\\{8,4,2,1,4,2,1,4,2,1,......\\}. As a_5=a_2, the answer is 5.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n18\n\na=\\{7,22,11,34,17,52,26,13,40,20,10,5,16,8,4,2,1,4,2,1,......\\}.\n\nSample Input 3\n\n54\n\nSample Output 3\n\n114", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 412, "cpu_time_ms": 53, "memory_kb": 9292}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s868506862", "group_id": "codeNet:p03149", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.split(\"\\n\");\n\ttmp = input[0].split(\" \");\n\t//文字列から10進数に変換するときはparseIntを使います\n console.log(tmp)\n tmp.sort(function(a,b){\n if( a < b ) return -1;\n if( a > b ) return 1;\n return 0;\n\t})\n \n result = tmp.toString() == [1,4,7,9] ? 'YES' :'NO';\n console.log(result)\n\n}\n//*こ��行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1547410532, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03149.html", "problem_id": "p03149", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03149/input.txt", "sample_output_relpath": "derived/input_output/data/p03149/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03149/JavaScript/s868506862.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s868506862", "user_id": "u563453679"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.split(\"\\n\");\n\ttmp = input[0].split(\" \");\n\t//文字列から10進数に変換するときはparseIntを使います\n console.log(tmp)\n tmp.sort(function(a,b){\n if( a < b ) return -1;\n if( a > b ) return 1;\n return 0;\n\t})\n \n result = tmp.toString() == [1,4,7,9] ? 'YES' :'NO';\n console.log(result)\n\n}\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "sample_input": "1 7 9 4\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03149", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given four digits N_1, N_2, N_3 and N_4. Determine if these can be arranged into the sequence of digits \"1974\".\n\nConstraints\n\n0 \\leq N_1, N_2, N_3, N_4 \\leq 9\n\nN_1, N_2, N_3 and N_4 are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN_1 N_2 N_3 N_4\n\nOutput\n\nIf N_1, N_2, N_3 and N_4 can be arranged into the sequence of digits \"1974\", print YES; if they cannot, print NO.\n\nSample Input 1\n\n1 7 9 4\n\nSample Output 1\n\nYES\n\nWe can get 1974 by swapping N_2 and N_3.\n\nSample Input 2\n\n1 9 7 4\n\nSample Output 2\n\nYES\n\nWe already have 1974 before doing anything.\n\nSample Input 3\n\n1 2 9 1\n\nSample Output 3\n\nNO\n\nSample Input 4\n\n4 9 0 8\n\nSample Output 4\n\nNO", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 642, "cpu_time_ms": 1391, "memory_kb": 22084}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s119422799", "group_id": "codeNet:p03151", "input_text": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n\nvar lines = [];\n\nvar reader = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on(\"line\", line => {\n lines.push(line.split(/\\s/).map(x => parseInt(x)));\n});\n\nreader.on(\"close\", () => {\n let n = lines.shift();\n let a = lines.shift();\n let b = lines.shift();\n\n let aSum = a.reduce((a, i) => a + i);\n let bSum = b.reduce((a, i) => a + i);\n\n if (aSum < bSum) {\n console.log(-1);\n return;\n }\n let count = 0;\n let positiveArr = [];\n let positiveSum = 0;\n let negativeSum = 0;\n let index = 0;\n\n for (let i = 0; i < n; i++) {\n let tmp = a[i] - b[i];\n if (tmp > 0) positiveArr.push(tmp);\n else {\n count += 1;\n negativeSum += tmp;\n }\n }\n\n positiveArr.sort((a, b) => b - a);\n while (positiveSum + negativeSum < 0) {\n positiveSum += positiveArr[index];\n index++;\n }\n\n console.log(count + index);\n});\n", "language": "JavaScript", "metadata": {"date": 1547411580, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03151.html", "problem_id": "p03151", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03151/input.txt", "sample_output_relpath": "derived/input_output/data/p03151/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03151/JavaScript/s119422799.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s119422799", "user_id": "u414033039"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "\"use strict\";\nprocess.stdin.resume();\nprocess.stdin.setEncoding(\"utf8\");\n\nvar lines = [];\n\nvar reader = require(\"readline\").createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on(\"line\", line => {\n lines.push(line.split(/\\s/).map(x => parseInt(x)));\n});\n\nreader.on(\"close\", () => {\n let n = lines.shift();\n let a = lines.shift();\n let b = lines.shift();\n\n let aSum = a.reduce((a, i) => a + i);\n let bSum = b.reduce((a, i) => a + i);\n\n if (aSum < bSum) {\n console.log(-1);\n return;\n }\n let count = 0;\n let positiveArr = [];\n let positiveSum = 0;\n let negativeSum = 0;\n let index = 0;\n\n for (let i = 0; i < n; i++) {\n let tmp = a[i] - b[i];\n if (tmp > 0) positiveArr.push(tmp);\n else {\n count += 1;\n negativeSum += tmp;\n }\n }\n\n positiveArr.sort((a, b) => b - a);\n while (positiveSum + negativeSum < 0) {\n positiveSum += positiveArr[index];\n index++;\n }\n\n console.log(count + index);\n});\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nA university student, Takahashi, has to take N examinations and pass all of them.\nCurrently, his readiness for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination.\n\nTakahashi thinks that he may not be able to pass all the examinations, and he has decided to ask a magician, Aoki, to change the readiness for as few examinations as possible so that he can pass all of them, while not changing the total readiness.\n\nFor Takahashi, find the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the following conditions:\n\nThe sum of the sequence A_1, A_2, ..., A_{N} and the sum of the sequence C_1, C_2, ..., C_{N} are equal.\n\nFor every i, B_i \\leq C_i holds.\n\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nA_i and B_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N}\nB_1 B_2 ... B_{N}\n\nOutput\n\nPrint the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the conditions.\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nSample Input 1\n\n3\n2 3 5\n3 4 1\n\nSample Output 1\n\n3\n\n(A_1, A_2, A_3) = (2, 3, 5) and (B_1, B_2, B_3) = (3, 4, 1). If nothing is done, he cannot pass the first and second exams.\nThe minimum possible number of indices i such that A_i and C_i are different, 3, is achieved when:\n\n(C_1, C_2, C_3) = (3, 5, 2)\n\nSample Input 2\n\n3\n2 3 3\n2 2 1\n\nSample Output 2\n\n0\n\nIn this case, he has to do nothing in order to pass all the exams.\n\nSample Input 3\n\n3\n17 7 1\n25 6 14\n\nSample Output 3\n\n-1\n\nIn this case, no matter what is done, he cannot pass all the exams.\n\nSample Input 4\n\n12\n757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604\n74164189 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212\n\nSample Output 4\n\n5", "sample_input": "3\n2 3 5\n3 4 1\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03151", "source_text": "Score : 400 points\n\nProblem Statement\n\nA university student, Takahashi, has to take N examinations and pass all of them.\nCurrently, his readiness for the i-th examination is A_{i}, and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i-th examination.\n\nTakahashi thinks that he may not be able to pass all the examinations, and he has decided to ask a magician, Aoki, to change the readiness for as few examinations as possible so that he can pass all of them, while not changing the total readiness.\n\nFor Takahashi, find the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the following conditions:\n\nThe sum of the sequence A_1, A_2, ..., A_{N} and the sum of the sequence C_1, C_2, ..., C_{N} are equal.\n\nFor every i, B_i \\leq C_i holds.\n\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq A_i \\leq 10^9\n\n1 \\leq B_i \\leq 10^9\n\nA_i and B_i are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_{N}\nB_1 B_2 ... B_{N}\n\nOutput\n\nPrint the minimum possible number of indices i such that A_i and C_i are different, for a sequence C_1, C_2, ..., C_{N} that satisfies the conditions.\nIf such a sequence C_1, C_2, ..., C_{N} cannot be constructed, print -1.\n\nSample Input 1\n\n3\n2 3 5\n3 4 1\n\nSample Output 1\n\n3\n\n(A_1, A_2, A_3) = (2, 3, 5) and (B_1, B_2, B_3) = (3, 4, 1). If nothing is done, he cannot pass the first and second exams.\nThe minimum possible number of indices i such that A_i and C_i are different, 3, is achieved when:\n\n(C_1, C_2, C_3) = (3, 5, 2)\n\nSample Input 2\n\n3\n2 3 3\n2 2 1\n\nSample Output 2\n\n0\n\nIn this case, he has to do nothing in order to pass all the exams.\n\nSample Input 3\n\n3\n17 7 1\n25 6 14\n\nSample Output 3\n\n-1\n\nIn this case, no matter what is done, he cannot pass all the exams.\n\nSample Input 4\n\n12\n757232153 372327760 440075441 195848680 354974235 458054863 463477172 740174259 615762794 632963102 529866931 64991604\n74164189 98239366 465611891 362739947 147060907 118867039 63189252 78303147 501410831 110823640 122948912 572905212\n\nSample Output 4\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 965, "cpu_time_ms": 908, "memory_kb": 61192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s972055792", "group_id": "codeNet:p03162", "input_text": "var obj = init();\nMain();\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");}\nfunction init(){\n var inputFile = myin();\n var returnObj = {\n \"list\" : inputFile, \"index\" : 0, \"max\" : inputFile.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){if(!this.hasNext()){return \"\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = nextInt();\n var used;\n var dp = new Array(N + 1);\n var list = new Array(N);\n dp[0] = new Array(3).fill(0);\n for(var i = 1; i <= N; i++){\n dp[i] = new Array(3);\n list[i - 1] = nextIntArray();\n }\n for(var i = 0; i < N; i++){\n dp[i + 1][0] = Math.max(dp[i][1],dp[i][2]) + list[i][0];\n dp[i + 1][1] = Math.max(dp[i][0],dp[i][2]) + list[i][1];\n dp[i + 1][2] = Math.max(dp[i][0],dp[i][1]) + list[i][2];\n }\n myout(Math.max.apply(null,dp[N]));\n}", "language": "JavaScript", "metadata": {"date": 1585857523, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03162.html", "problem_id": "p03162", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03162/input.txt", "sample_output_relpath": "derived/input_output/data/p03162/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03162/JavaScript/s972055792.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s972055792", "user_id": "u222822036"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "var obj = init();\nMain();\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction next(){return obj.next();}\nfunction hasNext(){return obj.hasNext();}\nfunction myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");}\nfunction init(){\n var inputFile = myin();\n var returnObj = {\n \"list\" : inputFile, \"index\" : 0, \"max\" : inputFile.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){if(!this.hasNext()){return \"\";}else{var returnInput = this.list[this.index];this.index++;return returnInput;}}\n };\n return returnObj;\n}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var N = nextInt();\n var used;\n var dp = new Array(N + 1);\n var list = new Array(N);\n dp[0] = new Array(3).fill(0);\n for(var i = 1; i <= N; i++){\n dp[i] = new Array(3);\n list[i - 1] = nextIntArray();\n }\n for(var i = 0; i < N; i++){\n dp[i + 1][0] = Math.max(dp[i][1],dp[i][2]) + list[i][0];\n dp[i + 1][1] = Math.max(dp[i][0],dp[i][2]) + list[i][1];\n dp[i + 1][2] = Math.max(dp[i][0],dp[i][1]) + list[i][2];\n }\n myout(Math.max.apply(null,dp[N]));\n}", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2031, "cpu_time_ms": 232, "memory_kb": 58928}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s976022492", "group_id": "codeNet:p03162", "input_text": "'use strict'\nfunction main(input) {\n const tmp = Array.from(input.split('\\n'));\n const N = parseInt(tmp.shift(), 10);\n\n let a = [];\n let b = [];\n let c = [];\n for (let abc of tmp) {\n abc = abc.split(' ').map((elem) => parseInt(elem, 10));\n a.push(abc[0]);\n b.push(abc[1]);\n c.push(abc[2]);\n }\n\n let dp = new Array(N + 1);\n for (let i = 0; i <= N; i++) {\n dp[i] = new Array(3).fill(0);\n }\n const happiestValDay1 = [a[0], b[0], c[0]].reduce((max, elem) => Math.max(max, elem));\n\n dp[1][0] = happiestValDay1;\n dp[1][1] = happiestValDay1;\n dp[1][2] = happiestValDay1;\n for (let day = 2; day <= N; day++) {\n dp[day][0] = Math.max(dp[day][0], dp[day - 1][1] + b[day - 1]);\n dp[day][0] = Math.max(dp[day][0], dp[day - 1][2] + c[day - 1]);\n\n dp[day][1] = Math.max(dp[day][1], dp[day - 1][0] + a[day - 1]);\n dp[day][1] = Math.max(dp[day][1], dp[day - 1][2] + c[day - 1]);\n\n dp[day][2] = Math.max(dp[day][2], dp[day - 1][0] + a[day - 1]);\n dp[day][2] = Math.max(dp[day][2], dp[day - 1][1] + b[day - 1]);\n }\n const answer = [dp[N][0], dp[N][1], dp[N][2]].reduce((max, elem) => Math.max(max, elem));\n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1562274120, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03162.html", "problem_id": "p03162", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03162/input.txt", "sample_output_relpath": "derived/input_output/data/p03162/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03162/JavaScript/s976022492.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s976022492", "user_id": "u647999897"}, "prompt_components": {"gold_output": "210\n", "input_to_evaluate": "'use strict'\nfunction main(input) {\n const tmp = Array.from(input.split('\\n'));\n const N = parseInt(tmp.shift(), 10);\n\n let a = [];\n let b = [];\n let c = [];\n for (let abc of tmp) {\n abc = abc.split(' ').map((elem) => parseInt(elem, 10));\n a.push(abc[0]);\n b.push(abc[1]);\n c.push(abc[2]);\n }\n\n let dp = new Array(N + 1);\n for (let i = 0; i <= N; i++) {\n dp[i] = new Array(3).fill(0);\n }\n const happiestValDay1 = [a[0], b[0], c[0]].reduce((max, elem) => Math.max(max, elem));\n\n dp[1][0] = happiestValDay1;\n dp[1][1] = happiestValDay1;\n dp[1][2] = happiestValDay1;\n for (let day = 2; day <= N; day++) {\n dp[day][0] = Math.max(dp[day][0], dp[day - 1][1] + b[day - 1]);\n dp[day][0] = Math.max(dp[day][0], dp[day - 1][2] + c[day - 1]);\n\n dp[day][1] = Math.max(dp[day][1], dp[day - 1][0] + a[day - 1]);\n dp[day][1] = Math.max(dp[day][1], dp[day - 1][2] + c[day - 1]);\n\n dp[day][2] = Math.max(dp[day][2], dp[day - 1][0] + a[day - 1]);\n dp[day][2] = Math.max(dp[day][2], dp[day - 1][1] + b[day - 1]);\n }\n const answer = [dp[N][0], dp[N][1], dp[N][2]].reduce((max, elem) => Math.max(max, elem));\n console.log(answer);\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "sample_input": "3\n10 40 70\n20 50 80\n30 60 90\n"}, "reference_outputs": ["210\n"], "source_document_id": "p03162", "source_text": "Score : 100 points\n\nProblem Statement\n\nTaro's summer vacation starts tomorrow, and he has decided to make plans for it now.\n\nThe vacation consists of N days.\nFor each i (1 \\leq i \\leq N), Taro will choose one of the following activities and do it on the i-th day:\n\nA: Swim in the sea. Gain a_i points of happiness.\n\nB: Catch bugs in the mountains. Gain b_i points of happiness.\n\nC: Do homework at home. Gain c_i points of happiness.\n\nAs Taro gets bored easily, he cannot do the same activities for two or more consecutive days.\n\nFind the maximum possible total points of happiness that Taro gains.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i, b_i, c_i \\leq 10^4\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 b_1 c_1\na_2 b_2 c_2\n:\na_N b_N c_N\n\nOutput\n\nPrint the maximum possible total points of happiness that Taro gains.\n\nSample Input 1\n\n3\n10 40 70\n20 50 80\n30 60 90\n\nSample Output 1\n\n210\n\nIf Taro does activities in the order C, B, C, he will gain 70 + 50 + 90 = 210 points of happiness.\n\nSample Input 2\n\n1\n100 10 1\n\nSample Output 2\n\n100\n\nSample Input 3\n\n7\n6 7 8\n8 8 3\n2 5 2\n7 8 6\n4 6 8\n2 3 4\n7 5 1\n\nSample Output 3\n\n46\n\nTaro should do activities in the order C, A, B, A, C, B, A.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1218, "cpu_time_ms": 393, "memory_kb": 61388}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s308551179", "group_id": "codeNet:p03166", "input_text": "'use strict'\n\nfunction dfs(root, list, memo) {\n if (memo[root.toString()]) {\n return memo[root.toString()]\n }\n if (!list[root].length) {\n return 0\n }\n var max = 0\n for (var i = 0; i < list[root].length; i++) {\n max = Math.max(max, 1 + dfs(list[root][i], list, memo))\n }\n memo[root.toString()] = max\n return max\n}\n\nfunction adjList(N, edges) {\n var res = new Array(N+1).fill(0).map(e => new Array())\n var incoming = new Array(N+1).fill(0)\n for (var i = 0; i < edges.length; i++) {\n res[edges[i][0]].push(edges[i][1])\n incoming[edges[i][1]]++\n }\n return {\n list: res,\n incoming: incoming\n }\n}\n\nfunction solve(N, edges) {\n var adjListRes = adjList(N, edges)\n var list = adjListRes.list\n var incoming = adjListRes.incoming\n var max = 0\n for (var i = 1; i <= incoming.length; i++) {\n if (incoming[i] === 0) {\n var memo = {}\n max = Math.max(max, dfs(i, list, memo))\n }\n }\n return max\n}\n\nfunction main(input) {\n var lines = input.split(\"\\n\")\n var NM = lines[0].split(' ').map(i => parseInt(i))\n var N = NM[0]\n var edges = lines.slice(1).map(l => l.split(' ').map(e => parseInt(e)))\n var ans = solve(N, edges)\n console.log(ans)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1588494536, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/JavaScript/s308551179.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s308551179", "user_id": "u154996511"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "'use strict'\n\nfunction dfs(root, list, memo) {\n if (memo[root.toString()]) {\n return memo[root.toString()]\n }\n if (!list[root].length) {\n return 0\n }\n var max = 0\n for (var i = 0; i < list[root].length; i++) {\n max = Math.max(max, 1 + dfs(list[root][i], list, memo))\n }\n memo[root.toString()] = max\n return max\n}\n\nfunction adjList(N, edges) {\n var res = new Array(N+1).fill(0).map(e => new Array())\n var incoming = new Array(N+1).fill(0)\n for (var i = 0; i < edges.length; i++) {\n res[edges[i][0]].push(edges[i][1])\n incoming[edges[i][1]]++\n }\n return {\n list: res,\n incoming: incoming\n }\n}\n\nfunction solve(N, edges) {\n var adjListRes = adjList(N, edges)\n var list = adjListRes.list\n var incoming = adjListRes.incoming\n var max = 0\n for (var i = 1; i <= incoming.length; i++) {\n if (incoming[i] === 0) {\n var memo = {}\n max = Math.max(max, dfs(i, list, memo))\n }\n }\n return max\n}\n\nfunction main(input) {\n var lines = input.split(\"\\n\")\n var NM = lines[0].split(' ').map(i => parseInt(i))\n var N = NM[0]\n var edges = lines.slice(1).map(l => l.split(' ').map(e => parseInt(e)))\n var ans = solve(N, edges)\n console.log(ans)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1243, "cpu_time_ms": 215, "memory_kb": 52368}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s767537592", "group_id": "codeNet:p03166", "input_text": "function dfs(root, list, memo) {\n if (memo[root.toString()]) {\n return memo[root.toString()]\n }\n if (!list[root].length) {\n return 0\n }\n var max = 0\n for (var i = 0; i < list[root].length; i++) {\n max = Math.max(max, 1 + dfs(list[root][i], list, memo))\n }\n memo[root.toString()] = max\n return max\n}\n\nfunction adjList(N, edges) {\n var res = new Array(N+1).fill(0).map(e => [])\n var incoming = new Array(N+1).fill(0)\n for (var i = 0; i < edges.length; i++) {\n res[edges[i][0]].push(edges[i][1])\n incoming[edges[i][1]]++\n }\n return {\n list: res,\n incoming: incoming\n }\n}\n\nfunction solve(N, edges) {\n var adjListRes = adjList(N, edges)\n var list = adjListRes.list\n var incoming = adjListRes.incoming\n var max = 0\n for (var i = 1; i <= incoming.length; i++) {\n if (incoming[i] === 0) {\n var memo = {}\n max = Math.max(max, dfs(i, list, memo))\n }\n }\n return max\n}\n\nfunction main(input) {\n var lines = input.split(\"\\n\")\n var NM = lines[0].split(' ').map(i => parseInt(i))\n var N = NM[0]\n var edges = lines.slice(1).map(l => l.split(' ').map(e => parseInt(e)))\n var ans = solve(N, edges)\n return ans\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1588492190, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/JavaScript/s767537592.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s767537592", "user_id": "u154996511"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "function dfs(root, list, memo) {\n if (memo[root.toString()]) {\n return memo[root.toString()]\n }\n if (!list[root].length) {\n return 0\n }\n var max = 0\n for (var i = 0; i < list[root].length; i++) {\n max = Math.max(max, 1 + dfs(list[root][i], list, memo))\n }\n memo[root.toString()] = max\n return max\n}\n\nfunction adjList(N, edges) {\n var res = new Array(N+1).fill(0).map(e => [])\n var incoming = new Array(N+1).fill(0)\n for (var i = 0; i < edges.length; i++) {\n res[edges[i][0]].push(edges[i][1])\n incoming[edges[i][1]]++\n }\n return {\n list: res,\n incoming: incoming\n }\n}\n\nfunction solve(N, edges) {\n var adjListRes = adjList(N, edges)\n var list = adjListRes.list\n var incoming = adjListRes.incoming\n var max = 0\n for (var i = 1; i <= incoming.length; i++) {\n if (incoming[i] === 0) {\n var memo = {}\n max = Math.max(max, dfs(i, list, memo))\n }\n }\n return max\n}\n\nfunction main(input) {\n var lines = input.split(\"\\n\")\n var NM = lines[0].split(' ').map(i => parseInt(i))\n var N = NM[0]\n var edges = lines.slice(1).map(l => l.split(' ').map(e => parseInt(e)))\n var ans = solve(N, edges)\n return ans\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1214, "cpu_time_ms": 244, "memory_kb": 61968}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s614586263", "group_id": "codeNet:p03166", "input_text": "'use strict';\n(function(input){\n input=input.trim().split(/\\n/).map(str=>str.split(/\\s+/).map(x=>x-0));\n const N=input[0][0];\n const M=input[0][1];\n input.shift();\n \n const Node=function(idx){\n var t=this;\n t.index=idx;\n t.children=[];\n t.scanned=false;\n t.height=0;\n }\n \n const nodes=new Array(N+1).fill(0).map((x,i)=>new Node(i));\n //console.log(nodes);\n input.forEach(function(xy){\n var p=xy[0],c=xy[1];\n nodes[p].children.push(nodes[c]);\n });\n //console.log(nodes);\n var ans=0;\n var stack=[];\n var i=1;\n while(i<=N){\n //console.log('大');\n if(nodes[i].scanned){\n ans=Math.max(ans,nodes[i].height);\n i++;\n continue;\n }\n stack.push(i);\n while(stack.length>0){\n //console.log('中');\n let t=nodes[stack[stack.length-1]];\n //console.log(stack);\n if(t.children.length===0){\n t.scanned=true;\n stack.pop();\n continue;\n }\n let lastChild=t.children[t.children.length-1];\n if(lastChild.scanned){\n t.height=Math.max(t.height,lastChild.height+1);\n t.children.pop();\n }else{\n stack.push(lastChild.index);\n }\n }\n nodes[i].scanned=true;\n }\n //console.log(nodes);\n console.log(ans);\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "language": "JavaScript", "metadata": {"date": 1558238842, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/JavaScript/s614586263.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s614586263", "user_id": "u833932983"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "'use strict';\n(function(input){\n input=input.trim().split(/\\n/).map(str=>str.split(/\\s+/).map(x=>x-0));\n const N=input[0][0];\n const M=input[0][1];\n input.shift();\n \n const Node=function(idx){\n var t=this;\n t.index=idx;\n t.children=[];\n t.scanned=false;\n t.height=0;\n }\n \n const nodes=new Array(N+1).fill(0).map((x,i)=>new Node(i));\n //console.log(nodes);\n input.forEach(function(xy){\n var p=xy[0],c=xy[1];\n nodes[p].children.push(nodes[c]);\n });\n //console.log(nodes);\n var ans=0;\n var stack=[];\n var i=1;\n while(i<=N){\n //console.log('大');\n if(nodes[i].scanned){\n ans=Math.max(ans,nodes[i].height);\n i++;\n continue;\n }\n stack.push(i);\n while(stack.length>0){\n //console.log('中');\n let t=nodes[stack[stack.length-1]];\n //console.log(stack);\n if(t.children.length===0){\n t.scanned=true;\n stack.pop();\n continue;\n }\n let lastChild=t.children[t.children.length-1];\n if(lastChild.scanned){\n t.height=Math.max(t.height,lastChild.height+1);\n t.children.pop();\n }else{\n stack.push(lastChild.index);\n }\n }\n nodes[i].scanned=true;\n }\n //console.log(nodes);\n console.log(ans);\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1291, "cpu_time_ms": 430, "memory_kb": 70208}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s577560794", "group_id": "codeNet:p03166", "input_text": "'use strict';\n(function(input){\n input=input.trim().split(/\\n/).map(str=>str.split(/\\s+/).map(x=>x-0));\n const N=input[0][0];\n const M=input[0][1];\n input.shift();\n \n const Node=function(idx){\n var t=this;\n t.index=idx;\n t.children=[];\n t.scanned=false;\n t.height=0;\n }\n \n const nodes=new Array(N+1).fill(0).map((x,i)=>new Node(i));\n //console.log(nodes);\n input.forEach(function(xy){\n var p=xy[0],c=xy[1];\n nodes[p].children.push(nodes[c]);\n });\n //console.log(nodes);\n var ans=0;\n var i=1;\n while(i<=N){\n if(nodes[i].scanned){\n ans=Math.max(ans,nodes[i].height);\n i++;\n continue;\n }\n let I=i;\n while(nodes[I].children.length>0){\n if(nodes[I].children[nodes[I].children.length-1].scanned){\n nodes[I].height=Math.max(nodes[I].height,nodes[I].children.pop().height+1);\n }else{\n I=nodes[I].children[nodes[I].children.length-1].index;\n }\n }\n nodes[I].scanned=true;\n }\n //console.log(nodes);\n console.log(ans);\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "language": "JavaScript", "metadata": {"date": 1558236802, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03166.html", "problem_id": "p03166", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03166/input.txt", "sample_output_relpath": "derived/input_output/data/p03166/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03166/JavaScript/s577560794.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s577560794", "user_id": "u833932983"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "'use strict';\n(function(input){\n input=input.trim().split(/\\n/).map(str=>str.split(/\\s+/).map(x=>x-0));\n const N=input[0][0];\n const M=input[0][1];\n input.shift();\n \n const Node=function(idx){\n var t=this;\n t.index=idx;\n t.children=[];\n t.scanned=false;\n t.height=0;\n }\n \n const nodes=new Array(N+1).fill(0).map((x,i)=>new Node(i));\n //console.log(nodes);\n input.forEach(function(xy){\n var p=xy[0],c=xy[1];\n nodes[p].children.push(nodes[c]);\n });\n //console.log(nodes);\n var ans=0;\n var i=1;\n while(i<=N){\n if(nodes[i].scanned){\n ans=Math.max(ans,nodes[i].height);\n i++;\n continue;\n }\n let I=i;\n while(nodes[I].children.length>0){\n if(nodes[I].children[nodes[I].children.length-1].scanned){\n nodes[I].height=Math.max(nodes[I].height,nodes[I].children.pop().height+1);\n }else{\n I=nodes[I].children[nodes[I].children.length-1].index;\n }\n }\n nodes[I].scanned=true;\n }\n //console.log(nodes);\n console.log(ans);\n})(require('fs').readFileSync('/dev/stdin','utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "sample_input": "4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03166", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a directed graph G with N vertices and M edges.\nThe vertices are numbered 1, 2, \\ldots, N, and for each i (1 \\leq i \\leq M), the i-th directed edge goes from Vertex x_i to y_i.\nG does not contain directed cycles.\n\nFind the length of the longest directed path in G.\nHere, the length of a directed path is the number of edges in it.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nAll pairs (x_i, y_i) are distinct.\n\nG does not contain directed cycles.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nx_1 y_1\nx_2 y_2\n:\nx_M y_M\n\nOutput\n\nPrint the length of the longest directed path in G.\n\nSample Input 1\n\n4 5\n1 2\n1 3\n3 2\n2 4\n3 4\n\nSample Output 1\n\n3\n\nThe red directed path in the following figure is the longest:\n\nSample Input 2\n\n6 3\n2 3\n4 5\n5 6\n\nSample Output 2\n\n2\n\nThe red directed path in the following figure is the longest:\n\nSample Input 3\n\n5 8\n5 3\n2 3\n2 4\n5 2\n5 1\n1 4\n4 3\n1 3\n\nSample Output 3\n\n3\n\nThe red directed path in the following figure is one of the longest:", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1064, "cpu_time_ms": 2112, "memory_kb": 70072}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s084147782", "group_id": "codeNet:p03175", "input_text": "'use strict'\n\nvar mod = 1e9 + 7\n\nfunction dfs(root, adj, visited) {\n var ans = [1, 1]\n for (var i = 0; i < adj[root].length; i++) {\n if (!visited[adj[root][i]]) {\n visited[adj[root][i]] = 1\n var res = dfs(adj[root][i], adj, visited)\n ans[0] = (ans[0] * (res[0] + res[1])) % mod\n ans[1] = (ans[1] * res[0]) % mod\n }\n }\n return ans\n}\n\nfunction adjList(N, E) {\n var list = new Array(N+1).fill(0).map(e => new Array(0).fill(0))\n for (var i = 0; i < E.length; i++) {\n var src = E[i][0]\n var dest = E[i][1]\n list[src].push(dest)\n list[dest].push(src)\n }\n return list\n}\n\nfunction solve(N, E) {\n var adj = adjList(N, E)\n var visited = new Array(N+1).fill(0)\n visited[1] = 1\n var res = dfs(1, adj, visited)\n return (res[0] + res[1]) % mod\n}\n\nfunction main(input) {\n var lines = input.split(\"\\n\")\n var N = parseInt(lines[0])\n var E = lines.slice(1).map(l => l.split(' ').map(e => parseInt(e)))\n var ans = solve(N, E)\n console.log(ans)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1589244147, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03175.html", "problem_id": "p03175", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03175/input.txt", "sample_output_relpath": "derived/input_output/data/p03175/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03175/JavaScript/s084147782.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s084147782", "user_id": "u154996511"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "'use strict'\n\nvar mod = 1e9 + 7\n\nfunction dfs(root, adj, visited) {\n var ans = [1, 1]\n for (var i = 0; i < adj[root].length; i++) {\n if (!visited[adj[root][i]]) {\n visited[adj[root][i]] = 1\n var res = dfs(adj[root][i], adj, visited)\n ans[0] = (ans[0] * (res[0] + res[1])) % mod\n ans[1] = (ans[1] * res[0]) % mod\n }\n }\n return ans\n}\n\nfunction adjList(N, E) {\n var list = new Array(N+1).fill(0).map(e => new Array(0).fill(0))\n for (var i = 0; i < E.length; i++) {\n var src = E[i][0]\n var dest = E[i][1]\n list[src].push(dest)\n list[dest].push(src)\n }\n return list\n}\n\nfunction solve(N, E) {\n var adj = adjList(N, E)\n var visited = new Array(N+1).fill(0)\n visited[1] = 1\n var res = dfs(1, adj, visited)\n return (res[0] + res[1]) % mod\n}\n\nfunction main(input) {\n var lines = input.split(\"\\n\")\n var N = parseInt(lines[0])\n var E = lines.slice(1).map(l => l.split(' ').map(e => parseInt(e)))\n var ans = solve(N, E)\n console.log(ans)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is a tree with N vertices, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N - 1), the i-th edge connects Vertex x_i and y_i.\n\nTaro has decided to paint each vertex in white or black.\nHere, it is not allowed to paint two adjacent vertices both in black.\n\nFind the number of ways in which the vertices can be painted, modulo 10^9 + 7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n:\nx_{N - 1} y_{N - 1}\n\nOutput\n\nPrint the number of ways in which the vertices can be painted, modulo 10^9 + 7.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n5\n\nThere are five ways to paint the vertices, as follows:\n\nSample Input 2\n\n4\n1 2\n1 3\n1 4\n\nSample Output 2\n\n9\n\nThere are nine ways to paint the vertices, as follows:\n\nSample Input 3\n\n1\n\nSample Output 3\n\n2\n\nSample Input 4\n\n10\n8 5\n10 8\n6 5\n1 5\n4 8\n2 10\n3 6\n9 2\n1 7\n\nSample Output 4\n\n157", "sample_input": "3\n1 2\n2 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03175", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is a tree with N vertices, numbered 1, 2, \\ldots, N.\nFor each i (1 \\leq i \\leq N - 1), the i-th edge connects Vertex x_i and y_i.\n\nTaro has decided to paint each vertex in white or black.\nHere, it is not allowed to paint two adjacent vertices both in black.\n\nFind the number of ways in which the vertices can be painted, modulo 10^9 + 7.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq x_i, y_i \\leq N\n\nThe given graph is a tree.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nx_1 y_1\nx_2 y_2\n:\nx_{N - 1} y_{N - 1}\n\nOutput\n\nPrint the number of ways in which the vertices can be painted, modulo 10^9 + 7.\n\nSample Input 1\n\n3\n1 2\n2 3\n\nSample Output 1\n\n5\n\nThere are five ways to paint the vertices, as follows:\n\nSample Input 2\n\n4\n1 2\n1 3\n1 4\n\nSample Output 2\n\n9\n\nThere are nine ways to paint the vertices, as follows:\n\nSample Input 3\n\n1\n\nSample Output 3\n\n2\n\nSample Input 4\n\n10\n8 5\n10 8\n6 5\n1 5\n4 8\n2 10\n3 6\n9 2\n1 7\n\nSample Output 4\n\n157", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1040, "cpu_time_ms": 227, "memory_kb": 56348}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s983075171", "group_id": "codeNet:p03186", "input_text": "'use strict'\n\nconst main = input => {\n\tconst args = input.split('\\n')[0].split(' ')\n\tlet a = parseInt(args[0], 10)\n\tlet b = parseInt(args[1], 10)\n\tlet c = parseInt(args[2], 10)\n\tlet t1 = false \n\tlet cnt = 0\n\n\twhile (true) {\n\t\tif (t1) {\n\t\t\tif (b > 0) {\n\t\t\t\tb--\n\t\t\t\tt1 = false\n\t\t\t\tcnt++\n\t\t\t} else if (a > 0) {\n\t\t\t\ta--\n\t\t\t\tt1 = false\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif (c > 0) {\n\t\t\t\tc--\n\t\t\t\tt1 = true\n\t\t\t\tcnt++\n\t\t\t} else if (b > 0) {\n\t\t\t\tb--\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(cnt)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "language": "JavaScript", "metadata": {"date": 1562445859, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03186.html", "problem_id": "p03186", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03186/input.txt", "sample_output_relpath": "derived/input_output/data/p03186/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03186/JavaScript/s983075171.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s983075171", "user_id": "u608105024"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "'use strict'\n\nconst main = input => {\n\tconst args = input.split('\\n')[0].split(' ')\n\tlet a = parseInt(args[0], 10)\n\tlet b = parseInt(args[1], 10)\n\tlet c = parseInt(args[2], 10)\n\tlet t1 = false \n\tlet cnt = 0\n\n\twhile (true) {\n\t\tif (t1) {\n\t\t\tif (b > 0) {\n\t\t\t\tb--\n\t\t\t\tt1 = false\n\t\t\t\tcnt++\n\t\t\t} else if (a > 0) {\n\t\t\t\ta--\n\t\t\t\tt1 = false\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t} else {\n\t\t\tif (c > 0) {\n\t\t\t\tc--\n\t\t\t\tt1 = true\n\t\t\t\tcnt++\n\t\t\t} else if (b > 0) {\n\t\t\t\tb--\n\t\t\t\tcnt++\n\t\t\t} else {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(cnt)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'))\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death.\nAs he wants to live, he cannot eat one in such a situation.\nEating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\n\nFind the maximum number of tasty cookies that Takahashi can eat.\n\nConstraints\n\n0 \\leq A,B,C \\leq 10^9\n\nA,B and C are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum number of tasty cookies that Takahashi can eat.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n5\n\nWe can eat all tasty cookies, in the following order:\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nA tasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nSample Input 2\n\n5 2 9\n\nSample Output 2\n\n10\n\nSample Input 3\n\n8 8 1\n\nSample Output 3\n\n9", "sample_input": "3 1 4\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03186", "source_text": "Score : 200 points\n\nProblem Statement\n\nTakahashi has A untasty cookies containing antidotes, B tasty cookies containing antidotes and C tasty cookies containing poison.\n\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death.\nAs he wants to live, he cannot eat one in such a situation.\nEating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\n\nFind the maximum number of tasty cookies that Takahashi can eat.\n\nConstraints\n\n0 \\leq A,B,C \\leq 10^9\n\nA,B and C are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B C\n\nOutput\n\nPrint the maximum number of tasty cookies that Takahashi can eat.\n\nSample Input 1\n\n3 1 4\n\nSample Output 1\n\n5\n\nWe can eat all tasty cookies, in the following order:\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nA tasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nAn untasty cookie containing antidotes\n\nA tasty cookie containing poison\n\nSample Input 2\n\n5 2 9\n\nSample Output 2\n\n10\n\nSample Input 3\n\n8 8 1\n\nSample Output 3\n\n9", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 569, "cpu_time_ms": 2108, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s439689854", "group_id": "codeNet:p03195", "input_text": "\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction main(input) {\n var lines = input.split('\\n');\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 1),\n N = _splitNum2[0];\n\n var as = splitNum(input).slice(1, N + 1);\n as.sort(function (a, b) {\n return a - b;\n });\n var res = as[N - 1] % 2 === 1;\n\n for (var idx = N - 2; idx >= 0; idx--) {\n if ((as[idx] - 1) % 2 === 0) {\n res = !res;\n }\n }\n\n console.log(res ? 'first' : 'second');\n} // true: first, false: second\n\n\nfunction solve(N, as, idx) {\n if (N === 1) {\n return as[idx] % 2 === 1;\n }\n\n var rem = solve(N - 1, as, idx + 1);\n var cur = as[idx];\n return (cur - 1) % 2 === 1 ? rem : !rem;\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction splitNum(line) {\n return line.split(/\\s+/).map(function (n) {\n return parseInt(n);\n });\n}\n", "language": "JavaScript", "metadata": {"date": 1545536197, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03195.html", "problem_id": "p03195", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03195/input.txt", "sample_output_relpath": "derived/input_output/data/p03195/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03195/JavaScript/s439689854.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s439689854", "user_id": "u251786347"}, "prompt_components": {"gold_output": "first\n", "input_to_evaluate": "\"use strict\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction main(input) {\n var lines = input.split('\\n');\n\n var _splitNum = splitNum(lines[0]),\n _splitNum2 = _slicedToArray(_splitNum, 1),\n N = _splitNum2[0];\n\n var as = splitNum(input).slice(1, N + 1);\n as.sort(function (a, b) {\n return a - b;\n });\n var res = as[N - 1] % 2 === 1;\n\n for (var idx = N - 2; idx >= 0; idx--) {\n if ((as[idx] - 1) % 2 === 0) {\n res = !res;\n }\n }\n\n console.log(res ? 'first' : 'second');\n} // true: first, false: second\n\n\nfunction solve(N, as, idx) {\n if (N === 1) {\n return as[idx] % 2 === 1;\n }\n\n var rem = solve(N - 1, as, idx + 1);\n var cur = as[idx];\n return (cur - 1) % 2 === 1 ? rem : !rem;\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\nfunction splitNum(line) {\n return line.split(/\\s+/).map(function (n) {\n return parseInt(n);\n });\n}\n", "problem_context": "Score : 500 points\n\nProblem Statement\n\nThere is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.\n\nYou and Lunlun the dachshund alternately perform the following operation (starting from you):\n\nChoose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.\n\nThe one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nIf you will win, print first; if Lunlun will win, print second.\n\nSample Input 1\n\n2\n1\n2\n\nSample Output 1\n\nfirst\n\nLet Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.\n\nYou should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.\n\nNote that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).\n\nSample Input 2\n\n3\n100000\n30000\n20000\n\nSample Output 2\n\nsecond", "sample_input": "2\n1\n2\n"}, "reference_outputs": ["first\n"], "source_document_id": "p03195", "source_text": "Score : 500 points\n\nProblem Statement\n\nThere is an apple tree that bears apples of N colors. The N colors of these apples are numbered 1 to N, and there are a_i apples of Color i.\n\nYou and Lunlun the dachshund alternately perform the following operation (starting from you):\n\nChoose one or more apples from the tree and eat them. Here, the apples chosen at the same time must all have different colors.\n\nThe one who eats the last apple from the tree will be declared winner. If both you and Lunlun play optimally, which will win?\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq a_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1\na_2\n:\na_N\n\nOutput\n\nIf you will win, print first; if Lunlun will win, print second.\n\nSample Input 1\n\n2\n1\n2\n\nSample Output 1\n\nfirst\n\nLet Color 1 be red, and Color 2 be blue. In this case, the tree bears one red apple and two blue apples.\n\nYou should eat the red apple in your first turn. Lunlun is then forced to eat one of the blue apples, and you can win by eating the other in your next turn.\n\nNote that you are also allowed to eat two apples in your first turn, one red and one blue (not a winning move, though).\n\nSample Input 2\n\n3\n100000\n30000\n20000\n\nSample Output 2\n\nsecond", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1558, "cpu_time_ms": 137, "memory_kb": 29960}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s026142405", "group_id": "codeNet:p03200", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n S= input[0].split(\" \");\n var n=0\n var w=0\n for(i=0;i+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var a = o.l();\n var b = {};\n var pow2 = [2];\n a.sort((a,b)=>b-a);\n for(var i = 1; pow2[i-1] <= a[0]; i++)pow2[i] = pow2[i-1] * 2;\n var u = i-1;\n for(i = 0; i < n; i++){\n if(b[a[i]])b[a[i]]++;\n else b[a[i]] = 1;\n }\n ans = 0;\n for(i = 0; i < n; i++){\n b[a[i]]--;\n if(b[a[i]] < 0)continue;\n while(u > 0 && pow2[u-1] > a[i]){\n u--;\n }\n var t = pow2[u] - a[i];\n if(b[t] > 0){b[t]--; ans++;}\n }\n return ans;\n}", "language": "JavaScript", "metadata": {"date": 1544928627, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03201.html", "problem_id": "p03201", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03201/input.txt", "sample_output_relpath": "derived/input_output/data/p03201/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03201/JavaScript/s723095779.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s723095779", "user_id": "u643613120"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split(\"\\n\");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]===\"string\")s[y]=s[y].split(\" \").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(\" \");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(\" \"));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();\nvar o=GET(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var a = o.l();\n var b = {};\n var pow2 = [2];\n a.sort((a,b)=>b-a);\n for(var i = 1; pow2[i-1] <= a[0]; i++)pow2[i] = pow2[i-1] * 2;\n var u = i-1;\n for(i = 0; i < n; i++){\n if(b[a[i]])b[a[i]]++;\n else b[a[i]] = 1;\n }\n ans = 0;\n for(i = 0; i < n; i++){\n b[a[i]]--;\n if(b[a[i]] < 0)continue;\n while(u > 0 && pow2[u-1] > a[i]){\n u--;\n }\n var t = pow2[u] - a[i];\n if(b[t] > 0){b[t]--; ans++;}\n }\n return ans;\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i.\nHe would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\nNote that a ball cannot belong to multiple pairs.\nFind the maximum possible number of pairs that can be formed.\n\nHere, a positive integer is said to be a power of 2 when it can be written as 2^t using some non-negative integer t.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n1\n\nWe can form one pair whose sum of the written numbers is 4 by pairing the first and third balls.\nNote that we cannot pair the second ball with itself.\n\nSample Input 2\n\n5\n3 11 14 5 13\n\nSample Output 2\n\n2", "sample_input": "3\n1 2 3\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03201", "source_text": "Score : 600 points\n\nProblem Statement\n\nTakahashi has N balls with positive integers written on them. The integer written on the i-th ball is A_i.\nHe would like to form some number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\nNote that a ball cannot belong to multiple pairs.\nFind the maximum possible number of pairs that can be formed.\n\nHere, a positive integer is said to be a power of 2 when it can be written as 2^t using some non-negative integer t.\n\nConstraints\n\n1 \\leq N \\leq 2\\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nA_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum possible number of pairs such that the sum of the integers written on each pair of balls is a power of 2.\n\nSample Input 1\n\n3\n1 2 3\n\nSample Output 1\n\n1\n\nWe can form one pair whose sum of the written numbers is 4 by pairing the first and third balls.\nNote that we cannot pair the second ball with itself.\n\nSample Input 2\n\n5\n3 11 14 5 13\n\nSample Output 2\n\n2", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1154, "cpu_time_ms": 341, "memory_kb": 67220}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s415839314", "group_id": "codeNet:p03202", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0]);\n A = new Array(N);\n tmp=input[1].split(\" \");\n for(i=0;iA[i-1]){\n for(j=0;j=0;j--){\n if(B[j]==c){\n B[j]=1;\n }else if(B[j]!=c){\n B[j]=B[j]+1;\n flag=2;\n break;\n }\n }\n }\n }\n for(i=0;iA[i-1]){\n for(j=0;j=0;j--){\n if(B[j]==c){\n B[j]=1;\n }else if(B[j]!=c){\n B[j]=B[j]+1;\n flag=2;\n break;\n }\n }\n }\n }\n for(i=0;i parseInt(n, 10));\n const COUNT = input[0];\n input.shift();\n const MAX = Math.max.apply(null, input);\n const maxIndex = input.indexOf(MAX);\n input[maxIndex] = ( input[maxIndex] / 2 );\n \n sum = input.reduce((a,x) => a+=x,0);\n console.log(sum);\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1544635177, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03207.html", "problem_id": "p03207", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03207/input.txt", "sample_output_relpath": "derived/input_output/data/p03207/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03207/JavaScript/s977469383.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s977469383", "user_id": "u598795006"}, "prompt_components": {"gold_output": "15950\n", "input_to_evaluate": "function main(input) {\n input = input.split('\\n').map((n) => parseInt(n, 10));\n const COUNT = input[0];\n input.shift();\n const MAX = Math.max.apply(null, input);\n const maxIndex = input.indexOf(MAX);\n input[maxIndex] = ( input[maxIndex] / 2 );\n \n sum = input.reduce((a,x) => a+=x,0);\n console.log(sum);\n}\n \nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "sample_input": "3\n4980\n7980\n6980\n"}, "reference_outputs": ["15950\n"], "source_document_id": "p03207", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn some other world, today is the day before Christmas Eve.\n\nMr. Takaha is buying N items at a department store. The regular price of the i-th item (1 \\leq i \\leq N) is p_i yen (the currency of Japan).\n\nHe has a discount coupon, and can buy one item with the highest price for half the regular price. The remaining N-1 items cost their regular prices. What is the total amount he will pay?\n\nConstraints\n\n2 \\leq N \\leq 10\n\n100 \\leq p_i \\leq 10000\n\np_i is an even number.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\np_1\np_2\n:\np_N\n\nOutput\n\nPrint the total amount Mr. Takaha will pay.\n\nSample Input 1\n\n3\n4980\n7980\n6980\n\nSample Output 1\n\n15950\n\nThe 7980-yen item gets the discount and the total is 4980 + 7980 / 2 + 6980 = 15950 yen.\n\nNote that outputs such as 15950.0 will be judged as Wrong Answer.\n\nSample Input 2\n\n4\n4320\n4320\n4320\n4320\n\nSample Output 2\n\n15120\n\nOnly one of the four items gets the discount and the total is 4320 / 2 + 4320 + 4320 + 4320 = 15120 yen.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 380, "cpu_time_ms": 55, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s992053443", "group_id": "codeNet:p03208", "input_text": "function convertBasedRepr(x, n) {\n\tvar result = []\n\t\n\tdo {\n\t\tvar t = x % n\n\t\tresult.push(t)\n\t\tvar m = Math.floor(x / n)\n\n\t\tif (m < n) {\n\t\t\tif (m !== 0) {\n\t\t\t\tresult.push(m)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tx = (x - t) /n\n\t} while(1)\n\n\treturn result\n}\n\nfunction main(arg) {\n\targ = arg.trim().split(\"\\n\")\n\tvar h = arg;\n\tvar NK = arg.shift()\n\tNK = NK.split(\" \")\n\tvar N = NK[0]\n\tvar K = Number(NK[1])\n\n\tvar result_diff = -1\n\n\tfor (var i = 0; i < 1000; i++) {\n\t\t//添字作り\n\t\t// var i_list = i.toString(h.length + 1)\n\t\tvar i_list = convertBasedRepr(i, h.length)\n \n if (i_list.length > K) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// if (i_list.indexOf(0) !== -1) {\n\t\t// \tcontinue;\n\t\t// }\n// console.log(i_list.length)\n\t\tif (i_list.length !== K) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar tmp = i_list.filter(function (x, n, self) {\n return self.indexOf(x) === n && n !== self.lastIndexOf(x);\n });\n\n\t\tif (tmp.length > 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i_list !== i_list.sort()) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// i_list = i_list.map(e => Number(e))\n// console.log(i_list);\n\t\tvar i_list_max = 0;\n\t\tvar i_list_min = 0;\n\t\t\n\t\tfor (var j = 0; j < i_list.length; j++) {\n\t\t\tvar value = h[i_list[j]]\n\t\t\tif (j === 0) {\n\t\t\t\ti_list_max = i_list_min = value;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (value > i_list_max) {\n\t\t\t\ti_list_max = value;\n\t\t\t}\n\t\t\tif (value < i_list_min) {\n\t\t\t\ti_list_min = value;\n\t\t\t}\n\t\t}\n\n\t\tvar tmp_diff = Number(i_list_max) - Number(i_list_min)\n\n\t\tif (result_diff === -1) {\n\t\t\tresult_diff = tmp_diff\n\t\t\tcontinue\n\t\t}\n\n\t\tif (result_diff > tmp_diff) {\n\t\t\tresult_diff = tmp_diff\n\t\t}\n\t\t// console.log(i_list.length)\n\t\t// console.log([Number(i_list_max) , Number(i_list_min)])\n\t}\n\tconsole.log(result_diff)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n", "language": "JavaScript", "metadata": {"date": 1544326769, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03208.html", "problem_id": "p03208", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03208/input.txt", "sample_output_relpath": "derived/input_output/data/p03208/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03208/JavaScript/s992053443.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s992053443", "user_id": "u063969814"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function convertBasedRepr(x, n) {\n\tvar result = []\n\t\n\tdo {\n\t\tvar t = x % n\n\t\tresult.push(t)\n\t\tvar m = Math.floor(x / n)\n\n\t\tif (m < n) {\n\t\t\tif (m !== 0) {\n\t\t\t\tresult.push(m)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t\tx = (x - t) /n\n\t} while(1)\n\n\treturn result\n}\n\nfunction main(arg) {\n\targ = arg.trim().split(\"\\n\")\n\tvar h = arg;\n\tvar NK = arg.shift()\n\tNK = NK.split(\" \")\n\tvar N = NK[0]\n\tvar K = Number(NK[1])\n\n\tvar result_diff = -1\n\n\tfor (var i = 0; i < 1000; i++) {\n\t\t//添字作り\n\t\t// var i_list = i.toString(h.length + 1)\n\t\tvar i_list = convertBasedRepr(i, h.length)\n \n if (i_list.length > K) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// if (i_list.indexOf(0) !== -1) {\n\t\t// \tcontinue;\n\t\t// }\n// console.log(i_list.length)\n\t\tif (i_list.length !== K) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar tmp = i_list.filter(function (x, n, self) {\n return self.indexOf(x) === n && n !== self.lastIndexOf(x);\n });\n\n\t\tif (tmp.length > 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i_list !== i_list.sort()) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// i_list = i_list.map(e => Number(e))\n// console.log(i_list);\n\t\tvar i_list_max = 0;\n\t\tvar i_list_min = 0;\n\t\t\n\t\tfor (var j = 0; j < i_list.length; j++) {\n\t\t\tvar value = h[i_list[j]]\n\t\t\tif (j === 0) {\n\t\t\t\ti_list_max = i_list_min = value;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (value > i_list_max) {\n\t\t\t\ti_list_max = value;\n\t\t\t}\n\t\t\tif (value < i_list_min) {\n\t\t\t\ti_list_min = value;\n\t\t\t}\n\t\t}\n\n\t\tvar tmp_diff = Number(i_list_max) - Number(i_list_min)\n\n\t\tif (result_diff === -1) {\n\t\t\tresult_diff = tmp_diff\n\t\t\tcontinue\n\t\t}\n\n\t\tif (result_diff > tmp_diff) {\n\t\t\tresult_diff = tmp_diff\n\t\t}\n\t\t// console.log(i_list.length)\n\t\t// console.log([Number(i_list_max) , Number(i_list_min)])\n\t}\n\tconsole.log(result_diff)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "sample_input": "5 3\n10\n15\n11\n14\n12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03208", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1719, "cpu_time_ms": 64, "memory_kb": 17816}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s057158407", "group_id": "codeNet:p03208", "input_text": "function main(arg) {\n\targ = arg.trim().split(\"\\n\")\n\tvar h = arg;\n\tvar NK = arg.shift()\n\tNK = NK.split(\" \")\n\tvar N = NK[0]\n\tvar K = Number(NK[1])\n\n\tvar result_diff = -1\n\n\tfor (var i = 0; i < 2000000; i++) {\n\t\t//添字作り\n\t\tvar i_list = i.toString(h.length + 1)\n \n if (i_list.length > K) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (i_list.indexOf('0') !== -1) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i_list.length < K) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar tmp = i_list.split(\"\").filter(function (x, n, self) {\n return self.indexOf(x) === n && n !== self.lastIndexOf(x);\n });\n\n\t\tif (tmp.length > 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i_list !== i_list.split(\"\").sort().join(\"\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ti_list = i_list.split(\"\").map(e => Number(e))\n\n\t\tvar i_list_max = 0;\n\t\tvar i_list_min = 0;\n\t\t\n\t\tfor (var j = 0; j < i_list.length; j++) {\n\t\t\tvar value = h[i_list[j] - 1]\n\t\t\tif (j === 0) {\n\t\t\t\ti_list_max = i_list_min = value;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (value > i_list_max) {\n\t\t\t\ti_list_max = value;\n\t\t\t}\n\t\t\tif (value < i_list_min) {\n\t\t\t\ti_list_min = value;\n\t\t\t}\n\t\t}\n\n\t\tvar tmp_diff = Number(i_list_max) - Number(i_list_min)\n\n\t\tif (result_diff === -1) {\n\t\t\tresult_diff = tmp_diff\n\t\t\tcontinue\n\t\t}\n\n\t\tif (result_diff > tmp_diff) {\n\t\t\tresult_diff = tmp_diff\n\t\t}\n\t\t// console.log(i_list.length)\n\t\t// console.log([Number(i_list_max) , Number(i_list_min)])\n\t}\n\tconsole.log(result_diff)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1544325791, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03208.html", "problem_id": "p03208", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03208/input.txt", "sample_output_relpath": "derived/input_output/data/p03208/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03208/JavaScript/s057158407.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s057158407", "user_id": "u063969814"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function main(arg) {\n\targ = arg.trim().split(\"\\n\")\n\tvar h = arg;\n\tvar NK = arg.shift()\n\tNK = NK.split(\" \")\n\tvar N = NK[0]\n\tvar K = Number(NK[1])\n\n\tvar result_diff = -1\n\n\tfor (var i = 0; i < 2000000; i++) {\n\t\t//添字作り\n\t\tvar i_list = i.toString(h.length + 1)\n \n if (i_list.length > K) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (i_list.indexOf('0') !== -1) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i_list.length < K) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar tmp = i_list.split(\"\").filter(function (x, n, self) {\n return self.indexOf(x) === n && n !== self.lastIndexOf(x);\n });\n\n\t\tif (tmp.length > 0) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (i_list !== i_list.split(\"\").sort().join(\"\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ti_list = i_list.split(\"\").map(e => Number(e))\n\n\t\tvar i_list_max = 0;\n\t\tvar i_list_min = 0;\n\t\t\n\t\tfor (var j = 0; j < i_list.length; j++) {\n\t\t\tvar value = h[i_list[j] - 1]\n\t\t\tif (j === 0) {\n\t\t\t\ti_list_max = i_list_min = value;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (value > i_list_max) {\n\t\t\t\ti_list_max = value;\n\t\t\t}\n\t\t\tif (value < i_list_min) {\n\t\t\t\ti_list_min = value;\n\t\t\t}\n\t\t}\n\n\t\tvar tmp_diff = Number(i_list_max) - Number(i_list_min)\n\n\t\tif (result_diff === -1) {\n\t\t\tresult_diff = tmp_diff\n\t\t\tcontinue\n\t\t}\n\n\t\tif (result_diff > tmp_diff) {\n\t\t\tresult_diff = tmp_diff\n\t\t}\n\t\t// console.log(i_list.length)\n\t\t// console.log([Number(i_list_max) , Number(i_list_min)])\n\t}\n\tconsole.log(result_diff)\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "sample_input": "5 3\n10\n15\n11\n14\n12\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03208", "source_text": "Score : 300 points\n\nProblem Statement\n\nIn some other world, today is Christmas Eve.\n\nThere are N trees planted in Mr. Takaha's garden. The height of the i-th tree (1 \\leq i \\leq N) is h_i meters.\n\nHe decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the heights of the decorated trees should be as close to each other as possible.\n\nMore specifically, let the height of the tallest decorated tree be h_{max} meters, and the height of the shortest decorated tree be h_{min} meters. The smaller the value h_{max} - h_{min} is, the better. What is the minimum possible value of h_{max} - h_{min}?\n\nConstraints\n\n2 \\leq K < N \\leq 10^5\n\n1 \\leq h_i \\leq 10^9\n\nh_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nh_1\nh_2\n:\nh_N\n\nOutput\n\nPrint the minimum possible value of h_{max} - h_{min}.\n\nSample Input 1\n\n5 3\n10\n15\n11\n14\n12\n\nSample Output 1\n\n2\n\nIf we decorate the first, third and fifth trees, h_{max} = 12, h_{min} = 10 so h_{max} - h_{min} = 2. This is optimal.\n\nSample Input 2\n\n5 3\n5\n7\n5\n7\n7\n\nSample Output 2\n\n0\n\nIf we decorate the second, fourth and fifth trees, h_{max} = 7, h_{min} = 7 so h_{max} - h_{min} = 0. This is optimal.\n\nThere are not too many trees in these sample inputs, but note that there can be at most one hundred thousand trees (we just can't put a sample with a hundred thousand lines here).", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1413, "cpu_time_ms": 63, "memory_kb": 17560}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s421257501", "group_id": "codeNet:p03209", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0].split(\" \")[0]);\n var X = parseInt(input[0].split(\" \")[1]);\n bans=new Array(50);\n all=new Array(50);\n bans[0]=1;\n all[0]=1;\n var ans = 0;\n for(i=1;i<=50;i++){\n bans[i]=bans[i-1]*2+1;\n all[i]=all[i-1]*2+3;\n }\n var full=all[N];\n var bs=bans[N];\n var flag=0;\n if(X%2==0){\n X=all[N]-X;\n flag=1;\n }\n while(X>0&&full>0){\n\n if(X>(full-1)/2){\n X=X-(full-1)/2-1;\n ans=ans+(bs-1)/2+1;\n full=(full-1)/2-1;\n bs=(bs-1)/2\n }else{\n X=X-1;\n full=(full-1)/2-1;\n bs=(bs-1)/2\n }\n }\n if(flag==1){\n ans=bans[N]-ans;\n }\n console.log('%s', ans);\n}\n \n// \"実行する\"ボタンを押した時に実行される関数 (デバッグ用)\nfunction debug(){\n var input = document.getElementById(\"input\").value;\n Main(input);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1544333760, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03209.html", "problem_id": "p03209", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03209/input.txt", "sample_output_relpath": "derived/input_output/data/p03209/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03209/JavaScript/s421257501.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s421257501", "user_id": "u221230011"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n var N = parseInt(input[0].split(\" \")[0]);\n var X = parseInt(input[0].split(\" \")[1]);\n bans=new Array(50);\n all=new Array(50);\n bans[0]=1;\n all[0]=1;\n var ans = 0;\n for(i=1;i<=50;i++){\n bans[i]=bans[i-1]*2+1;\n all[i]=all[i-1]*2+3;\n }\n var full=all[N];\n var bs=bans[N];\n var flag=0;\n if(X%2==0){\n X=all[N]-X;\n flag=1;\n }\n while(X>0&&full>0){\n\n if(X>(full-1)/2){\n X=X-(full-1)/2-1;\n ans=ans+(bs-1)/2+1;\n full=(full-1)/2-1;\n bs=(bs-1)/2\n }else{\n X=X-1;\n full=(full-1)/2-1;\n bs=(bs-1)/2\n }\n }\n if(flag==1){\n ans=bans[N]-ans;\n }\n console.log('%s', ans);\n}\n \n// \"実行する\"ボタンを押した時に実行される関数 (デバッグ用)\nfunction debug(){\n var input = document.getElementById(\"input\").value;\n Main(input);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "sample_input": "2 7\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03209", "source_text": "Score : 400 points\n\nProblem Statement\n\nIn some other world, today is Christmas.\n\nMr. Takaha decides to make a multi-dimensional burger in his party. A level-L burger (L is an integer greater than or equal to 0) is the following thing:\n\nA level-0 burger is a patty.\n\nA level-L burger (L \\geq 1) is a bun, a level-(L-1) burger, a patty, another level-(L-1) burger and another bun, stacked vertically in this order from the bottom.\n\nFor example, a level-1 burger and a level-2 burger look like BPPPB and BBPPPBPBPPPBB (rotated 90 degrees), where B and P stands for a bun and a patty.\n\nThe burger Mr. Takaha will make is a level-N burger. Lunlun the Dachshund will eat X layers from the bottom of this burger (a layer is a patty or a bun). How many patties will she eat?\n\nConstraints\n\n1 \\leq N \\leq 50\n\n1 \\leq X \\leq ( the total number of layers in a level-N burger )\n\nN and X are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN X\n\nOutput\n\nPrint the number of patties in the bottom-most X layers from the bottom of a level-N burger.\n\nSample Input 1\n\n2 7\n\nSample Output 1\n\n4\n\nThere are 4 patties in the bottom-most 7 layers of a level-2 burger (BBPPPBPBPPPBB).\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n0\n\nThe bottom-most layer of a level-1 burger is a bun.\n\nSample Input 3\n\n50 4321098765432109\n\nSample Output 3\n\n2160549382716056\n\nA level-50 burger is rather thick, to the extent that the number of its layers does not fit into a 32-bit integer.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 913, "cpu_time_ms": 233, "memory_kb": 21956}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s168427563", "group_id": "codeNet:p03210", "input_text": "\nfunction main(input){\n input=input.split(' ');\n x=parseInt(input[0],10)\n if (x==3 ||x==5 || x==7){\n console.log(\"YES\")\n }else{\n console.log(\"NO\")\n }\n\n\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1585723650, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/JavaScript/s168427563.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s168427563", "user_id": "u375695365"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "\nfunction main(input){\n input=input.split(' ');\n x=parseInt(input[0],10)\n if (x==3 ||x==5 || x==7){\n console.log(\"YES\")\n }else{\n console.log(\"NO\")\n }\n\n\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 239, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s095945082", "group_id": "codeNet:p03210", "input_text": "\"use strict\";\nconst input = Number(require(\"fs\").readFileSync(\"/dev/stdin\",\"UTF-8\").trim());\n\nif (input === 3 || input === 5 || input === 7) console.log(\"YES\");\nelse console.log(\"NO\");\n", "language": "JavaScript", "metadata": {"date": 1544826650, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/JavaScript/s095945082.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s095945082", "user_id": "u596824890"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "\"use strict\";\nconst input = Number(require(\"fs\").readFileSync(\"/dev/stdin\",\"UTF-8\").trim());\n\nif (input === 3 || input === 5 || input === 7) console.log(\"YES\");\nelse console.log(\"NO\");\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 185, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s895414526", "group_id": "codeNet:p03210", "input_text": "function Main(input) {\n if(input == 7 || input == 5 || input == 3) {\n console.log(\"YES\");\n } else {\n console.log(\"NO\");\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1543974233, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03210.html", "problem_id": "p03210", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03210/input.txt", "sample_output_relpath": "derived/input_output/data/p03210/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03210/JavaScript/s895414526.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s895414526", "user_id": "u643797323"}, "prompt_components": {"gold_output": "YES\n", "input_to_evaluate": "function Main(input) {\n if(input == 7 || input == 5 || input == 3) {\n console.log(\"YES\");\n } else {\n console.log(\"NO\");\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "sample_input": "5\n"}, "reference_outputs": ["YES\n"], "source_document_id": "p03210", "source_text": "Score : 100 points\n\nProblem Statement\n\nShichi-Go-San (literally \"Seven-Five-Three\") is a traditional event in a certain country to celebrate the growth of seven-, five- and three-year-old children.\n\nTakahashi is now X years old. Will his growth be celebrated in Shichi-Go-San this time?\n\nConstraints\n\n1 ≤ X ≤ 9\n\nX is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX\n\nOutput\n\nIf Takahashi's growth will be celebrated, print YES; if it will not, print NO.\n\nSample Input 1\n\n5\n\nSample Output 1\n\nYES\n\nThe growth of a five-year-old child will be celebrated.\n\nSample Input 2\n\n6\n\nSample Output 2\n\nNO\n\nSee you next year.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 189, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s372320884", "group_id": "codeNet:p03211", "input_text": "process.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar lines = []\nvar reader = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nreader.on('line', (line) => {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var N = lines[0];\n var diff = [];\n for(let i=0; i {\n lines.push(line);\n});\n\nreader.on('close', () => {\n var N = lines[0];\n var diff = [];\n for(let i=0; iNumber(a));case 5:return i.split(\"\\n\").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));}}\n\nfunction Main(input) {\n input = myconv(input,1);\n var primeCountList = {\n \t\"1\" : 1\n };\n for(var i = 1; i <= input; i++){\n var tmpI = i;\n var div = 2;\n while(tmpI != 1){\n if(tmpI % div == 0){\n if(primeCountList[div] == null){\n primeCountList[div] = 1;\n }else{\n primeCountList[div]++;\n }\n tmpI /= div;\n }else{\n div = (div == 2) ? div+1 : div+2;\n }\n }\n }\n //myout(primeCountList);\n var primeList = Object.keys(primeCountList);\n \n var result442 = 0;//P1^4,P2^4,P3^2\n var result242 = 0;//P1^24,P3^2\n var result144 = 0;//P1^14,P2^4,\n var result74 = 0;//P1^74\n var result2 = 0;\n var result4 = 0;\n var result14 = 0;\n var result24 = 0;\n var result74 = 0;\n for(var i = 0; i < primeList.length; i++){\n if(primeCountList[primeList[i]] >= 2){\n result2++;\n }\n if(primeCountList[primeList[i]] >= 4){\n result4++;\n }\n if(primeCountList[primeList[i]] >= 14){\n result14++;\n }\n if(primeCountList[primeList[i]] >= 24){\n result24++;\n }\n if(primeCountList[primeList[i]] >= 74){\n result74++;\n }\n }\n result442 = (result4 * (result4 -1)) / 2 * (result2 -2);\n result242 = result24 * (result2 -1);\n result144 = result14 * (result4 -1);\n \n myout(result442 + result242 + result144 + result74);\n \n}\n\nfunction getPrimeFactorization(val){\n\tvar primeList = {\n\t\t\"1\" : 1\n\t};\n\tvar div = 2;\n\twhile(val != 1){\n\t\tif(val % div == 0){\n\t\t\tif(primeList[div] == null){\n\t\t\t\tprimeList[div] = 1;\n\t\t\t}else{\n\t\t\t\tprimeList[div]++;\n\t\t\t}\n\t\t\tval /= div;\n\t\t}else{\n\t\t\tdiv = (div == 2) ? div+1 : div+2;\n\t\t}\n }\n return primeList;\n}\n\nfor(var i = 1; i <= 10; i++){\n //Main(i);\n}\n\nMain(myin());\n", "language": "JavaScript", "metadata": {"date": 1576301244, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03213.html", "problem_id": "p03213", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03213/input.txt", "sample_output_relpath": "derived/input_output/data/p03213/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03213/JavaScript/s818408790.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s818408790", "user_id": "u222822036"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "function myin(){return require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim();}\nfunction myout(t){console.log(t);}//standard output\nfunction myerr(t){console.log(t);}//standard error\n//[no]param\n//0:何もしない 1:数値へ変換 2:半角SPで分割 3:改行で分割 4:半角SPで分割し、数値配列へ\n//5:改行で分割し、数値配列へ 6:1文字に分割 7:1文字に分割し、数値配列へ\nfunction myconv(i,no){switch(no){case 0:return i;case 1:return parseInt(i);case 2:return i.split(\" \");case 3:return i.split(\"\\n\");case 4:return i.split(\" \").map((a)=>Number(a));case 5:return i.split(\"\\n\").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));}}\n\nfunction Main(input) {\n input = myconv(input,1);\n var primeCountList = {\n \t\"1\" : 1\n };\n for(var i = 1; i <= input; i++){\n var tmpI = i;\n var div = 2;\n while(tmpI != 1){\n if(tmpI % div == 0){\n if(primeCountList[div] == null){\n primeCountList[div] = 1;\n }else{\n primeCountList[div]++;\n }\n tmpI /= div;\n }else{\n div = (div == 2) ? div+1 : div+2;\n }\n }\n }\n //myout(primeCountList);\n var primeList = Object.keys(primeCountList);\n \n var result442 = 0;//P1^4,P2^4,P3^2\n var result242 = 0;//P1^24,P3^2\n var result144 = 0;//P1^14,P2^4,\n var result74 = 0;//P1^74\n var result2 = 0;\n var result4 = 0;\n var result14 = 0;\n var result24 = 0;\n var result74 = 0;\n for(var i = 0; i < primeList.length; i++){\n if(primeCountList[primeList[i]] >= 2){\n result2++;\n }\n if(primeCountList[primeList[i]] >= 4){\n result4++;\n }\n if(primeCountList[primeList[i]] >= 14){\n result14++;\n }\n if(primeCountList[primeList[i]] >= 24){\n result24++;\n }\n if(primeCountList[primeList[i]] >= 74){\n result74++;\n }\n }\n result442 = (result4 * (result4 -1)) / 2 * (result2 -2);\n result242 = result24 * (result2 -1);\n result144 = result14 * (result4 -1);\n \n myout(result442 + result242 + result144 + result74);\n \n}\n\nfunction getPrimeFactorization(val){\n\tvar primeList = {\n\t\t\"1\" : 1\n\t};\n\tvar div = 2;\n\twhile(val != 1){\n\t\tif(val % div == 0){\n\t\t\tif(primeList[div] == null){\n\t\t\t\tprimeList[div] = 1;\n\t\t\t}else{\n\t\t\t\tprimeList[div]++;\n\t\t\t}\n\t\t\tval /= div;\n\t\t}else{\n\t\t\tdiv = (div == 2) ? div+1 : div+2;\n\t\t}\n }\n return primeList;\n}\n\nfor(var i = 1; i <= 10; i++){\n //Main(i);\n}\n\nMain(myin());\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 2435, "cpu_time_ms": 54, "memory_kb": 7628}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s315770553", "group_id": "codeNet:p03213", "input_text": "\"use strict\";\nfunction main(input) {\n const inputs = input.split(\"\\n\").filter(x => x !== \"\");\n let N = Number(inputs[0]);\n\n function resolve(n) {\n let result = Array(n + 1).fill(0);\n for (let i = 2; i <= n; i++) {\n let cur = i;\n for (let j = 2; j <= i; j++) {\n while (cur % j === 0) {\n result[j] += 1;\n cur = cur / j;\n }\n }\n }\n return result;\n }\n\n function findLargerThan(num, array) {\n return array.filter(element => element >= num).length;\n }\n\n function combination(numA, numB) {\n let result = 1;\n for (let i = numA; i > numA - numB; i = i - 1) {\n result = result * i;\n }\n\n for (let i = numB; i > 0; i = i - 1) {\n result = result / i;\n }\n return result;\n }\n\n let result = resolve(N);\n\n let l74 = findLargerThan(74, result);\n let l24 = findLargerThan(24, result);\n let l14 = findLargerThan(14, result);\n let l4 = findLargerThan(4, result);\n let l2 = findLargerThan(2, result);\n\n let r5x5x3 = (l4 * (l4 - 1) * (l2 - 2)) / 2;\n let r15x5 = l14 * (l4 - 1);\n let r25x3 = l24 * (l2 - 1);\n let r75 = l74;\n\n console.log(\n l74 + l24 * (l2 - 1) + l14 * (l4 - 1) + (l4 * (l4 - 1) * (l2 - 2)) / 2\n );\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1545615793, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03213.html", "problem_id": "p03213", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03213/input.txt", "sample_output_relpath": "derived/input_output/data/p03213/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03213/JavaScript/s315770553.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s315770553", "user_id": "u439911726"}, "prompt_components": {"gold_output": "0\n", "input_to_evaluate": "\"use strict\";\nfunction main(input) {\n const inputs = input.split(\"\\n\").filter(x => x !== \"\");\n let N = Number(inputs[0]);\n\n function resolve(n) {\n let result = Array(n + 1).fill(0);\n for (let i = 2; i <= n; i++) {\n let cur = i;\n for (let j = 2; j <= i; j++) {\n while (cur % j === 0) {\n result[j] += 1;\n cur = cur / j;\n }\n }\n }\n return result;\n }\n\n function findLargerThan(num, array) {\n return array.filter(element => element >= num).length;\n }\n\n function combination(numA, numB) {\n let result = 1;\n for (let i = numA; i > numA - numB; i = i - 1) {\n result = result * i;\n }\n\n for (let i = numB; i > 0; i = i - 1) {\n result = result / i;\n }\n return result;\n }\n\n let result = resolve(N);\n\n let l74 = findLargerThan(74, result);\n let l24 = findLargerThan(24, result);\n let l14 = findLargerThan(14, result);\n let l4 = findLargerThan(4, result);\n let l2 = findLargerThan(2, result);\n\n let r5x5x3 = (l4 * (l4 - 1) * (l2 - 2)) / 2;\n let r15x5 = l14 * (l4 - 1);\n let r25x3 = l24 * (l2 - 1);\n let r75 = l74;\n\n console.log(\n l74 + l24 * (l2 - 1) + l14 * (l4 - 1) + (l4 * (l4 - 1) * (l2 - 2)) / 2\n );\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "sample_input": "9\n"}, "reference_outputs": ["0\n"], "source_document_id": "p03213", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given an integer N. Among the divisors of N! (= 1 \\times 2 \\times ... \\times N), how many Shichi-Go numbers (literally \"Seven-Five numbers\") are there?\n\nHere, a Shichi-Go number is a positive integer that has exactly 75 divisors.\n\nNote\n\nWhen a positive integer A divides a positive integer B, A is said to a divisor of B.\nFor example, 6 has four divisors: 1, 2, 3 and 6.\n\nConstraints\n\n1 \\leq N \\leq 100\n\nN is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the number of the Shichi-Go numbers that are divisors of N!.\n\nSample Input 1\n\n9\n\nSample Output 1\n\n0\n\nThere are no Shichi-Go numbers among the divisors of 9! = 1 \\times 2 \\times ... \\times 9 = 362880.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n1\n\nThere is one Shichi-Go number among the divisors of 10! = 3628800: 32400.\n\nSample Input 3\n\n100\n\nSample Output 3\n\n543", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1262, "cpu_time_ms": 217, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s492725301", "group_id": "codeNet:p03215", "input_text": "function main(input){\n var lines = input.replace('\\n',' ');\n lines = lines.split(\" \");\n var N = Number(lines[0]);\n var K = Number(lines[1]);\n lines.splice(0,2);\n\n var utu=[K];\n\n var max=0;\n var mem=0;\n var w=0;\n for (var i=0;i=0){\n \t\tfor (var u=i;u=0){\n \t\tfor (var u=i;u Number(n));\n let tmpary = [];\n for (let i = 0; i < N; i++) {\n let tmp = 0;\n for (let j = i; j < N; j++) {\n tmp += A[j];\n tmpary.push(tmp);\n }\n }\n tmpary.sort((a, b) => b - a);\n let ans = [];\n for (let i = 0; i <= N - K; i++) {\n ans[i] = tmpary[i];\n for (let j = i; j < K; j++) {\n ans[i] = ans[i] & tmpary[j];\n }\n }\n ans.sort((a, b) => b - a);\n console.log(ans[0]);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1543111001, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03215.html", "problem_id": "p03215", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03215/input.txt", "sample_output_relpath": "derived/input_output/data/p03215/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03215/JavaScript/s181308594.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s181308594", "user_id": "u107881102"}, "prompt_components": {"gold_output": "12\n", "input_to_evaluate": "'use strict';\n\nfunction Main(INPUT) {\n const input = INPUT.split(\"\\n\");\n const N = Number(input[0].split(\" \")[0]);\n let K = Number(input[0].split(\" \")[1]);\n const A = input[1].split(\" \").map(n => Number(n));\n let tmpary = [];\n for (let i = 0; i < N; i++) {\n let tmp = 0;\n for (let j = i; j < N; j++) {\n tmp += A[j];\n tmpary.push(tmp);\n }\n }\n tmpary.sort((a, b) => b - a);\n let ans = [];\n for (let i = 0; i <= N - K; i++) {\n ans[i] = tmpary[i];\n for (let j = i; j < K; j++) {\n ans[i] = ans[i] & tmpary[j];\n }\n }\n ans.sort((a, b) => b - a);\n console.log(ans[0]);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input are integers\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "sample_input": "4 2\n2 5 2 5\n"}, "reference_outputs": ["12\n"], "source_document_id": "p03215", "source_text": "Score : 400 points\n\nProblem Statement\n\nOne day, Niwango-kun, an employee of Dwango Co., Ltd., found an integer sequence (a_1, ..., a_N) of length N.\nHe is interested in properties of the sequence a.\n\nFor a nonempty contiguous subsequence a_l, ..., a_r (1 \\leq l \\leq r \\leq N) of the sequence a, its beauty is defined as a_l + ... + a_r. Niwango-kun wants to know the maximum possible value of the bitwise AND of the beauties of K nonempty contiguous subsequences among all N(N+1)/2 nonempty contiguous subsequences. (Subsequences may share elements.)\n\nFind the maximum possible value for him.\n\nConstraints\n\n2 \\leq N \\leq 1000\n\n1 \\leq a_i \\leq 10^9\n\n1 \\leq K \\leq N(N+1)/2\n\nAll numbers given in input are integers\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\na_1 a_2 ... a_N\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n2 5 2 5\n\nSample Output 1\n\n12\n\nThere are 10 nonempty contiguous subsequences of a. Let us enumerate them:\n\ncontiguous subsequences starting from the first element: \\{2\\}, \\{2, 5\\}, \\{2, 5, 2\\}, \\{2, 5, 2, 5\\}\n\ncontiguous subsequences starting from the second element: \\{5\\}, \\{5, 2\\}, \\{5, 2, 5\\}\n\ncontiguous subsequences starting from the third element: \\{2\\}, \\{2, 5\\}\n\ncontiguous subsequences starting from the fourth element: \\{5\\}\n\n(Note that even if the elements of subsequences are equal, subsequences that have different starting indices are considered to be different.)\n\nThe maximum possible bitwise AND of the beauties of two different contiguous subsequences is 12.\nThis can be achieved by choosing \\{5, 2, 5\\} (with beauty 12) and \\{2, 5, 2, 5\\} (with beauty 14).\n\nSample Input 2\n\n8 4\n9 1 8 2 7 5 6 4\n\nSample Output 2\n\n32", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 734, "cpu_time_ms": 420, "memory_kb": 58232}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s746106343", "group_id": "codeNet:p03219", "input_text": "var lines = []; var result = Infinity;\nvar readline = require('readline');\n\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var X = Number(lines[0].split(\" \")[0]);\n var Y = Number(lines[0].split(\" \")[1]);\n\n result = X + Y / 2;\n console.log(result);\n});", "language": "JavaScript", "metadata": {"date": 1555883879, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03219/input.txt", "sample_output_relpath": "derived/input_output/data/p03219/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03219/JavaScript/s746106343.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s746106343", "user_id": "u266742706"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "var lines = []; var result = Infinity;\nvar readline = require('readline');\n\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var X = Number(lines[0].split(\" \")[0]);\n var Y = Number(lines[0].split(\" \")[1]);\n\n result = X + Y / 2;\n console.log(result);\n});", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "sample_input": "81 58\n"}, "reference_outputs": ["110\n"], "source_document_id": "p03219", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 395, "cpu_time_ms": 60, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s002570359", "group_id": "codeNet:p03219", "input_text": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.split(' ');\n\nconsole.log(Number(list[0]) + Number(list[1]) / 2);\n", "language": "JavaScript", "metadata": {"date": 1548619925, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03219.html", "problem_id": "p03219", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03219/input.txt", "sample_output_relpath": "derived/input_output/data/p03219/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03219/JavaScript/s002570359.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s002570359", "user_id": "u045368371"}, "prompt_components": {"gold_output": "110\n", "input_to_evaluate": "const input = require('fs').readFileSync('/dev/stdin', 'utf8');\n\nconst list = input.split(' ');\n\nconsole.log(Number(list[0]) + Number(list[1]) / 2);\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "sample_input": "81 58\n"}, "reference_outputs": ["110\n"], "source_document_id": "p03219", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a train going from Station A to Station B that costs X yen (the currency of Japan).\n\nAlso, there is a bus going from Station B to Station C that costs Y yen.\n\nJoisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A to Station B by train and then travels from Station B to Station C by bus.\n\nHow much does it cost to travel from Station A to Station C if she uses this ticket?\n\nConstraints\n\n1 \\leq X,Y \\leq 100\n\nY is an even number.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nX Y\n\nOutput\n\nIf it costs x yen to travel from Station A to Station C, print x.\n\nSample Input 1\n\n81 58\n\nSample Output 1\n\n110\n\nThe train fare is 81 yen.\n\nThe train fare is 58 ⁄ 2=29 yen with the 50% discount.\n\nThus, it costs 110 yen to travel from Station A to Station C.\n\nSample Input 2\n\n4 54\n\nSample Output 2\n\n31", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 149, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s292099609", "group_id": "codeNet:p03220", "input_text": "\"use strict\"\nconst create = () => {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\n\nconst temp = (T, x) => T-x*0.006\n\nconst Main = () => {\n const N = nextInt()\n const [T, A] = nextIntArray()\n const h = nextIntArray()\n let closest = Number.POSITIVE_INFINITY\n let idx = -1\n for(let i = 0; i {\n const input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\n const res = {\n \"list\": input, \"index\": 0, \"max\": input.length,\n \"hasNext\": function() {return this.index < this.max},\n \"next\": function() { if (!this.hasNext()) {throw \"ArrayIndexOutOfBoundsException\";}else{return this.list[this.index++];}}\n };\n return res;\n}\nconst o = create();\nconst next = () => o.next()\nconst nextInt = () => parseInt(o.next())\nconst nextStrArray = () => o.next().split(\" \")\nconst nextIntArray = () => o.next().split(\" \").map(el => parseInt(el))\nconst nextCharArray = () => o.next().split(\"\")\nconst hasNext = () => o.hasNext()\nconst myout = (...x) => console.log(...x)\n\nconst temp = (T, x) => T-x*0.006\n\nconst Main = () => {\n const N = nextInt()\n const [T, A] = nextIntArray()\n const h = nextIntArray()\n let closest = Number.POSITIVE_INFINITY\n let idx = -1\n for(let i = 0; i Number(n));\n let ans = 1;\n\n for (let i = 1; i < H.length; i++) {\n if (Math.abs(A - (T - H[i] * 0.006)) < Math.abs(A - (T - H[i - 1] * 0.006))) {\n ans = i + 1;\n }\n }\n console.log(ans);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1541383838, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03220.html", "problem_id": "p03220", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03220/input.txt", "sample_output_relpath": "derived/input_output/data/p03220/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03220/JavaScript/s394901639.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s394901639", "user_id": "u107881102"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "'use strict';\n\nfunction Main(INPUT) {\n const input = INPUT.split(\"\\n\");\n const N = Number(input[0]);\n const T = Number(input[1].split(\" \")[0]);\n const A = Number(input[1].split(\" \")[1]);\n const H = input[2].split(\" \").map(n => Number(n));\n let ans = 1;\n\n for (let i = 1; i < H.length; i++) {\n if (Math.abs(A - (T - H[i] * 0.006)) < Math.abs(A - (T - H[i - 1] * 0.006))) {\n ans = i + 1;\n }\n }\n console.log(ans);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "sample_input": "2\n12 5\n1000 2000\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03220", "source_text": "Score: 200 points\n\nProblem Statement\n\nA country decides to build a palace.\n\nIn this country, the average temperature of a point at an elevation of x meters is T-x \\times 0.006 degrees Celsius.\n\nThere are N places proposed for the place. The elevation of Place i is H_i meters.\n\nAmong them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.\n\nPrint the index of the place where the palace should be built.\n\nIt is guaranteed that the solution is unique.\n\nConstraints\n\n1 \\leq N \\leq 1000\n\n0 \\leq T \\leq 50\n\n-60 \\leq A \\leq T\n\n0 \\leq H_i \\leq 10^5\n\nAll values in input are integers.\n\nThe solution is unique.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nT A\nH_1 H_2 ... H_N\n\nOutput\n\nPrint the index of the place where the palace should be built.\n\nSample Input 1\n\n2\n12 5\n1000 2000\n\nSample Output 1\n\n1\n\nThe average temperature of Place 1 is 12-1000 \\times 0.006=6 degrees Celsius.\n\nThe average temperature of Place 2 is 12-2000 \\times 0.006=0 degrees Celsius.\n\nThus, the palace should be built at Place 1.\n\nSample Input 2\n\n3\n21 -11\n81234 94124 52141\n\nSample Output 2\n\n3", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 522, "cpu_time_ms": 1059, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s101455870", "group_id": "codeNet:p03221", "input_text": "'use strict'\nfunction main(input) {\n input = input.trim().split('\\n')\n input.shift()\n let count = []\n input = input\n .map(c => {\n let arr = c.split(' ').map(w => w - 0)\n if (count[arr[0]] === undefined) count[arr[0]] = []\n count[arr[0]].push(arr[1])\n return arr\n })\n count.forEach(v => v.sort((a, b) => a - b))\n input = input.map(c => {\n let id = ('000000' + c[0]).slice(-6)\n id += ('000000' + (count[c[0]].indexOf(c[1]) + 1)).slice(-6)\n console.log(id)\n })\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1561601847, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/JavaScript/s101455870.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s101455870", "user_id": "u621374656"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "'use strict'\nfunction main(input) {\n input = input.trim().split('\\n')\n input.shift()\n let count = []\n input = input\n .map(c => {\n let arr = c.split(' ').map(w => w - 0)\n if (count[arr[0]] === undefined) count[arr[0]] = []\n count[arr[0]].push(arr[1])\n return arr\n })\n count.forEach(v => v.sort((a, b) => a - b))\n input = input.map(c => {\n let id = ('000000' + c[0]).slice(-6)\n id += ('000000' + (count[c[0]].indexOf(c[1]) + 1)).slice(-6)\n console.log(id)\n })\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 558, "cpu_time_ms": 2110, "memory_kb": 73736}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s870196750", "group_id": "codeNet:p03221", "input_text": "parcelRequire=function(e,r,t,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,u=\"function\"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&\"string\"==typeof t)return u(t);var c=new Error(\"Cannot find module '\"+t+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;ct?-1:1,a=new Array(r*(t-n)+1),e=n,o=0;e!==t;)a[o++]=e,e+=r;return a[o]=e,a}},n.length=function(n){return n.length},n.indexImpl=function(n){return function(t){return function(r){return function(a){return a<0||a>=r.length?t:n(r[a])}}}},n.slice=function(n){return function(t){return function(r){return r.slice(n,t)}}},n.drop=function(n){return function(t){return n<1?t:t.slice(n)}},n.zipWith=function(n){return function(t){return function(r){for(var a=t.length=r.length(c))return a.pure(n.Monad0().Applicative0())(new o.Done(u));if(i.otherwise)return e.bind(n.Monad0().Bind1())(t(u)(f()(c)(l)))(function(t){return a.pure(n.Monad0().Applicative0())(new o.Loop({a:t,b:l+1|0}))});throw new Error(\"Failed pattern match at Data.Array (line 1099, column 3 - line 1103, column 42): \"+[u.constructor.name,l.constructor.name])}})(u)(0)}}}},t.unsafeIndex=f,t.drop=r.drop}(n[\"Data.Array\"]=n[\"Data.Array\"]||{}),function(t){\"use strict\";(n[\"Data.Int\"]=n[\"Data.Int\"]||{}).fromStringAsImpl=function(n){return function(t){return function(r){var a;a=r<11?\"[0-\"+(r-1).toString()+\"]\":11===r?\"[0-9a]\":\"[0-9a-\"+String.fromCharCode(86+r)+\"]\";var e=new RegExp(\"^[\\\\+\\\\-]?\"+a+\"+$\",\"i\");return function(a){if(e.test(a)){var o=parseInt(a,r);return(0|o)===o?n(o):t}return t}}}}}(),function(t){\"use strict\";var r=n[\"Data.Int\"],a=(n[\"Control.Category\"],n[\"Control.Semigroupoid\"],n[\"Data.Boolean\"],n[\"Data.Bounded\"],n[\"Data.CommutativeRing\"],n[\"Data.DivisionRing\"],n[\"Data.Eq\"],n[\"Data.EuclideanRing\"],n[\"Data.HeytingAlgebra\"],n[\"Data.Int.Bits\"],n[\"Data.Maybe\"]),e=(n[\"Data.Ord\"],n[\"Data.Ordering\"],n[\"Data.Ring\"],n[\"Data.Semiring\"],n[\"Data.Show\"],n.Global,n.Math,n.Prelude,r.fromStringAsImpl(a.Just.create)(a.Nothing.value)),o=e(10);t.fromString=o,t.fromStringAs=e}(n[\"Data.Int\"]=n[\"Data.Int\"]||{}),function(t){\"use strict\";(n[\"Data.String.CodeUnits\"]=n[\"Data.String.CodeUnits\"]||{}).length=function(n){return n.length}}(),function(t){\"use strict\";var r=n[\"Data.String.CodeUnits\"];n[\"Control.Semigroupoid\"],n[\"Data.Boolean\"],n[\"Data.Eq\"],n[\"Data.Function\"],n[\"Data.HeytingAlgebra\"],n[\"Data.Maybe\"],n[\"Data.Ord\"],n[\"Data.Ring\"],n[\"Data.Semiring\"],n[\"Data.String.Pattern\"],n[\"Data.String.Unsafe\"],n.Prelude;t.length=r.length}(n[\"Data.String.CodeUnits\"]=n[\"Data.String.CodeUnits\"]||{}),function(n){\"use strict\";n.split=function(n){return function(t){return t.split(n)}},n.trim=function(n){return n.trim()},n.joinWith=function(n){return function(t){return t.join(n)}}}(n[\"Data.String.Common\"]=n[\"Data.String.Common\"]||{}),function(t){\"use strict\";var r=n[\"Data.String.Common\"];n[\"Data.Eq\"],n[\"Data.Ordering\"],n[\"Data.String.Pattern\"],n.Prelude;t.split=r.split,t.trim=r.trim,t.joinWith=r.joinWith}(n[\"Data.String.Common\"]=n[\"Data.String.Common\"]||{}),function(t){\"use strict\";var r=n[\"Control.Applicative\"],a=n[\"Control.Bind\"],e=(n[\"Control.Monad.ST\"],n[\"Control.Monad.ST.Internal\"]),o=n[\"Data.Array\"],i=n[\"Data.Array.ST\"],u=n[\"Data.Either\"],c=(n[\"Data.Eq\"],n[\"Data.Functor\"]),f=n[\"Data.Int\"],l=n[\"Data.Maybe\"],s=n[\"Data.Ord\"],d=n[\"Data.Ordering\"],p=(n[\"Data.Ring\"],n[\"Data.Semigroup\"],n[\"Data.Semiring\"],n[\"Data.Show\"]),D=(n[\"Data.String\"],n[\"Data.String.CodeUnits\"]),m=n[\"Data.String.Common\"],h=(n[\"Data.String.Pattern\"],n[\"Partial.Unsafe\"]),C=(n.Prelude,function(n){var t=m.split(\"\\n\")(m.trim(n));return a.bind(u.bindEither)(u.note(\"n m\")(a.bind(l.bindMaybe)(o.head(t))(function(n){var t=o.mapMaybe(f.fromString)(m.split(\" \")(n));return 2===t.length?new l.Just({n:t[0],m:t[1]}):l.Nothing.value})))(function(n){var a=o.mapMaybe(function(n){var t=o.mapMaybe(f.fromString)(m.split(\" \")(n));return 2===t.length?new l.Just({p:t[0],y:t[1]}):l.Nothing.value})(o.drop(1)(t));return r.pure(u.applicativeEither)(m.joinWith(\"\\n\")((n.n,function(n){return function(n){var t,r,a,u,f=function(n){var t=p.show(p.showInt)(n),r=D.length(t);return 0===r?\"000000\":1===r?\"00000\"+t:2===r?\"0000\"+t:3===r?\"000\"+t:4===r?\"00\"+t:5===r?\"0\"+t:t};return t=i.unsafeThaw(o.mapWithIndex(function(n){return function(t){return{p:t.p,y:t.y,i:n}}})(n))(),i.sortBy(function(n){return function(t){var r=s.compare(s.ordInt)(n.p)(t.p);if(r instanceof d.LT)return d.LT.value;if(r instanceof d.GT)return d.GT.value;if(r instanceof d.EQ)return s.compare(s.ordInt)(n.y)(t.y);throw new Error(\"Failed pattern match at AtCoder.ABC113.C (line 58, column 9 - line 61, column 30): \"+[r.constructor.name])}})(t)(),r=i.unsafeFreeze(t)(),a=i.empty(),o.foldRecM(e.monadRecST)(function(n){return function(t){var r=(n[\"p'\"]!==t.p?0:n.x)+1|0;return function(){return i.push({s:f(t.p)+f(r),i:t.i})(a)(),{\"p'\":t.p,x:r}}}})({\"p'\":-1,x:0})(r)(),i.sortWith(s.ordInt)(function(n){return n.i})(a)(),u=i.unsafeFreeze(a)(),c.map(c.functorArray)(function(n){return n.s})(u)}})(n.m)(a)))})});t.solve=function(n){var t=C(n);if(t instanceof u.Left)return h.unsafeCrashWith(t.value0);if(t instanceof u.Right)return t.value0;throw new Error(\"Failed pattern match at AtCoder.ABC113.C (line 20, column 3 - line 22, column 24): \"+[t.constructor.name])}}(n[\"AtCoder.ABC113.C\"]=n[\"AtCoder.ABC113.C\"]||{}),function(t){\"use strict\";(n[\"Effect.Console\"]=n[\"Effect.Console\"]||{}).log=function(n){return function(){return console.log(n),{}}}}(),function(t){\"use strict\";var r=n[\"Effect.Console\"];n[\"Data.Show\"],n[\"Data.Unit\"],n.Effect;t.log=r.log}(n[\"Effect.Console\"]=n[\"Effect.Console\"]||{}),function(t){\"use strict\";n[\"Node.Encoding\"];var r=n[\"Data.Show\"],a=(n.Prelude,function(){function n(){}return n.value=new n,n}()),e=function(){function n(){}return n.value=new n,n}(),o=function(){function n(){}return n.value=new n,n}(),i=function(){function n(){}return n.value=new n,n}(),u=function(){function n(){}return n.value=new n,n}(),c=function(){function n(){}return n.value=new n,n}(),f=function(){function n(){}return n.value=new n,n}(),l=function(){function n(){}return n.value=new n,n}(),s=new r.Show(function(n){if(n instanceof a)return\"ASCII\";if(n instanceof e)return\"UTF8\";if(n instanceof o)return\"UTF16LE\";if(n instanceof i)return\"UCS2\";if(n instanceof u)return\"Base64\";if(n instanceof c)return\"Latin1\";if(n instanceof f)return\"Binary\";if(n instanceof l)return\"Hex\";throw new Error(\"Failed pattern match at Node.Encoding (line 19, column 1 - line 19, column 39): \"+[n.constructor.name])});t.ASCII=a,t.UTF8=e,t.UTF16LE=o,t.UCS2=i,t.Base64=u,t.Latin1=c,t.Binary=f,t.Hex=l,t.showEncoding=s}(n[\"Node.Encoding\"]=n[\"Node.Encoding\"]||{}),function(t){\"use strict\";(n[\"Node.FS.Internal\"]=n[\"Node.FS.Internal\"]||{}).unsafeRequireFS=require(\"fs\")}(),function(t){\"use strict\";var r=n[\"Node.FS.Internal\"],a=(n.Effect,n.Prelude,n[\"Unsafe.Coerce\"].unsafeCoerce);t.mkEffect=a,t.unsafeRequireFS=r.unsafeRequireFS}(n[\"Node.FS.Internal\"]=n[\"Node.FS.Internal\"]||{}),function(t){\"use strict\";n[\"Control.Bind\"],n[\"Control.Semigroupoid\"],n[\"Data.DateTime\"],n[\"Data.DateTime.Instant\"],n[\"Data.EuclideanRing\"],n[\"Data.Function\"],n[\"Data.Function.Uncurried\"],n[\"Data.Functor\"],n[\"Data.Int\"],n[\"Data.Maybe\"],n[\"Data.Nullable\"];var r=n[\"Data.Show\"],a=(n[\"Data.Time.Duration\"],n.Effect,n[\"Node.Buffer\"],n[\"Node.Encoding\"]),e=(n[\"Node.FS\"],n[\"Node.FS.Internal\"]),o=(n[\"Node.FS.Perms\"],n[\"Node.FS.Stats\"],n[\"Node.Path\"],n.Prelude,e.unsafeRequireFS);t.readTextFile=function(n){return function(t){return e.mkEffect(function(e){return o.readFileSync(t,{encoding:r.show(a.showEncoding)(n)})})}}}(n[\"Node.FS.Sync\"]=n[\"Node.FS.Sync\"]||{}),function(t){\"use strict\";var r=n[\"AtCoder.ABC113.C\"],a=(n[\"Control.Applicative\"],n[\"Control.Bind\"],n.Effect,n[\"Effect.Console\"]),e=n[\"Node.Encoding\"],o=n[\"Node.FS.Sync\"];n.Prelude;t.main=function(){var n=o.readTextFile(e.UTF8.value)(\"/dev/stdin\")(),t=r.solve(n);return a.log(t)()}}(n.Main=n.Main||{}),n.Main.main();\n},{}]},{},[\"Focm\"], null)", "language": "JavaScript", "metadata": {"date": 1554915754, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03221.html", "problem_id": "p03221", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03221/input.txt", "sample_output_relpath": "derived/input_output/data/p03221/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03221/JavaScript/s870196750.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s870196750", "user_id": "u104378891"}, "prompt_components": {"gold_output": "000001000002\n000002000001\n000001000001\n", "input_to_evaluate": "parcelRequire=function(e,r,t,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,u=\"function\"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&\"string\"==typeof t)return u(t);var c=new Error(\"Cannot find module '\"+t+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;ct?-1:1,a=new Array(r*(t-n)+1),e=n,o=0;e!==t;)a[o++]=e,e+=r;return a[o]=e,a}},n.length=function(n){return n.length},n.indexImpl=function(n){return function(t){return function(r){return function(a){return a<0||a>=r.length?t:n(r[a])}}}},n.slice=function(n){return function(t){return function(r){return r.slice(n,t)}}},n.drop=function(n){return function(t){return n<1?t:t.slice(n)}},n.zipWith=function(n){return function(t){return function(r){for(var a=t.length=r.length(c))return a.pure(n.Monad0().Applicative0())(new o.Done(u));if(i.otherwise)return e.bind(n.Monad0().Bind1())(t(u)(f()(c)(l)))(function(t){return a.pure(n.Monad0().Applicative0())(new o.Loop({a:t,b:l+1|0}))});throw new Error(\"Failed pattern match at Data.Array (line 1099, column 3 - line 1103, column 42): \"+[u.constructor.name,l.constructor.name])}})(u)(0)}}}},t.unsafeIndex=f,t.drop=r.drop}(n[\"Data.Array\"]=n[\"Data.Array\"]||{}),function(t){\"use strict\";(n[\"Data.Int\"]=n[\"Data.Int\"]||{}).fromStringAsImpl=function(n){return function(t){return function(r){var a;a=r<11?\"[0-\"+(r-1).toString()+\"]\":11===r?\"[0-9a]\":\"[0-9a-\"+String.fromCharCode(86+r)+\"]\";var e=new RegExp(\"^[\\\\+\\\\-]?\"+a+\"+$\",\"i\");return function(a){if(e.test(a)){var o=parseInt(a,r);return(0|o)===o?n(o):t}return t}}}}}(),function(t){\"use strict\";var r=n[\"Data.Int\"],a=(n[\"Control.Category\"],n[\"Control.Semigroupoid\"],n[\"Data.Boolean\"],n[\"Data.Bounded\"],n[\"Data.CommutativeRing\"],n[\"Data.DivisionRing\"],n[\"Data.Eq\"],n[\"Data.EuclideanRing\"],n[\"Data.HeytingAlgebra\"],n[\"Data.Int.Bits\"],n[\"Data.Maybe\"]),e=(n[\"Data.Ord\"],n[\"Data.Ordering\"],n[\"Data.Ring\"],n[\"Data.Semiring\"],n[\"Data.Show\"],n.Global,n.Math,n.Prelude,r.fromStringAsImpl(a.Just.create)(a.Nothing.value)),o=e(10);t.fromString=o,t.fromStringAs=e}(n[\"Data.Int\"]=n[\"Data.Int\"]||{}),function(t){\"use strict\";(n[\"Data.String.CodeUnits\"]=n[\"Data.String.CodeUnits\"]||{}).length=function(n){return n.length}}(),function(t){\"use strict\";var r=n[\"Data.String.CodeUnits\"];n[\"Control.Semigroupoid\"],n[\"Data.Boolean\"],n[\"Data.Eq\"],n[\"Data.Function\"],n[\"Data.HeytingAlgebra\"],n[\"Data.Maybe\"],n[\"Data.Ord\"],n[\"Data.Ring\"],n[\"Data.Semiring\"],n[\"Data.String.Pattern\"],n[\"Data.String.Unsafe\"],n.Prelude;t.length=r.length}(n[\"Data.String.CodeUnits\"]=n[\"Data.String.CodeUnits\"]||{}),function(n){\"use strict\";n.split=function(n){return function(t){return t.split(n)}},n.trim=function(n){return n.trim()},n.joinWith=function(n){return function(t){return t.join(n)}}}(n[\"Data.String.Common\"]=n[\"Data.String.Common\"]||{}),function(t){\"use strict\";var r=n[\"Data.String.Common\"];n[\"Data.Eq\"],n[\"Data.Ordering\"],n[\"Data.String.Pattern\"],n.Prelude;t.split=r.split,t.trim=r.trim,t.joinWith=r.joinWith}(n[\"Data.String.Common\"]=n[\"Data.String.Common\"]||{}),function(t){\"use strict\";var r=n[\"Control.Applicative\"],a=n[\"Control.Bind\"],e=(n[\"Control.Monad.ST\"],n[\"Control.Monad.ST.Internal\"]),o=n[\"Data.Array\"],i=n[\"Data.Array.ST\"],u=n[\"Data.Either\"],c=(n[\"Data.Eq\"],n[\"Data.Functor\"]),f=n[\"Data.Int\"],l=n[\"Data.Maybe\"],s=n[\"Data.Ord\"],d=n[\"Data.Ordering\"],p=(n[\"Data.Ring\"],n[\"Data.Semigroup\"],n[\"Data.Semiring\"],n[\"Data.Show\"]),D=(n[\"Data.String\"],n[\"Data.String.CodeUnits\"]),m=n[\"Data.String.Common\"],h=(n[\"Data.String.Pattern\"],n[\"Partial.Unsafe\"]),C=(n.Prelude,function(n){var t=m.split(\"\\n\")(m.trim(n));return a.bind(u.bindEither)(u.note(\"n m\")(a.bind(l.bindMaybe)(o.head(t))(function(n){var t=o.mapMaybe(f.fromString)(m.split(\" \")(n));return 2===t.length?new l.Just({n:t[0],m:t[1]}):l.Nothing.value})))(function(n){var a=o.mapMaybe(function(n){var t=o.mapMaybe(f.fromString)(m.split(\" \")(n));return 2===t.length?new l.Just({p:t[0],y:t[1]}):l.Nothing.value})(o.drop(1)(t));return r.pure(u.applicativeEither)(m.joinWith(\"\\n\")((n.n,function(n){return function(n){var t,r,a,u,f=function(n){var t=p.show(p.showInt)(n),r=D.length(t);return 0===r?\"000000\":1===r?\"00000\"+t:2===r?\"0000\"+t:3===r?\"000\"+t:4===r?\"00\"+t:5===r?\"0\"+t:t};return t=i.unsafeThaw(o.mapWithIndex(function(n){return function(t){return{p:t.p,y:t.y,i:n}}})(n))(),i.sortBy(function(n){return function(t){var r=s.compare(s.ordInt)(n.p)(t.p);if(r instanceof d.LT)return d.LT.value;if(r instanceof d.GT)return d.GT.value;if(r instanceof d.EQ)return s.compare(s.ordInt)(n.y)(t.y);throw new Error(\"Failed pattern match at AtCoder.ABC113.C (line 58, column 9 - line 61, column 30): \"+[r.constructor.name])}})(t)(),r=i.unsafeFreeze(t)(),a=i.empty(),o.foldRecM(e.monadRecST)(function(n){return function(t){var r=(n[\"p'\"]!==t.p?0:n.x)+1|0;return function(){return i.push({s:f(t.p)+f(r),i:t.i})(a)(),{\"p'\":t.p,x:r}}}})({\"p'\":-1,x:0})(r)(),i.sortWith(s.ordInt)(function(n){return n.i})(a)(),u=i.unsafeFreeze(a)(),c.map(c.functorArray)(function(n){return n.s})(u)}})(n.m)(a)))})});t.solve=function(n){var t=C(n);if(t instanceof u.Left)return h.unsafeCrashWith(t.value0);if(t instanceof u.Right)return t.value0;throw new Error(\"Failed pattern match at AtCoder.ABC113.C (line 20, column 3 - line 22, column 24): \"+[t.constructor.name])}}(n[\"AtCoder.ABC113.C\"]=n[\"AtCoder.ABC113.C\"]||{}),function(t){\"use strict\";(n[\"Effect.Console\"]=n[\"Effect.Console\"]||{}).log=function(n){return function(){return console.log(n),{}}}}(),function(t){\"use strict\";var r=n[\"Effect.Console\"];n[\"Data.Show\"],n[\"Data.Unit\"],n.Effect;t.log=r.log}(n[\"Effect.Console\"]=n[\"Effect.Console\"]||{}),function(t){\"use strict\";n[\"Node.Encoding\"];var r=n[\"Data.Show\"],a=(n.Prelude,function(){function n(){}return n.value=new n,n}()),e=function(){function n(){}return n.value=new n,n}(),o=function(){function n(){}return n.value=new n,n}(),i=function(){function n(){}return n.value=new n,n}(),u=function(){function n(){}return n.value=new n,n}(),c=function(){function n(){}return n.value=new n,n}(),f=function(){function n(){}return n.value=new n,n}(),l=function(){function n(){}return n.value=new n,n}(),s=new r.Show(function(n){if(n instanceof a)return\"ASCII\";if(n instanceof e)return\"UTF8\";if(n instanceof o)return\"UTF16LE\";if(n instanceof i)return\"UCS2\";if(n instanceof u)return\"Base64\";if(n instanceof c)return\"Latin1\";if(n instanceof f)return\"Binary\";if(n instanceof l)return\"Hex\";throw new Error(\"Failed pattern match at Node.Encoding (line 19, column 1 - line 19, column 39): \"+[n.constructor.name])});t.ASCII=a,t.UTF8=e,t.UTF16LE=o,t.UCS2=i,t.Base64=u,t.Latin1=c,t.Binary=f,t.Hex=l,t.showEncoding=s}(n[\"Node.Encoding\"]=n[\"Node.Encoding\"]||{}),function(t){\"use strict\";(n[\"Node.FS.Internal\"]=n[\"Node.FS.Internal\"]||{}).unsafeRequireFS=require(\"fs\")}(),function(t){\"use strict\";var r=n[\"Node.FS.Internal\"],a=(n.Effect,n.Prelude,n[\"Unsafe.Coerce\"].unsafeCoerce);t.mkEffect=a,t.unsafeRequireFS=r.unsafeRequireFS}(n[\"Node.FS.Internal\"]=n[\"Node.FS.Internal\"]||{}),function(t){\"use strict\";n[\"Control.Bind\"],n[\"Control.Semigroupoid\"],n[\"Data.DateTime\"],n[\"Data.DateTime.Instant\"],n[\"Data.EuclideanRing\"],n[\"Data.Function\"],n[\"Data.Function.Uncurried\"],n[\"Data.Functor\"],n[\"Data.Int\"],n[\"Data.Maybe\"],n[\"Data.Nullable\"];var r=n[\"Data.Show\"],a=(n[\"Data.Time.Duration\"],n.Effect,n[\"Node.Buffer\"],n[\"Node.Encoding\"]),e=(n[\"Node.FS\"],n[\"Node.FS.Internal\"]),o=(n[\"Node.FS.Perms\"],n[\"Node.FS.Stats\"],n[\"Node.Path\"],n.Prelude,e.unsafeRequireFS);t.readTextFile=function(n){return function(t){return e.mkEffect(function(e){return o.readFileSync(t,{encoding:r.show(a.showEncoding)(n)})})}}}(n[\"Node.FS.Sync\"]=n[\"Node.FS.Sync\"]||{}),function(t){\"use strict\";var r=n[\"AtCoder.ABC113.C\"],a=(n[\"Control.Applicative\"],n[\"Control.Bind\"],n.Effect,n[\"Effect.Console\"]),e=n[\"Node.Encoding\"],o=n[\"Node.FS.Sync\"];n.Prelude;t.main=function(){var n=o.readTextFile(e.UTF8.value)(\"/dev/stdin\")(),t=r.solve(n);return a.log(t)()}}(n.Main=n.Main||{}),n.Main.main();\n},{}]},{},[\"Focm\"], null)", "problem_context": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "sample_input": "2 3\n1 32\n2 63\n1 12\n"}, "reference_outputs": ["000001000002\n000002000001\n000001000001\n"], "source_document_id": "p03221", "source_text": "Score: 300 points\n\nProblem Statement\n\nIn Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures.\n\nCity i is established in year Y_i and belongs to Prefecture P_i.\n\nYou can assume that there are no multiple cities that are established in the same year.\n\nIt is decided to allocate a 12-digit ID number to each city.\n\nIf City i is the x-th established city among the cities that belong to Prefecture i, the first six digits of the ID number of City i is P_i, and the last six digits of the ID number is x.\n\nHere, if P_i or x (or both) has less than six digits, zeros are added to the left until it has six digits.\n\nFind the ID numbers for all the cities.\n\nNote that there can be a prefecture with no cities.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq P_i \\leq N\n\n1 \\leq Y_i \\leq 10^9\n\nY_i are all different.\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\nP_1 Y_1\n:\nP_M Y_M\n\nOutput\n\nPrint the ID numbers for all the cities, in ascending order of indices (City 1, City 2, ...).\n\nSample Input 1\n\n2 3\n1 32\n2 63\n1 12\n\nSample Output 1\n\n000001000002\n000002000001\n000001000001\n\nAs City 1 is the second established city among the cities that belong to Prefecture 1, its ID number is 000001000002.\n\nAs City 2 is the first established city among the cities that belong to Prefecture 2, its ID number is 000002000001.\n\nAs City 3 is the first established city among the cities that belong to Prefecture 1, its ID number is 000001000001.\n\nSample Input 2\n\n2 3\n2 55\n2 77\n2 99\n\nSample Output 2\n\n000002000001\n000002000002\n000002000003", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 23503, "cpu_time_ms": 2112, "memory_kb": 92328}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s160828451", "group_id": "codeNet:p03227", "input_text": "function getLines(input){\n\treturn input.split(\"\\n\").map((s)=>s.trim())\n}\nfunction parseLine(line){\n\treturn line.split(\" \").map((s)=>s.trim());\n}\nfunction parseLineToInt(line){\n\treturn line.split(\" \").map((s)=>parseInt(s.trim()));\n}\n// parameter \"input\" gets all data\nfunction Main(input) {\n\t// the first line is assigned to input[0], the second line is assigned to input[1] similarly.\t\n\tinput = input.trim();\n\tif(input.length==2)\n\t\tconsole.log(input)\n\telse{\n\t\tvar s='';\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\ts=s+input[input.length-1-i];\n\t\t}\n\t\tconsole.log(s)\n\t}\n\t\n}\n// Don't edit this line!\n//Main(require(\"fs\").readFileSync(__dirname+'/in.txt', \"utf8\"));\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "language": "JavaScript", "metadata": {"date": 1540688661, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03227.html", "problem_id": "p03227", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03227/input.txt", "sample_output_relpath": "derived/input_output/data/p03227/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03227/JavaScript/s160828451.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s160828451", "user_id": "u157461801"}, "prompt_components": {"gold_output": "cba\n", "input_to_evaluate": "function getLines(input){\n\treturn input.split(\"\\n\").map((s)=>s.trim())\n}\nfunction parseLine(line){\n\treturn line.split(\" \").map((s)=>s.trim());\n}\nfunction parseLineToInt(line){\n\treturn line.split(\" \").map((s)=>parseInt(s.trim()));\n}\n// parameter \"input\" gets all data\nfunction Main(input) {\n\t// the first line is assigned to input[0], the second line is assigned to input[1] similarly.\t\n\tinput = input.trim();\n\tif(input.length==2)\n\t\tconsole.log(input)\n\telse{\n\t\tvar s='';\n\t\tfor (var i = 0; i < input.length; i++) {\n\t\t\ts=s+input[input.length-1-i];\n\t\t}\n\t\tconsole.log(s)\n\t}\n\t\n}\n// Don't edit this line!\n//Main(require(\"fs\").readFileSync(__dirname+'/in.txt', \"utf8\"));\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.\n\nConstraints\n\nThe length of S is 2 or 3.\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the length of S is 2, print S as is; if the length is 3, print S after reversing it.\n\nSample Input 1\n\nabc\n\nSample Output 1\n\ncba\n\nAs the length of S is 3, we print it after reversing it.\n\nSample Input 2\n\nac\n\nSample Output 2\n\nac\n\nAs the length of S is 2, we print it as is.", "sample_input": "abc\n"}, "reference_outputs": ["cba\n"], "source_document_id": "p03227", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.\n\nConstraints\n\nThe length of S is 2 or 3.\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the length of S is 2, print S as is; if the length is 3, print S after reversing it.\n\nSample Input 1\n\nabc\n\nSample Output 1\n\ncba\n\nAs the length of S is 3, we print it after reversing it.\n\nSample Input 2\n\nac\n\nSample Output 2\n\nac\n\nAs the length of S is 2, we print it as is.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 719, "cpu_time_ms": 1410, "memory_kb": 22964}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s426526681", "group_id": "codeNet:p03227", "input_text": "input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconsole.log(input.length == 2 ? input : input.split('').reverse().join(''));", "language": "JavaScript", "metadata": {"date": 1540688647, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03227.html", "problem_id": "p03227", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03227/input.txt", "sample_output_relpath": "derived/input_output/data/p03227/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03227/JavaScript/s426526681.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s426526681", "user_id": "u646148705"}, "prompt_components": {"gold_output": "cba\n", "input_to_evaluate": "input = require('fs').readFileSync('/dev/stdin', 'utf8');\nconsole.log(input.length == 2 ? input : input.split('').reverse().join(''));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.\n\nConstraints\n\nThe length of S is 2 or 3.\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the length of S is 2, print S as is; if the length is 3, print S after reversing it.\n\nSample Input 1\n\nabc\n\nSample Output 1\n\ncba\n\nAs the length of S is 3, we print it after reversing it.\n\nSample Input 2\n\nac\n\nSample Output 2\n\nac\n\nAs the length of S is 2, we print it as is.", "sample_input": "abc\n"}, "reference_outputs": ["cba\n"], "source_document_id": "p03227", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a string S of length 2 or 3 consisting of lowercase English letters. If the length of the string is 2, print it as is; if the length is 3, print the string after reversing it.\n\nConstraints\n\nThe length of S is 2 or 3.\n\nS consists of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf the length of S is 2, print S as is; if the length is 3, print S after reversing it.\n\nSample Input 1\n\nabc\n\nSample Output 1\n\ncba\n\nAs the length of S is 3, we print it after reversing it.\n\nSample Input 2\n\nac\n\nSample Output 2\n\nac\n\nAs the length of S is 2, we print it as is.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 134, "cpu_time_ms": 1237, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s190059776", "group_id": "codeNet:p03228", "input_text": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input, \"index\" : 0, \"max\" : input.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n }\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var one = nextIntArray();\n var A = one[0];\n var B = one[1];\n var K = one[2];\n for(var i = 0; i < K; i++){\n if(i % 2 == 0){\n if(A % 2 == 1){\n A--;\n }\n B += A / 2;\n A /= 2;\n }else{\n if(B % 2 == 1){\n B--;\n }\n A += B / 2;\n B /= 2;\n }\n }\n myout(A + \" \" + B);\n}", "language": "JavaScript", "metadata": {"date": 1583763120, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03228.html", "problem_id": "p03228", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03228/input.txt", "sample_output_relpath": "derived/input_output/data/p03228/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03228/JavaScript/s190059776.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s190059776", "user_id": "u222822036"}, "prompt_components": {"gold_output": "5 3\n", "input_to_evaluate": "var input = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").trim().split(\"\\n\");\nvar obj = {\n \"list\" : input, \"index\" : 0, \"max\" : input.length,\n \"hasNext\" : function(){return (this.index < this.max);},\n \"next\" : function(){\n if(!this.hasNext()){throw \"NoSuchElementException:次に要素は無いよ\";}\n var returnObj = this.list[this.index];\n this.index++;\n return returnObj;\n }\n}\nMain();\nfunction next(){return obj.next();}\nfunction nextInt(){return myconv(next(),1);}\nfunction nextStrArray(){return myconv(next(),2);}//半角スペース分割\nfunction nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化\nfunction nextCharArray(){return myconv(next(),6);}//1文字分割\nfunction hasNext(){return obj.hasNext();}\nfunction myout(t){console.log(t);}//標準出力\nfunction myerr(t){console.error(t);}//標準エラー出力\n//[no]要素の扱い。数値型\n//不明値、異常時:引数そのまま返す 1:数値へ変換\n//2:半角SPで分割 4:半角SPで分割し、数値配列へ\n//6:1文字で分割 7:1文字で分割し、数値配列へ\n//8:半角SPで結合 9:改行で結合 0:文字なしで結合\nfunction myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(\" \");case 4:return i.split(\" \").map((a)=>Number(a));case 6:return i.split(\"\");case 7:return i.split(\"\").map((a)=>Number(a));case 8:return i.join(\" \");case 9:return i.join(\"\\n\");case 0:return i.join(\"\");default:return i;}}catch(e){return i;}}\nfunction Main(){\n var one = nextIntArray();\n var A = one[0];\n var B = one[1];\n var K = one[2];\n for(var i = 0; i < K; i++){\n if(i % 2 == 0){\n if(A % 2 == 1){\n A--;\n }\n B += A / 2;\n A /= 2;\n }else{\n if(B % 2 == 1){\n B--;\n }\n A += B / 2;\n B /= 2;\n }\n }\n myout(A + \" \" + B);\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nIn the beginning, Takahashi has A cookies, and Aoki has B cookies.\nThey will perform the following operation alternately, starting from Takahashi:\n\nIf the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.\n\nFind the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.\n\nConstraints\n\n1 \\leq A,B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nA,B and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total.\n\nSample Input 1\n\n5 4 2\n\nSample Output 1\n\n5 3\n\nThe process will go as follows:\n\nIn the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n\nTakahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n\nAoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\nSample Input 2\n\n3 3 3\n\nSample Output 2\n\n1 3\n\nSample Input 3\n\n314159265 358979323 84\n\nSample Output 3\n\n448759046 224379523", "sample_input": "5 4 2\n"}, "reference_outputs": ["5 3\n"], "source_document_id": "p03228", "source_text": "Score : 200 points\n\nProblem Statement\n\nIn the beginning, Takahashi has A cookies, and Aoki has B cookies.\nThey will perform the following operation alternately, starting from Takahashi:\n\nIf the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.\n\nFind the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.\n\nConstraints\n\n1 \\leq A,B \\leq 10^9\n\n1 \\leq K \\leq 100\n\nA,B and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B K\n\nOutput\n\nPrint the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total.\n\nSample Input 1\n\n5 4 2\n\nSample Output 1\n\n5 3\n\nThe process will go as follows:\n\nIn the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.\n\nTakahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.\n\nAoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.\n\nSample Input 2\n\n3 3 3\n\nSample Output 2\n\n1 3\n\nSample Input 3\n\n314159265 358979323 84\n\nSample Output 3\n\n448759046 224379523", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1837, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s046282385", "group_id": "codeNet:p03238", "input_text": "function Main(input){\n const lines = input.split('\\n');\n if (lines[0] === 1){\n return 'HELLO WORLD'\n }\n if (lines[0] === 2){\n return (lines[1]*1) + (lines[2]*1)\n }\n}\nconsole.log(Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")));", "language": "JavaScript", "metadata": {"date": 1539654657, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03238.html", "problem_id": "p03238", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03238/input.txt", "sample_output_relpath": "derived/input_output/data/p03238/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03238/JavaScript/s046282385.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s046282385", "user_id": "u522469629"}, "prompt_components": {"gold_output": "Hello World\n", "input_to_evaluate": "function Main(input){\n const lines = input.split('\\n');\n if (lines[0] === 1){\n return 'HELLO WORLD'\n }\n if (lines[0] === 2){\n return (lines[1]*1) + (lines[2]*1)\n }\n}\nconsole.log(Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")));", "problem_context": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "sample_input": "1\n"}, "reference_outputs": ["Hello World\n"], "source_document_id": "p03238", "source_text": "Score: 100 points\n\nProblem Statement\n\nIn 2020, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.\n\nOne day, there was an exam where a one-year-old child must write a program that prints Hello World, and a two-year-old child must write a program that receives integers A, B and prints A+B.\n\nTakahashi, who is taking this exam, suddenly forgets his age.\n\nHe decides to write a program that first receives his age N (1 or 2) as input, then prints Hello World if N=1, and additionally receives integers A, B and prints A+B if N=2.\n\nWrite this program for him.\n\nConstraints\n\nN is 1 or 2.\n\nA is an integer between 1 and 9 (inclusive).\n\nB is an integer between 1 and 9 (inclusive).\n\nInput\n\nInput is given from Standard Input in one of the following formats:\n\n1\n\n2\nA\nB\n\nOutput\n\nIf N=1, print Hello World; if N=2, print A+B.\n\nSample Input 1\n\n1\n\nSample Output 1\n\nHello World\n\nAs N=1, Takahashi is one year old. Thus, we should print Hello World.\n\nSample Input 2\n\n2\n3\n5\n\nSample Output 2\n\n8\n\nAs N=2, Takahashi is two years old. Thus, we should print A+B, which is 8 since A=3 and B=5.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 51, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s279207401", "group_id": "codeNet:p03241", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.split(\"\\n\");\n\ttmp = input[0].split(\" \");\n\t//文字列から10進数に変換するときはparseIntを使います\n\tvar N = parseInt(tmp[0], 10);\n\tvar M = parseInt(tmp[1], 10);\n\n var divisors = divisor(M);\n var max = 0;\n for (var i =0;i < divisors.length;i++) {\n var d = divisors[i];\n if (M / d >= N) {\n max = Math.max(max, d);\n }\n }\n\n\t//出力\n\tconsole.log('%d',max);\n}\nfunction divisor(n) {\n var res = [];\n for (var i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n res.push(i);\n if (n / i != i) {\n res.push(n / i);\n }\n }\n }\n return res;\n }\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1559968691, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03241.html", "problem_id": "p03241", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03241/input.txt", "sample_output_relpath": "derived/input_output/data/p03241/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03241/JavaScript/s279207401.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s279207401", "user_id": "u552502395"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "// inputに入力データ全体が入る\nfunction Main(input) {\n\t// 1行目がinput[0], 2行目がinput[1], …に入る\n\tinput = input.split(\"\\n\");\n\ttmp = input[0].split(\" \");\n\t//文字列から10進数に変換するときはparseIntを使います\n\tvar N = parseInt(tmp[0], 10);\n\tvar M = parseInt(tmp[1], 10);\n\n var divisors = divisor(M);\n var max = 0;\n for (var i =0;i < divisors.length;i++) {\n var d = divisors[i];\n if (M / d >= N) {\n max = Math.max(max, d);\n }\n }\n\n\t//出力\n\tconsole.log('%d',max);\n}\nfunction divisor(n) {\n var res = [];\n for (var i = 1; i * i <= n; i++) {\n if (n % i == 0) {\n res.push(i);\n if (n / i != i) {\n res.push(n / i);\n }\n }\n }\n return res;\n }\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "sample_input": "3 14\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03241", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given integers N and M.\n\nConsider a sequence a of length N consisting of positive integers such that a_1 + a_2 + ... + a_N = M. Find the maximum possible value of the greatest common divisor of a_1, a_2, ..., a_N.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\nN \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the maximum possible value of the greatest common divisor of a sequence a_1, a_2, ..., a_N that satisfies the condition.\n\nSample Input 1\n\n3 14\n\nSample Output 1\n\n2\n\nConsider the sequence (a_1, a_2, a_3) = (2, 4, 8). Their greatest common divisor is 2, and this is the maximum value.\n\nSample Input 2\n\n10 123\n\nSample Output 2\n\n3\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n10000", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1070, "cpu_time_ms": 54, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s934956092", "group_id": "codeNet:p03242", "input_text": "function Main(input){\n var n = input.split(\"\");\n for(i=0;i<=2;i++){\n if(n[i]==\"1\"){\n n[i] = 9;\n }else if(n[i]==\"9\"){\n n[i] = 1;\n }\n } \n console.log(n.join(\"\"));\n\n}\n Main(require('fs').readFileSync('/dev/stdin','utf8'));", "language": "JavaScript", "metadata": {"date": 1567286125, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03242.html", "problem_id": "p03242", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03242/input.txt", "sample_output_relpath": "derived/input_output/data/p03242/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03242/JavaScript/s934956092.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s934956092", "user_id": "u830237447"}, "prompt_components": {"gold_output": "991\n", "input_to_evaluate": "function Main(input){\n var n = input.split(\"\");\n for(i=0;i<=2;i++){\n if(n[i]==\"1\"){\n n[i] = 9;\n }else if(n[i]==\"9\"){\n n[i] = 1;\n }\n } \n console.log(n.join(\"\"));\n\n}\n Main(require('fs').readFileSync('/dev/stdin','utf8'));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "sample_input": "119\n"}, "reference_outputs": ["991\n"], "source_document_id": "p03242", "source_text": "Score : 100 points\n\nProblem Statement\n\nCat Snuke is learning to write characters.\nToday, he practiced writing digits 1 and 9, but he did it the other way around.\n\nYou are given a three-digit integer n written by Snuke.\nPrint the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n.\n\nConstraints\n\n111 \\leq n \\leq 999\n\nn is an integer consisting of digits 1 and 9.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\n\nOutput\n\nPrint the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n.\n\nSample Input 1\n\n119\n\nSample Output 1\n\n991\n\nReplace the 9 in the ones place with 1, the 1 in the tens place with 9 and the 1 in the hundreds place with 9. The answer is 991.\n\nSample Input 2\n\n999\n\nSample Output 2\n\n111", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 245, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s624698903", "group_id": "codeNet:p03242", "input_text": "parcelRequire=function(e,r,t,n){var i,o=\"function\"==typeof parcelRequire&&parcelRequire,u=\"function\"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i=\"function\"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&\"string\"==typeof t)return u(t);var c=new Error(\"Cannot find module '\"+t+\"'\");throw c.code=\"MODULE_NOT_FOUND\",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c {\n const n = parseInt(input[0]), v = input[1].split(' ').map(val => parseInt(val));\n // console.log(n, v);\n let even = [], odd = [];\n for(let i=0; i oddmode[val]++);\n let Omax = Math.max.apply(null, oddmode);\n let OmaxId = oddmode.indexOf(Math.max.apply(null, oddmode));\n oddmode[OmaxId] = 0;\n let Osec = Math.max.apply(null, oddmode);\n let OsecId = oddmode.indexOf(Math.max.apply(null, oddmode));\n \n let evenmode = (new Array(100000)).fill(0);\n even.map(val => evenmode[val]++);\n let Emax = Math.max.apply(null, evenmode);\n let EmaxId = evenmode.indexOf(Math.max.apply(null, evenmode));\n evenmode[EmaxId] = 0;\n let Esec = Math.max.apply(null, evenmode);\n let EsecId = evenmode.indexOf(Math.max.apply(null, evenmode));\n \n // console.log(oddmode, evenmode);\n // console.log(Omax, Emax, Osec, Esec);\n \n\n if (OmaxId == EmaxId) {\n if (odd.length-Omax == even.length-Emax) {\n if (odd.length-Osec > even.length-Esec) {\n console.log(n-Esec-Omax);\n } else {\n console.log(n-Osec-Emax);\n }\n } else if (odd.length-Omax > even.length-Emax) {\n console.log(n-Omax-Esec);\n } else {\n console.log(n-Emax-Osec);\n \n }\n } else {\n console.log(n-Omax-Emax);\n }\n // console.log(even.length, odd.length);\n \n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split('\\n'));", "language": "JavaScript", "metadata": {"date": 1571436161, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/JavaScript/s464986720.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s464986720", "user_id": "u415865011"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "'use strict';\nconst main = input => {\n const n = parseInt(input[0]), v = input[1].split(' ').map(val => parseInt(val));\n // console.log(n, v);\n let even = [], odd = [];\n for(let i=0; i oddmode[val]++);\n let Omax = Math.max.apply(null, oddmode);\n let OmaxId = oddmode.indexOf(Math.max.apply(null, oddmode));\n oddmode[OmaxId] = 0;\n let Osec = Math.max.apply(null, oddmode);\n let OsecId = oddmode.indexOf(Math.max.apply(null, oddmode));\n \n let evenmode = (new Array(100000)).fill(0);\n even.map(val => evenmode[val]++);\n let Emax = Math.max.apply(null, evenmode);\n let EmaxId = evenmode.indexOf(Math.max.apply(null, evenmode));\n evenmode[EmaxId] = 0;\n let Esec = Math.max.apply(null, evenmode);\n let EsecId = evenmode.indexOf(Math.max.apply(null, evenmode));\n \n // console.log(oddmode, evenmode);\n // console.log(Omax, Emax, Osec, Esec);\n \n\n if (OmaxId == EmaxId) {\n if (odd.length-Omax == even.length-Emax) {\n if (odd.length-Osec > even.length-Esec) {\n console.log(n-Esec-Omax);\n } else {\n console.log(n-Osec-Emax);\n }\n } else if (odd.length-Omax > even.length-Emax) {\n console.log(n-Omax-Esec);\n } else {\n console.log(n-Emax-Osec);\n \n }\n } else {\n console.log(n-Omax-Emax);\n }\n // console.log(even.length, odd.length);\n \n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\").split('\\n'));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1533, "cpu_time_ms": 295, "memory_kb": 63912}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s012787094", "group_id": "codeNet:p03244", "input_text": "function main(input) {\n var N = input[0].split(\" \")[0]-0;\n var list = input[1].split(\" \").map(v=>v-0);\n var a = {};\n var b = {};\n list.forEach((v,i)=>{\n if(i%2==0){\n a[v] = (a[v]||0)+1;\n }else{\n b[v] = (b[v]||0)+1;\n }\n });\n var alist = Object.keys(a).sort((aa,bb)=>a[bb]-a[aa]);\n var blist = Object.keys(b).sort((aa,bb)=>b[bb]-b[aa]);\n var ans = 0;\n var abase,bbase = 0;\n if(alist[0] == blist[0]){\n if(alist[1] > blist[1]){\n abase = 0, bbase = 1;\n }else {\n abase = 1, bbase = 0;\n }\n }else{\n abase = 0, bbase=0;\n }\n alist.filter((v,i)=>i!=abase).forEach(v=>ans+=a[v]);\n blist.filter((v,i)=>i!=bbase).forEach(v=>ans+=b[v]);\n console.log(ans);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split(\"\\n\"))\n", "language": "JavaScript", "metadata": {"date": 1562160889, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/JavaScript/s012787094.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s012787094", "user_id": "u816097281"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function main(input) {\n var N = input[0].split(\" \")[0]-0;\n var list = input[1].split(\" \").map(v=>v-0);\n var a = {};\n var b = {};\n list.forEach((v,i)=>{\n if(i%2==0){\n a[v] = (a[v]||0)+1;\n }else{\n b[v] = (b[v]||0)+1;\n }\n });\n var alist = Object.keys(a).sort((aa,bb)=>a[bb]-a[aa]);\n var blist = Object.keys(b).sort((aa,bb)=>b[bb]-b[aa]);\n var ans = 0;\n var abase,bbase = 0;\n if(alist[0] == blist[0]){\n if(alist[1] > blist[1]){\n abase = 0, bbase = 1;\n }else {\n abase = 1, bbase = 0;\n }\n }else{\n abase = 0, bbase=0;\n }\n alist.filter((v,i)=>i!=abase).forEach(v=>ans+=a[v]);\n blist.filter((v,i)=>i!=bbase).forEach(v=>ans+=b[v]);\n console.log(ans);\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split(\"\\n\"))\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 775, "cpu_time_ms": 162, "memory_kb": 37164}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s908041019", "group_id": "codeNet:p03244", "input_text": "// 解説をそのまま写経した感じです\n\nfunction Main(input){\n input = input.split(\"\\n\");\n var n = ~~input[0]\n var v = input[1].split(\" \");\n var even = [];\n var odd = [];\n for(var i = 0; i < n; i++){\n \tvar h = v[i];\n var a = (i%2?odd:even)[h];\n a = a || {val:h,count:0};\n a.count++;\n if(i%2){odd[h]=a}else{even[h]=a};\n }\n even = even.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);\n odd = odd.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);\n // filter : nullを消去\n \n if(even[0].val!=odd[0].val){\n \treturn n - even[0].count - odd[0].count;\n // 最頻値が異なる\n }\n if(!even[1] && !even[2]){\n \treturn n/2;\n // 偶奇どちらの副最頻値も存在しない\n // (すべての数字が同じ)\n }\n if(!even[1]){\n \treturn n - even[0].count - odd[1].count;\n // 偶数番目の副最頻値��存在しない\n }\n if(!odd[1]){\n \treturn n - even[1].count - odd[0].count;\n // 奇数番目の副最頻値が存在しない\n }\n return Math.min(\n \tn - even[0].count - odd[1].count,\n n - even[1].count - odd[0].count\n );\n}\n\nif(typeof require !== 'undefined')console.log(Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")));", "language": "JavaScript", "metadata": {"date": 1541449131, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/JavaScript/s908041019.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s908041019", "user_id": "u278886389"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "// 解説をそのまま写経した感じです\n\nfunction Main(input){\n input = input.split(\"\\n\");\n var n = ~~input[0]\n var v = input[1].split(\" \");\n var even = [];\n var odd = [];\n for(var i = 0; i < n; i++){\n \tvar h = v[i];\n var a = (i%2?odd:even)[h];\n a = a || {val:h,count:0};\n a.count++;\n if(i%2){odd[h]=a}else{even[h]=a};\n }\n even = even.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);\n odd = odd.sort((a,b)=>a.count-b.count).reverse().filter(a=>a);\n // filter : nullを消去\n \n if(even[0].val!=odd[0].val){\n \treturn n - even[0].count - odd[0].count;\n // 最頻値が異なる\n }\n if(!even[1] && !even[2]){\n \treturn n/2;\n // 偶奇どちらの副最頻値も存在しない\n // (すべての数字が同じ)\n }\n if(!even[1]){\n \treturn n - even[0].count - odd[1].count;\n // 偶数番目の副最頻値が存在しない\n }\n if(!odd[1]){\n \treturn n - even[1].count - odd[0].count;\n // 奇数番目の副最頻値が存在しない\n }\n return Math.min(\n \tn - even[0].count - odd[1].count,\n n - even[1].count - odd[0].count\n );\n}\n\nif(typeof require !== 'undefined')console.log(Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\")));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1201, "cpu_time_ms": 272, "memory_kb": 46836}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s796283562", "group_id": "codeNet:p03244", "input_text": "(function(input) {\n 'use strict';\n const INPUT = input.split(\"\\n\")\n for(let i = 0; i Max){\n Max = countHash[[line[j],line[j+1]].toString()]\n MaxPair = [line[j],line[j+1]].toString()\n }\n }\n\n MaxPair = MaxPair.split(',')\n let res = 0\n for(let j=0; j< length; j=j+2){\n if(MaxPair[0] != line[j]) res++\n if(MaxPair[1] != line[j+1]) res++\n }\n console.log(res)\n }\n})(require('fs').readFileSync('/dev/stdin', 'utf8'))", "language": "JavaScript", "metadata": {"date": 1539099581, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03244.html", "problem_id": "p03244", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03244/input.txt", "sample_output_relpath": "derived/input_output/data/p03244/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03244/JavaScript/s796283562.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s796283562", "user_id": "u628588759"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "(function(input) {\n 'use strict';\n const INPUT = input.split(\"\\n\")\n for(let i = 0; i Max){\n Max = countHash[[line[j],line[j+1]].toString()]\n MaxPair = [line[j],line[j+1]].toString()\n }\n }\n\n MaxPair = MaxPair.split(',')\n let res = 0\n for(let j=0; j< length; j=j+2){\n if(MaxPair[0] != line[j]) res++\n if(MaxPair[1] != line[j+1]) res++\n }\n console.log(res)\n }\n})(require('fs').readFileSync('/dev/stdin', 'utf8'))", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03244", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 962, "cpu_time_ms": 237, "memory_kb": 42476}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s660263869", "group_id": "codeNet:p03246", "input_text": "var toInt = x=>parseInt(x,10);\nvar toIntArr = arr=>arr.map(x=>toInt(x));\nvar abs = x=>x>0?x:-x;\nfunction min(){var rest=arguments,v=rest[0];for(var i=1;iv)v=rest[i];return v}\nfunction gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;i({el:e,ind:ind})).filter(el=>el.el>0).sort((a,b)=>b.el-a.el);\n\tvar ys = even.map((e,ind,arr)=>({el:e,ind:ind})).filter(el=>el.el>0).sort((a,b)=>b.el-a.el);\n\tvar ans = 0;\n\tif(xs[0].ind === ys[0].ind){\n\t\tif(xs.length === 1){\n\t\t\tif(ys.length === 1){\n\t\t\t\tans = n/2;\n\t\t\t}else{\n\t\t\t\tans = n/2 - ys[1].el;\n\t\t\t}\n\t\t}else{\n\t\t\tif(ys.length === 1){\n\t\t\t\tans = n/2 - xs[1].el;\n\t\t\t}else{\n\t\t\t\tans = min(n - xs[0].el - ys[1].el, n - xs[1].el - ys[0].el);\n\t\t\t}\n\t\t}\n\t}else{\n\t\tans = n - xs[0].el - ys[0].el;\n\t}\n\n\tconsole.log(ans);\n\treturn 0;\n}\n\n", "language": "JavaScript", "metadata": {"date": 1538270555, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03246.html", "problem_id": "p03246", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03246/input.txt", "sample_output_relpath": "derived/input_output/data/p03246/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03246/JavaScript/s660263869.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s660263869", "user_id": "u511119682"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "var toInt = x=>parseInt(x,10);\nvar toIntArr = arr=>arr.map(x=>toInt(x));\nvar abs = x=>x>0?x:-x;\nfunction min(){var rest=arguments,v=rest[0];for(var i=1;iv)v=rest[i];return v}\nfunction gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;i({el:e,ind:ind})).filter(el=>el.el>0).sort((a,b)=>b.el-a.el);\n\tvar ys = even.map((e,ind,arr)=>({el:e,ind:ind})).filter(el=>el.el>0).sort((a,b)=>b.el-a.el);\n\tvar ans = 0;\n\tif(xs[0].ind === ys[0].ind){\n\t\tif(xs.length === 1){\n\t\t\tif(ys.length === 1){\n\t\t\t\tans = n/2;\n\t\t\t}else{\n\t\t\t\tans = n/2 - ys[1].el;\n\t\t\t}\n\t\t}else{\n\t\t\tif(ys.length === 1){\n\t\t\t\tans = n/2 - xs[1].el;\n\t\t\t}else{\n\t\t\t\tans = min(n - xs[0].el - ys[1].el, n - xs[1].el - ys[0].el);\n\t\t\t}\n\t\t}\n\t}else{\n\t\tans = n - xs[0].el - ys[0].el;\n\t}\n\n\tconsole.log(ans);\n\treturn 0;\n}\n\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "sample_input": "4\n3 1 3 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03246", "source_text": "Score : 300 points\n\nProblem Statement\n\nA sequence a_1,a_2,... ,a_n is said to be /\\/\\/\\/ when the following conditions are satisfied:\n\nFor each i = 1,2,..., n-2, a_i = a_{i+2}.\n\nExactly two different numbers appear in the sequence.\n\nYou are given a sequence v_1,v_2,...,v_n whose length is even.\nWe would like to make this sequence /\\/\\/\\/ by replacing some of its elements.\nFind the minimum number of elements that needs to be replaced.\n\nConstraints\n\n2 \\leq n \\leq 10^5\n\nn is even.\n\n1 \\leq v_i \\leq 10^5\n\nv_i is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nn\nv_1 v_2 ... v_n\n\nOutput\n\nPrint the minimum number of elements that needs to be replaced.\n\nSample Input 1\n\n4\n3 1 3 2\n\nSample Output 1\n\n1\n\nThe sequence 3,1,3,2 is not /\\/\\/\\/, but we can make it /\\/\\/\\/ by replacing one of its elements: for example, replace the fourth element to make it 3,1,3,1.\n\nSample Input 2\n\n6\n105 119 105 119 105 119\n\nSample Output 2\n\n0\n\nThe sequence 105,119,105,119,105,119 is /\\/\\/\\/.\n\nSample Input 3\n\n4\n1 1 1 1\n\nSample Output 3\n\n2\n\nThe elements of the sequence 1,1,1,1 are all the same, so it is not /\\/\\/\\/.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1366, "cpu_time_ms": 649, "memory_kb": 44916}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s373850169", "group_id": "codeNet:p03247", "input_text": "var toInt = x=>parseInt(x,10);\nvar toIntArr = arr=>arr.map(x=>toInt(x));\nvar abs = x=>x>0?x:-x;\nfunction min(){var rest=arguments,v=rest[0];for(var i=1;iv)v=rest[i];return v}\nfunction gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;ie[0]%2===0?e:e.reverse());\n\t}\n\t/*\n\teven\n\tm = 10\n\tdi = 1*10\n\t2n -> 4:+ (10-4)/2:+,-\t\n\t*/\n\tvar m = 20;\n\tif(xys[0][0]%2===1) m++;\n\tif(xys[0][1]%2===1) m++;\n\tconsole.log(m);\n\tvar ds = [];\n\tds.length = m;\n\tds.fill(1);\n\tds = ds.join(' ');\n\tconsole.log(ds);\n\n\tfor(var i = 0; i < n; i++){\n\t\tvar str = '';\n\t\tvar xy = xys[i];\n\t\tif(xy[0]%2===1){\n\t\t\tstr += 'R';\n\t\t\txy[0]++;\n\t\t}\n\t\tif(xy[1]%2===1){\n\t\t\tstr += 'R';\n\t\t\txy[1]++;\n\t\t}\n\tstr += ''.padEnd((10+xy[0])/2,'R');\n\tstr += ''.padEnd((10-xy[0])/2,'L');\n\tstr += ''.padEnd((10+xy[1])/2,'U');\n\tstr += ''.padEnd((10-xy[1])/2,'D');\n\tconsole.log(str);\n\t}\n\n\treturn 0;\n}\n\n", "language": "JavaScript", "metadata": {"date": 1538275218, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03247.html", "problem_id": "p03247", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03247/input.txt", "sample_output_relpath": "derived/input_output/data/p03247/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03247/JavaScript/s373850169.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s373850169", "user_id": "u511119682"}, "prompt_components": {"gold_output": "2\n1 2\nRL\nUU\nDR\n", "input_to_evaluate": "var toInt = x=>parseInt(x,10);\nvar toIntArr = arr=>arr.map(x=>toInt(x));\nvar abs = x=>x>0?x:-x;\nfunction min(){var rest=arguments,v=rest[0];for(var i=1;iv)v=rest[i];return v}\nfunction gcd(){var rest=arguments,v=rest[0],temp=(a,b)=>b?temp(b,a%b):a;for(var i=1;ie[0]%2===0?e:e.reverse());\n\t}\n\t/*\n\teven\n\tm = 10\n\tdi = 1*10\n\t2n -> 4:+ (10-4)/2:+,-\t\n\t*/\n\tvar m = 20;\n\tif(xys[0][0]%2===1) m++;\n\tif(xys[0][1]%2===1) m++;\n\tconsole.log(m);\n\tvar ds = [];\n\tds.length = m;\n\tds.fill(1);\n\tds = ds.join(' ');\n\tconsole.log(ds);\n\n\tfor(var i = 0; i < n; i++){\n\t\tvar str = '';\n\t\tvar xy = xys[i];\n\t\tif(xy[0]%2===1){\n\t\t\tstr += 'R';\n\t\t\txy[0]++;\n\t\t}\n\t\tif(xy[1]%2===1){\n\t\t\tstr += 'R';\n\t\t\txy[1]++;\n\t\t}\n\tstr += ''.padEnd((10+xy[0])/2,'R');\n\tstr += ''.padEnd((10-xy[0])/2,'L');\n\tstr += ''.padEnd((10+xy[1])/2,'U');\n\tstr += ''.padEnd((10-xy[1])/2,'D');\n\tconsole.log(str);\n\t}\n\n\treturn 0;\n}\n\n", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke is introducing a robot arm with the following properties to his factory:\n\nThe robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.\n\nFor each section, its mode can be specified individually. There are four modes: L, R, D and U. The mode of a section decides the direction of that section. If we consider the factory as a coordinate plane, the position of Joint i will be determined as follows (we denote its coordinates as (x_i, y_i)):\n\n(x_0, y_0) = (0, 0).\n\nIf the mode of Section i is L, (x_{i}, y_{i}) = (x_{i-1} - d_{i}, y_{i-1}).\n\nIf the mode of Section i is R, (x_{i}, y_{i}) = (x_{i-1} + d_{i}, y_{i-1}).\n\nIf the mode of Section i is D, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} - d_{i}).\n\nIf the mode of Section i is U, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} + d_{i}).\n\nSnuke would like to introduce a robot arm so that the position of Joint m can be matched with all of the N points (X_1, Y_1), (X_2, Y_2), ..., (X_N, Y_N) by properly specifying the modes of the sections.\nIs this possible?\nIf so, find such a robot arm and how to bring Joint m to each point (X_j, Y_j).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 1000\n\n-10^9 \\leq X_i \\leq 10^9\n\n-10^9 \\leq Y_i \\leq 10^9\n\nPartial Score\n\nIn the test cases worth 300 points, -10 \\leq X_i \\leq 10 and -10 \\leq Y_i \\leq 10 hold.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1\nX_2 Y_2\n:\nX_N Y_N\n\nOutput\n\nIf the condition can be satisfied, follow the following format. If the condition cannot be satisfied, print -1.\n\nm\nd_1 d_2 ... d_m\nw_1\nw_2\n:\nw_N\n\nm and d_i are the configurations of the robot arm. Refer to the problem statement for what each of them means.\nHere, 1 \\leq m \\leq 40 and 1 \\leq d_i \\leq 10^{12} must hold. Also, m and d_i must all be integers.\n\nw_j is a string of length m that represents the way to bring Joint m of the robot arm to point (X_j, Y_j).\nThe i-th character of w_j should be one of the letters L, R, D and U, representing the mode of Section i.\n\nSample Input 1\n\n3\n-1 0\n0 3\n2 -1\n\nSample Output 1\n\n2\n1 2\nRL\nUU\nDR\n\nIn the given way to bring Joint m of the robot arm to each (X_j, Y_j), the positions of the joints will be as follows:\n\nTo (X_1, Y_1) = (-1, 0): First, the position of Joint 0 is (x_0, y_0) = (0, 0). As the mode of Section 1 is R, the position of Joint 1 is (x_1, y_1) = (1, 0). Then, as the mode of Section 2 is L, the position of Joint 2 is (x_2, y_2) = (-1, 0).\n\nTo (X_2, Y_2) = (0, 3): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, 1), (x_2, y_2) = (0, 3).\n\nTo (X_3, Y_3) = (2, -1): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, -1), (x_2, y_2) = (2, -1).\n\nSample Input 2\n\n5\n0 0\n1 0\n2 0\n3 0\n4 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n1 1\n1 1\n\nSample Output 3\n\n2\n1 1\nRU\nUR\n\nThere may be duplicated points among (X_j, Y_j).\n\nSample Input 4\n\n3\n-7 -3\n7 3\n-3 -7\n\nSample Output 4\n\n5\n3 1 4 1 5\nLRDUL\nRDULR\nDULRD", "sample_input": "3\n-1 0\n0 3\n2 -1\n"}, "reference_outputs": ["2\n1 2\nRL\nUU\nDR\n"], "source_document_id": "p03247", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke is introducing a robot arm with the following properties to his factory:\n\nThe robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.\n\nFor each section, its mode can be specified individually. There are four modes: L, R, D and U. The mode of a section decides the direction of that section. If we consider the factory as a coordinate plane, the position of Joint i will be determined as follows (we denote its coordinates as (x_i, y_i)):\n\n(x_0, y_0) = (0, 0).\n\nIf the mode of Section i is L, (x_{i}, y_{i}) = (x_{i-1} - d_{i}, y_{i-1}).\n\nIf the mode of Section i is R, (x_{i}, y_{i}) = (x_{i-1} + d_{i}, y_{i-1}).\n\nIf the mode of Section i is D, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} - d_{i}).\n\nIf the mode of Section i is U, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} + d_{i}).\n\nSnuke would like to introduce a robot arm so that the position of Joint m can be matched with all of the N points (X_1, Y_1), (X_2, Y_2), ..., (X_N, Y_N) by properly specifying the modes of the sections.\nIs this possible?\nIf so, find such a robot arm and how to bring Joint m to each point (X_j, Y_j).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 1000\n\n-10^9 \\leq X_i \\leq 10^9\n\n-10^9 \\leq Y_i \\leq 10^9\n\nPartial Score\n\nIn the test cases worth 300 points, -10 \\leq X_i \\leq 10 and -10 \\leq Y_i \\leq 10 hold.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1\nX_2 Y_2\n:\nX_N Y_N\n\nOutput\n\nIf the condition can be satisfied, follow the following format. If the condition cannot be satisfied, print -1.\n\nm\nd_1 d_2 ... d_m\nw_1\nw_2\n:\nw_N\n\nm and d_i are the configurations of the robot arm. Refer to the problem statement for what each of them means.\nHere, 1 \\leq m \\leq 40 and 1 \\leq d_i \\leq 10^{12} must hold. Also, m and d_i must all be integers.\n\nw_j is a string of length m that represents the way to bring Joint m of the robot arm to point (X_j, Y_j).\nThe i-th character of w_j should be one of the letters L, R, D and U, representing the mode of Section i.\n\nSample Input 1\n\n3\n-1 0\n0 3\n2 -1\n\nSample Output 1\n\n2\n1 2\nRL\nUU\nDR\n\nIn the given way to bring Joint m of the robot arm to each (X_j, Y_j), the positions of the joints will be as follows:\n\nTo (X_1, Y_1) = (-1, 0): First, the position of Joint 0 is (x_0, y_0) = (0, 0). As the mode of Section 1 is R, the position of Joint 1 is (x_1, y_1) = (1, 0). Then, as the mode of Section 2 is L, the position of Joint 2 is (x_2, y_2) = (-1, 0).\n\nTo (X_2, Y_2) = (0, 3): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, 1), (x_2, y_2) = (0, 3).\n\nTo (X_3, Y_3) = (2, -1): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, -1), (x_2, y_2) = (2, -1).\n\nSample Input 2\n\n5\n0 0\n1 0\n2 0\n3 0\n4 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n1 1\n1 1\n\nSample Output 3\n\n2\n1 1\nRU\nUR\n\nThere may be duplicated points among (X_j, Y_j).\n\nSample Input 4\n\n3\n-7 -3\n7 3\n-3 -7\n\nSample Output 4\n\n5\n3 1 4 1 5\nLRDUL\nRDULR\nDULRD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1431, "cpu_time_ms": 987, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s961618964", "group_id": "codeNet:p03247", "input_text": "function gets(str){\n this._s = str.split(\"\\n\");\n this._y = 0;\n};\ngets.prototype = {\n a: function(f){\n var s = this._s, y = this._y, r;\n if(typeof s[y] === \"string\")s[y] = s[y].split(\" \").reverse();\n r = s[y].pop();\n if(!s[y].length)this._y++;\n return f?r:+r;\n },\n l: function(f){\n var s = this._s[this._y++].split(\" \");\n return f?s:s.map(a=>+a);\n },\n m: function(n,f){\n var s = this._s, y = this._y, r = [], i = 0;\n if(f)for(;i < n; i++)r[i] = s[y+i].split(\" \");\n else for(;i < n; i++)r[i] = s[y+i].split(\" \").map(a=>+a);\n this._y += n;\n return r;\n },\n};\nvar o=new gets(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var x = o.m(n);\n var t = (x[0][0]+x[0][1]) & 1;\n for(var i = 1; i < n; i++){\n var u = (x[i][0]+x[i][1]) & 1;\n if(u !== t)return -1;\n }\n var m = 20 - t;\n var d = Array(m).fill(1);\n var w = [];\n for(i = 0; i < n; i++){\n w[i] = \"\";\n for(var j = 0; j < m; j++){\n if(x[i][0] > 0){x[i][0]--; w[i] += \"L\";}\n else if(x[i][0] < 0){x[i][0]++; w[i] += \"R\";}\n else if(x[i][1] > 0){x[i][1]--; w[i] += \"D\";}\n else{x[i][1]++; w[i] += \"U\";}\n }\n }\n return m + \"\\n\" + d.join(\" \") + \"\\n\" + w.join(\"\\n\");\n}", "language": "JavaScript", "metadata": {"date": 1538272569, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03247.html", "problem_id": "p03247", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03247/input.txt", "sample_output_relpath": "derived/input_output/data/p03247/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03247/JavaScript/s961618964.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s961618964", "user_id": "u643613120"}, "prompt_components": {"gold_output": "2\n1 2\nRL\nUU\nDR\n", "input_to_evaluate": "function gets(str){\n this._s = str.split(\"\\n\");\n this._y = 0;\n};\ngets.prototype = {\n a: function(f){\n var s = this._s, y = this._y, r;\n if(typeof s[y] === \"string\")s[y] = s[y].split(\" \").reverse();\n r = s[y].pop();\n if(!s[y].length)this._y++;\n return f?r:+r;\n },\n l: function(f){\n var s = this._s[this._y++].split(\" \");\n return f?s:s.map(a=>+a);\n },\n m: function(n,f){\n var s = this._s, y = this._y, r = [], i = 0;\n if(f)for(;i < n; i++)r[i] = s[y+i].split(\" \");\n else for(;i < n; i++)r[i] = s[y+i].split(\" \").map(a=>+a);\n this._y += n;\n return r;\n },\n};\nvar o=new gets(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nconsole.log(main());\nfunction main(){\n var n = o.a();\n var x = o.m(n);\n var t = (x[0][0]+x[0][1]) & 1;\n for(var i = 1; i < n; i++){\n var u = (x[i][0]+x[i][1]) & 1;\n if(u !== t)return -1;\n }\n var m = 20 - t;\n var d = Array(m).fill(1);\n var w = [];\n for(i = 0; i < n; i++){\n w[i] = \"\";\n for(var j = 0; j < m; j++){\n if(x[i][0] > 0){x[i][0]--; w[i] += \"L\";}\n else if(x[i][0] < 0){x[i][0]++; w[i] += \"R\";}\n else if(x[i][1] > 0){x[i][1]--; w[i] += \"D\";}\n else{x[i][1]++; w[i] += \"U\";}\n }\n }\n return m + \"\\n\" + d.join(\" \") + \"\\n\" + w.join(\"\\n\");\n}", "problem_context": "Score : 600 points\n\nProblem Statement\n\nSnuke is introducing a robot arm with the following properties to his factory:\n\nThe robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.\n\nFor each section, its mode can be specified individually. There are four modes: L, R, D and U. The mode of a section decides the direction of that section. If we consider the factory as a coordinate plane, the position of Joint i will be determined as follows (we denote its coordinates as (x_i, y_i)):\n\n(x_0, y_0) = (0, 0).\n\nIf the mode of Section i is L, (x_{i}, y_{i}) = (x_{i-1} - d_{i}, y_{i-1}).\n\nIf the mode of Section i is R, (x_{i}, y_{i}) = (x_{i-1} + d_{i}, y_{i-1}).\n\nIf the mode of Section i is D, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} - d_{i}).\n\nIf the mode of Section i is U, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} + d_{i}).\n\nSnuke would like to introduce a robot arm so that the position of Joint m can be matched with all of the N points (X_1, Y_1), (X_2, Y_2), ..., (X_N, Y_N) by properly specifying the modes of the sections.\nIs this possible?\nIf so, find such a robot arm and how to bring Joint m to each point (X_j, Y_j).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 1000\n\n-10^9 \\leq X_i \\leq 10^9\n\n-10^9 \\leq Y_i \\leq 10^9\n\nPartial Score\n\nIn the test cases worth 300 points, -10 \\leq X_i \\leq 10 and -10 \\leq Y_i \\leq 10 hold.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1\nX_2 Y_2\n:\nX_N Y_N\n\nOutput\n\nIf the condition can be satisfied, follow the following format. If the condition cannot be satisfied, print -1.\n\nm\nd_1 d_2 ... d_m\nw_1\nw_2\n:\nw_N\n\nm and d_i are the configurations of the robot arm. Refer to the problem statement for what each of them means.\nHere, 1 \\leq m \\leq 40 and 1 \\leq d_i \\leq 10^{12} must hold. Also, m and d_i must all be integers.\n\nw_j is a string of length m that represents the way to bring Joint m of the robot arm to point (X_j, Y_j).\nThe i-th character of w_j should be one of the letters L, R, D and U, representing the mode of Section i.\n\nSample Input 1\n\n3\n-1 0\n0 3\n2 -1\n\nSample Output 1\n\n2\n1 2\nRL\nUU\nDR\n\nIn the given way to bring Joint m of the robot arm to each (X_j, Y_j), the positions of the joints will be as follows:\n\nTo (X_1, Y_1) = (-1, 0): First, the position of Joint 0 is (x_0, y_0) = (0, 0). As the mode of Section 1 is R, the position of Joint 1 is (x_1, y_1) = (1, 0). Then, as the mode of Section 2 is L, the position of Joint 2 is (x_2, y_2) = (-1, 0).\n\nTo (X_2, Y_2) = (0, 3): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, 1), (x_2, y_2) = (0, 3).\n\nTo (X_3, Y_3) = (2, -1): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, -1), (x_2, y_2) = (2, -1).\n\nSample Input 2\n\n5\n0 0\n1 0\n2 0\n3 0\n4 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n1 1\n1 1\n\nSample Output 3\n\n2\n1 1\nRU\nUR\n\nThere may be duplicated points among (X_j, Y_j).\n\nSample Input 4\n\n3\n-7 -3\n7 3\n-3 -7\n\nSample Output 4\n\n5\n3 1 4 1 5\nLRDUL\nRDULR\nDULRD", "sample_input": "3\n-1 0\n0 3\n2 -1\n"}, "reference_outputs": ["2\n1 2\nRL\nUU\nDR\n"], "source_document_id": "p03247", "source_text": "Score : 600 points\n\nProblem Statement\n\nSnuke is introducing a robot arm with the following properties to his factory:\n\nThe robot arm consists of m sections and m+1 joints. The sections are numbered 1, 2, ..., m, and the joints are numbered 0, 1, ..., m. Section i connects Joint i-1 and Joint i. The length of Section i is d_i.\n\nFor each section, its mode can be specified individually. There are four modes: L, R, D and U. The mode of a section decides the direction of that section. If we consider the factory as a coordinate plane, the position of Joint i will be determined as follows (we denote its coordinates as (x_i, y_i)):\n\n(x_0, y_0) = (0, 0).\n\nIf the mode of Section i is L, (x_{i}, y_{i}) = (x_{i-1} - d_{i}, y_{i-1}).\n\nIf the mode of Section i is R, (x_{i}, y_{i}) = (x_{i-1} + d_{i}, y_{i-1}).\n\nIf the mode of Section i is D, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} - d_{i}).\n\nIf the mode of Section i is U, (x_{i}, y_{i}) = (x_{i-1}, y_{i-1} + d_{i}).\n\nSnuke would like to introduce a robot arm so that the position of Joint m can be matched with all of the N points (X_1, Y_1), (X_2, Y_2), ..., (X_N, Y_N) by properly specifying the modes of the sections.\nIs this possible?\nIf so, find such a robot arm and how to bring Joint m to each point (X_j, Y_j).\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 1000\n\n-10^9 \\leq X_i \\leq 10^9\n\n-10^9 \\leq Y_i \\leq 10^9\n\nPartial Score\n\nIn the test cases worth 300 points, -10 \\leq X_i \\leq 10 and -10 \\leq Y_i \\leq 10 hold.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nX_1 Y_1\nX_2 Y_2\n:\nX_N Y_N\n\nOutput\n\nIf the condition can be satisfied, follow the following format. If the condition cannot be satisfied, print -1.\n\nm\nd_1 d_2 ... d_m\nw_1\nw_2\n:\nw_N\n\nm and d_i are the configurations of the robot arm. Refer to the problem statement for what each of them means.\nHere, 1 \\leq m \\leq 40 and 1 \\leq d_i \\leq 10^{12} must hold. Also, m and d_i must all be integers.\n\nw_j is a string of length m that represents the way to bring Joint m of the robot arm to point (X_j, Y_j).\nThe i-th character of w_j should be one of the letters L, R, D and U, representing the mode of Section i.\n\nSample Input 1\n\n3\n-1 0\n0 3\n2 -1\n\nSample Output 1\n\n2\n1 2\nRL\nUU\nDR\n\nIn the given way to bring Joint m of the robot arm to each (X_j, Y_j), the positions of the joints will be as follows:\n\nTo (X_1, Y_1) = (-1, 0): First, the position of Joint 0 is (x_0, y_0) = (0, 0). As the mode of Section 1 is R, the position of Joint 1 is (x_1, y_1) = (1, 0). Then, as the mode of Section 2 is L, the position of Joint 2 is (x_2, y_2) = (-1, 0).\n\nTo (X_2, Y_2) = (0, 3): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, 1), (x_2, y_2) = (0, 3).\n\nTo (X_3, Y_3) = (2, -1): (x_0, y_0) = (0, 0), (x_1, y_1) = (0, -1), (x_2, y_2) = (2, -1).\n\nSample Input 2\n\n5\n0 0\n1 0\n2 0\n3 0\n4 0\n\nSample Output 2\n\n-1\n\nSample Input 3\n\n2\n1 1\n1 1\n\nSample Output 3\n\n2\n1 1\nRU\nUR\n\nThere may be duplicated points among (X_j, Y_j).\n\nSample Input 4\n\n3\n-7 -3\n7 3\n-3 -7\n\nSample Output 4\n\n5\n3 1 4 1 5\nLRDUL\nRDULR\nDULRD", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1252, "cpu_time_ms": 60, "memory_kb": 8380}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s748271494", "group_id": "codeNet:p03253", "input_text": "const MOD = 10**9+7\n// factors[f].e+n-1、において max(n)=10**5, max(factors[f].e)=log(M)=log(10**9)=21\nconst N = 10**5+30\n\nlet fac = [...new Array(N)].fill(0)\nlet ifac = [...new Array(N)].fill(0)\nconst mul = (a,b) => ((a>>16)*b%MOD*65536+(a&65535)*b)%MOD;\n\nconst factorization = (n) => {\n let primes= []\n for(let i=2; i*i<=n; i++) {\n let exponent = 0\n while(n%i===0) {\n n /= i\n exponent++\n }\n if(exponent) {\n primes.push({p:i, e:exponent})\n }\n }\n \n if(n!==1) {\n primes.push({p:n, e:1})\n }\n return primes\n}\n\nconst mpow = (x, n) => {\n ans = 1;\n let _x = x\n while(n != 0){\n if(n & 1) ans = mul(ans,_x);\n _x = mul(_x,_x);\n n = n >> 1;\n }\n return ans;\n}\n\nconst comb = (n, r) => {\n if(n == 0 && r == 0) return 1;\n if(n < r || n < 0) return 0;\n const tmp = mul(ifac[n-r],ifac[r])\n return mul(tmp,fac[n])\n}\n\nconst init = () => {\n fac[0] = 1;\n ifac[0] = 1;\n for(let i=0; i {\n let [n, m] = arg.split(\" \").map(Number)\n let factors = factorization(m)\n let ans = 1\n init()\n Object.keys(factors).forEach(f=>{\n let a = factors[f].e+n-1\n let b = factors[f].e\n ans = mul(ans,comb(a, b))\n })\n console.log(ans)\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1599726732, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p03253.html", "problem_id": "p03253", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03253/input.txt", "sample_output_relpath": "derived/input_output/data/p03253/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03253/JavaScript/s748271494.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s748271494", "user_id": "u435256638"}, "prompt_components": {"gold_output": "4\n", "input_to_evaluate": "const MOD = 10**9+7\n// factors[f].e+n-1、において max(n)=10**5, max(factors[f].e)=log(M)=log(10**9)=21\nconst N = 10**5+30\n\nlet fac = [...new Array(N)].fill(0)\nlet ifac = [...new Array(N)].fill(0)\nconst mul = (a,b) => ((a>>16)*b%MOD*65536+(a&65535)*b)%MOD;\n\nconst factorization = (n) => {\n let primes= []\n for(let i=2; i*i<=n; i++) {\n let exponent = 0\n while(n%i===0) {\n n /= i\n exponent++\n }\n if(exponent) {\n primes.push({p:i, e:exponent})\n }\n }\n \n if(n!==1) {\n primes.push({p:n, e:1})\n }\n return primes\n}\n\nconst mpow = (x, n) => {\n ans = 1;\n let _x = x\n while(n != 0){\n if(n & 1) ans = mul(ans,_x);\n _x = mul(_x,_x);\n n = n >> 1;\n }\n return ans;\n}\n\nconst comb = (n, r) => {\n if(n == 0 && r == 0) return 1;\n if(n < r || n < 0) return 0;\n const tmp = mul(ifac[n-r],ifac[r])\n return mul(tmp,fac[n])\n}\n\nconst init = () => {\n fac[0] = 1;\n ifac[0] = 1;\n for(let i=0; i {\n let [n, m] = arg.split(\" \").map(Number)\n let factors = factorization(m)\n let ans = 1\n init()\n Object.keys(factors).forEach(f=>{\n let a = factors[f].e+n-1\n let b = factors[f].e\n ans = mul(ans,comb(a, b))\n })\n console.log(ans)\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nYou are given positive integers N and M.\n\nHow many sequences a of length N consisting of positive integers satisfy a_1 \\times a_2 \\times ... \\times a_N = M? Find the count modulo 10^9+7.\n\nHere, two sequences a' and a'' are considered different when there exists some i such that a_i' \\neq a_i''.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n2 6\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: \\{a_1, a_2\\} = \\{1, 6\\}, \\{2, 3\\}, \\{3, 2\\} and \\{6, 1\\}.\n\nSample Input 2\n\n3 12\n\nSample Output 2\n\n18\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n957870001", "sample_input": "2 6\n"}, "reference_outputs": ["4\n"], "source_document_id": "p03253", "source_text": "Score : 400 points\n\nProblem Statement\n\nYou are given positive integers N and M.\n\nHow many sequences a of length N consisting of positive integers satisfy a_1 \\times a_2 \\times ... \\times a_N = M? Find the count modulo 10^9+7.\n\nHere, two sequences a' and a'' are considered different when there exists some i such that a_i' \\neq a_i''.\n\nConstraints\n\nAll values in input are integers.\n\n1 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\n\nOutput\n\nPrint the number of the sequences consisting of positive integers that satisfy the condition, modulo 10^9 + 7.\n\nSample Input 1\n\n2 6\n\nSample Output 1\n\n4\n\nFour sequences satisfy the condition: \\{a_1, a_2\\} = \\{1, 6\\}, \\{2, 3\\}, \\{3, 2\\} and \\{6, 1\\}.\n\nSample Input 2\n\n3 12\n\nSample Output 2\n\n18\n\nSample Input 3\n\n100000 1000000000\n\nSample Output 3\n\n957870001", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1472, "cpu_time_ms": 191, "memory_kb": 37432}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s530051618", "group_id": "codeNet:p03254", "input_text": "var s = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nvar n = parseInt(s.split(\"\\n\")[0].split(\" \")[0], 10);\nvar x = parseInt(s.split(\"\\n\")[0].split(\" \")[1], 10);\nvar a = s.split(\"\\n\")[1].split(\" \").map(e => parseInt(e, 10)).sort((a, b) => a - b);\nvar cnt = 0;\nfor (var i = 0; i < n; i++) {\n if (x >= a[i]) {\n x -= a[i];\n cnt++;\n } else {\n break;\n }\n}\nif (x > 0 && cnt >= n) {\n cnt--;\n}\nconsole.log(cnt);\n", "language": "JavaScript", "metadata": {"date": 1568582543, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/JavaScript/s530051618.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s530051618", "user_id": "u392029857"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "var s = require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\");\nvar n = parseInt(s.split(\"\\n\")[0].split(\" \")[0], 10);\nvar x = parseInt(s.split(\"\\n\")[0].split(\" \")[1], 10);\nvar a = s.split(\"\\n\")[1].split(\" \").map(e => parseInt(e, 10)).sort((a, b) => a - b);\nvar cnt = 0;\nfor (var i = 0; i < n; i++) {\n if (x >= a[i]) {\n x -= a[i];\n cnt++;\n } else {\n break;\n }\n}\nif (x > 0 && cnt >= n) {\n cnt--;\n}\nconsole.log(cnt);\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 421, "cpu_time_ms": 236, "memory_kb": 21192}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s119644492", "group_id": "codeNet:p03254", "input_text": "function Main(input) {\n var inputs = input.split(\"\\n\");\n var n = parseInt(inputs[0].split(\" \")[0], 10);\n var x = parseInt(inputs[0].split(\" \")[1], 10);\n var a = inputs[1].split(\" \").map(e => parseInt(e, 10)).sort();\n var cnt = 0;\n var i = 0;\n while(true) {\n if (x > a[i]) {\n x -= a[i];\n cnt++;\n if (i === n - 1) {\n cnt--;\n break;\n }\n } else if (x === a[i]) {\n x -= a[i];\n cnt++;\n break;\n } else {\n break;\n }\n i++;\n }\n console.log(cnt);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1568578142, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/JavaScript/s119644492.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s119644492", "user_id": "u392029857"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "function Main(input) {\n var inputs = input.split(\"\\n\");\n var n = parseInt(inputs[0].split(\" \")[0], 10);\n var x = parseInt(inputs[0].split(\" \")[1], 10);\n var a = inputs[1].split(\" \").map(e => parseInt(e, 10)).sort();\n var cnt = 0;\n var i = 0;\n while(true) {\n if (x > a[i]) {\n x -= a[i];\n cnt++;\n if (i === n - 1) {\n cnt--;\n break;\n }\n } else if (x === a[i]) {\n x -= a[i];\n cnt++;\n break;\n } else {\n break;\n }\n i++;\n }\n console.log(cnt);\n}\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 573, "cpu_time_ms": 55, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s114965652", "group_id": "codeNet:p03254", "input_text": "\"use strict\";\n\nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n let x = parseInt(arg[0].split(\" \")[1]);\n let a = new Array(N);\n let tmp = arg[1].split(\" \");\n let sum =0;\n for(let i=0;i=a[i]){\n\t\tans++;\n\t\tx-=a[i];\n\t }else{\n\t\t break;\n\t }\n }\n \n if(num>sum){\n\t ans=N-1;\n }\n console.log(ans);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1561656941, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03254.html", "problem_id": "p03254", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03254/input.txt", "sample_output_relpath": "derived/input_output/data/p03254/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03254/JavaScript/s114965652.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s114965652", "user_id": "u598795006"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "\"use strict\";\n\nconst main = arg => {\n arg = arg.trim().split(\"\\n\");\n const N = parseInt(arg[0].split(\" \")[0]);\n let x = parseInt(arg[0].split(\" \")[1]);\n let a = new Array(N);\n let tmp = arg[1].split(\" \");\n let sum =0;\n for(let i=0;i=a[i]){\n\t\tans++;\n\t\tx-=a[i];\n\t }else{\n\t\t break;\n\t }\n }\n \n if(num>sum){\n\t ans=N-1;\n }\n console.log(ans);\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "sample_input": "3 70\n20 30 10\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03254", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere are N children, numbered 1, 2, ..., N.\n\nSnuke has decided to distribute x sweets among them.\nHe needs to give out all the x sweets, but some of the children may get zero sweets.\n\nFor each i (1 \\leq i \\leq N), Child i will be happy if he/she gets exactly a_i sweets.\nSnuke is trying to maximize the number of happy children by optimally distributing the sweets.\nFind the maximum possible number of happy children.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 100\n\n1 \\leq x \\leq 10^9\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN x\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum possible number of happy children.\n\nSample Input 1\n\n3 70\n20 30 10\n\nSample Output 1\n\n2\n\nOne optimal way to distribute sweets is (20, 30, 20).\n\nSample Input 2\n\n3 10\n20 30 10\n\nSample Output 2\n\n1\n\nThe optimal way to distribute sweets is (0, 0, 10).\n\nSample Input 3\n\n4 1111\n1 10 100 1000\n\nSample Output 3\n\n4\n\nThe optimal way to distribute sweets is (1, 10, 100, 1000).\n\nSample Input 4\n\n2 10\n20 20\n\nSample Output 4\n\n0\n\nNo children will be happy, no matter how the sweets are distributed.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 563, "cpu_time_ms": 53, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s648100791", "group_id": "codeNet:p03265", "input_text": "'use strict';\n\nconst main = (input) => {\n const nums = input.split(' ');\n const x1 = parseInt(nums[0], 10);\n const y1 = parseInt(nums[1], 10);\n const x2 = parseInt(nums[2], 10);\n const y2 = parseInt(nums[3], 10);\n const xdiff = x2 - x1;\n const ydiff = y2 - y1;\n const x3 = x2 - ydiff;\n const y3 = y2 + xdiff;\n const x4 = x3 - xdiff;\n const y4 = y3 - ydiff;\n console.log(x3 + ' ' + y3 + ' ' + x4 + ' ' + y4);\n};\n\nconst isTest = false;\n\nif (isTest) {\n main('0 0 0 1');\n main('2 3 6 6');\n main('31 -41 -59 26');\n} else {\n main(require('fs').readFileSync('/dev/stdin', 'utf8'));\n}", "language": "JavaScript", "metadata": {"date": 1535851773, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03265.html", "problem_id": "p03265", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03265/input.txt", "sample_output_relpath": "derived/input_output/data/p03265/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03265/JavaScript/s648100791.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s648100791", "user_id": "u834061765"}, "prompt_components": {"gold_output": "-1 1 -1 0\n", "input_to_evaluate": "'use strict';\n\nconst main = (input) => {\n const nums = input.split(' ');\n const x1 = parseInt(nums[0], 10);\n const y1 = parseInt(nums[1], 10);\n const x2 = parseInt(nums[2], 10);\n const y2 = parseInt(nums[3], 10);\n const xdiff = x2 - x1;\n const ydiff = y2 - y1;\n const x3 = x2 - ydiff;\n const y3 = y2 + xdiff;\n const x4 = x3 - xdiff;\n const y4 = y3 - ydiff;\n console.log(x3 + ' ' + y3 + ' ' + x4 + ' ' + y4);\n};\n\nconst isTest = false;\n\nif (isTest) {\n main('0 0 0 1');\n main('2 3 6 6');\n main('31 -41 -59 26');\n} else {\n main(require('fs').readFileSync('/dev/stdin', 'utf8'));\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nThere is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.\n(Assume that the positive x-axis points right, and the positive y-axis points up.)\n\nTakahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).\n\nGiven x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.\n\nConstraints\n\n|x_1|,|y_1|,|x_2|,|y_2| \\leq 100\n\n(x_1,y_1) ≠ (x_2,y_2)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 y_1 x_2 y_2\n\nOutput\n\nPrint x_3,y_3,x_4 and y_4 as integers, in this order.\n\nSample Input 1\n\n0 0 0 1\n\nSample Output 1\n\n-1 1 -1 0\n\n(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.\nNote that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.\n\nSample Input 2\n\n2 3 6 6\n\nSample Output 2\n\n3 10 -1 7\n\nSample Input 3\n\n31 -41 -59 26\n\nSample Output 3\n\n-126 -64 -36 -131", "sample_input": "0 0 0 1\n"}, "reference_outputs": ["-1 1 -1 0\n"], "source_document_id": "p03265", "source_text": "Score : 200 points\n\nProblem Statement\n\nThere is a square in the xy-plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order.\n(Assume that the positive x-axis points right, and the positive y-axis points up.)\n\nTakahashi remembers (x_1,y_1) and (x_2,y_2), but he has forgot (x_3,y_3) and (x_4,y_4).\n\nGiven x_1,x_2,y_1,y_2, restore x_3,y_3,x_4,y_4. It can be shown that x_3,y_3,x_4 and y_4 uniquely exist and have integer values.\n\nConstraints\n\n|x_1|,|y_1|,|x_2|,|y_2| \\leq 100\n\n(x_1,y_1) ≠ (x_2,y_2)\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nx_1 y_1 x_2 y_2\n\nOutput\n\nPrint x_3,y_3,x_4 and y_4 as integers, in this order.\n\nSample Input 1\n\n0 0 0 1\n\nSample Output 1\n\n-1 1 -1 0\n\n(0,0),(0,1),(-1,1),(-1,0) is the four vertices of a square in counter-clockwise order.\nNote that (x_3,y_3)=(1,1),(x_4,y_4)=(1,0) is not accepted, as the vertices are in clockwise order.\n\nSample Input 2\n\n2 3 6 6\n\nSample Output 2\n\n3 10 -1 7\n\nSample Input 3\n\n31 -41 -59 26\n\nSample Output 3\n\n-126 -64 -36 -131", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 624, "cpu_time_ms": 759, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s256634506", "group_id": "codeNet:p03266", "input_text": "\"use strict\"\n\nfunction main(input) {\n input = input.split(/\\n|\\s/).map(v => ~~v)\n const N = input[0]\n const K = input[1]\n\n let ans = 0\n\n if (K % 2 === 1) {\n //奇数\n for (let i = 1; i <= N; i++) {\n if (i % K === 0) ans++\n }\n ans = Math.pow(ans, 3)\n } else {\n //偶数\n let tmp = 0\n let tmp2 = 0\n for (let i = 1; i <= N; i++) {\n if (i % K === K / 2) {\n tmp++\n }\n if (i % K === 0) {\n tmp2++\n }\n }\n ans += Math.pow(tmp, 3)\n ans += Math.pow(tmp2, 3)\n }\n\n console.log(ans)\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "language": "JavaScript", "metadata": {"date": 1537239432, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03266.html", "problem_id": "p03266", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03266/input.txt", "sample_output_relpath": "derived/input_output/data/p03266/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03266/JavaScript/s256634506.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s256634506", "user_id": "u032263881"}, "prompt_components": {"gold_output": "9\n", "input_to_evaluate": "\"use strict\"\n\nfunction main(input) {\n input = input.split(/\\n|\\s/).map(v => ~~v)\n const N = input[0]\n const K = input[1]\n\n let ans = 0\n\n if (K % 2 === 1) {\n //奇数\n for (let i = 1; i <= N; i++) {\n if (i % K === 0) ans++\n }\n ans = Math.pow(ans, 3)\n } else {\n //偶数\n let tmp = 0\n let tmp2 = 0\n for (let i = 1; i <= N; i++) {\n if (i % K === K / 2) {\n tmp++\n }\n if (i % K === 0) {\n tmp2++\n }\n }\n ans += Math.pow(tmp, 3)\n ans += Math.pow(tmp2, 3)\n }\n\n console.log(ans)\n}\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "sample_input": "3 2\n"}, "reference_outputs": ["9\n"], "source_document_id": "p03266", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\nThe order of a,b,c does matter, and some of them can be the same.\n\nConstraints\n\n1 \\leq N,K \\leq 2\\times 10^5\n\nN and K are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\n\nOutput\n\nPrint the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multiples of K.\n\nSample Input 1\n\n3 2\n\nSample Output 1\n\n9\n\n(1,1,1),(1,1,3),(1,3,1),(1,3,3),(2,2,2),(3,1,1),(3,1,3),(3,3,1) and (3,3,3) satisfy the condition.\n\nSample Input 2\n\n5 3\n\nSample Output 2\n\n1\n\nSample Input 3\n\n31415 9265\n\nSample Output 3\n\n27\n\nSample Input 4\n\n35897 932\n\nSample Output 4\n\n114191", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 605, "cpu_time_ms": 57, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s737947064", "group_id": "codeNet:p03272", "input_text": "const main = stdin => {\n const input = stdin.trim().split('\\n')\n const [N, i] = input[0].split(' ').map(x => parseInt(x))\n\n console.log(N - i + 1)\n}\n// 標準入力\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))\n", "language": "JavaScript", "metadata": {"date": 1599522709, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p03272.html", "problem_id": "p03272", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03272/input.txt", "sample_output_relpath": "derived/input_output/data/p03272/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03272/JavaScript/s737947064.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s737947064", "user_id": "u825925638"}, "prompt_components": {"gold_output": "3\n", "input_to_evaluate": "const main = stdin => {\n const input = stdin.trim().split('\\n')\n const [N, i] = input[0].split(' ').map(x => parseInt(x))\n\n console.log(N - i + 1)\n}\n// 標準入力\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nThere is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: \"the i-th car from the front of the train is the j-th car from the back.\"\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN i\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n\nSample Output 1\n\n3\n\nThe second car from the front of a 4-car train is the third car from the back.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n15 11\n\nSample Output 3\n\n5", "sample_input": "4 2\n"}, "reference_outputs": ["3\n"], "source_document_id": "p03272", "source_text": "Score : 100 points\n\nProblem Statement\n\nThere is an N-car train.\n\nYou are given an integer i. Find the value of j such that the following statement is true: \"the i-th car from the front of the train is the j-th car from the back.\"\n\nConstraints\n\n1 \\leq N \\leq 100\n\n1 \\leq i \\leq N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN i\n\nOutput\n\nPrint the answer.\n\nSample Input 1\n\n4 2\n\nSample Output 1\n\n3\n\nThe second car from the front of a 4-car train is the third car from the back.\n\nSample Input 2\n\n1 1\n\nSample Output 2\n\n1\n\nSample Input 3\n\n15 11\n\nSample Output 3\n\n5", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 223, "cpu_time_ms": 59, "memory_kb": 29592}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s791932015", "group_id": "codeNet:p03274", "input_text": "function get_run_length(min, max){\n var result = 0;\n\n var right = Math.abs(max-min)+Math.abs(max);\n var left = Math.abs(max-min)+Math.abs(min);\n\n return Math.min(...[left, right]);;\n}\n\nfunction main(input){\n const lines = input.split('\\n');\n const N = parseInt(lines[0].split(' ')[0]);\n const K = parseInt(lines[0].split(' ')[1]);\n const Xs = lines[1].split(' ').map(x => parseInt(x))\n\n var result = 1e7;\n for(var i=0;i parseInt(x))\n\n var result = 1e7;\n for(var i=0;i {\n input = input.split('\\n')\n const N = parseInt(input[0].split(' ')[0])\n const K = parseInt(input[0].split(' ')[1])\n const arr = input[1].split(' ').map(v => parseInt(v))\n\n let dist = 100000000000\n // 通るべき点を調べ上げる\n for(let i = 0; i <= arr.length - K; i++){\n let left = arr[i]\n let right = arr[i + K - 1]\n // 左端からスタートするときの距離\n const a = Math.abs(left) + Math.abs(left - right)\n // 右端からスタートするときの距離\n const b = Math.abs(right) + Math.abs(right - left)\n const min = Math.min(a, b)\n if(dist > min){\n dist = min\n }\n }\n console.log(dist)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf-8'))", "language": "JavaScript", "metadata": {"date": 1543679751, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03274.html", "problem_id": "p03274", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03274/input.txt", "sample_output_relpath": "derived/input_output/data/p03274/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03274/JavaScript/s908916796.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s908916796", "user_id": "u084879520"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "'use strict'\n\nconst main = (input) => {\n input = input.split('\\n')\n const N = parseInt(input[0].split(' ')[0])\n const K = parseInt(input[0].split(' ')[1])\n const arr = input[1].split(' ').map(v => parseInt(v))\n\n let dist = 100000000000\n // 通るべき点を調べ上げる\n for(let i = 0; i <= arr.length - K; i++){\n let left = arr[i]\n let right = arr[i + K - 1]\n // 左端からスタートするときの距離\n const a = Math.abs(left) + Math.abs(left - right)\n // 右端からスタートするときの距離\n const b = Math.abs(right) + Math.abs(right - left)\n const min = Math.min(a, b)\n if(dist > min){\n dist = min\n }\n }\n console.log(dist)\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf-8'))", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "sample_input": "5 3\n-30 -10 10 20 50\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03274", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 808, "cpu_time_ms": 1171, "memory_kb": 22204}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s349263283", "group_id": "codeNet:p03276", "input_text": "function Main(input) {\n input=input.split(\"\\n\");\n if(input[input.length-1]===''){\n input.pop();\n }\n const N=input[0].split(' ')[0]-0;\n const K=input[0].split(' ')[1]-0;\n const x=input[1].split(' ').map(e=>{\n return e-0;\n });\n var pointer=x.findIndex(e=>{\n return e=>0;\n })-K;\n if(pointer<0){\n pointer=0;\n }\n var temp;\n var ret=Infinity;\n for(var i=0;i=x.length){\n break;\n }\n if(x[pointer+i]*x[pointer+i+K-1]<0){\n temp=Math.min(-x[pointer+i],x[pointer+i+K-1])-x[pointer+i]+x[pointer+i+K-1];\n }else{\n temp=Math.max(Math.abs(x[pointer+i]),Math.abs(x[pointer+i+K-1]));\n }\n ret=Math.min(ret,temp);\n }\n console.log(ret);\n \n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1600871269, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p03276.html", "problem_id": "p03276", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03276/input.txt", "sample_output_relpath": "derived/input_output/data/p03276/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03276/JavaScript/s349263283.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s349263283", "user_id": "u862192359"}, "prompt_components": {"gold_output": "40\n", "input_to_evaluate": "function Main(input) {\n input=input.split(\"\\n\");\n if(input[input.length-1]===''){\n input.pop();\n }\n const N=input[0].split(' ')[0]-0;\n const K=input[0].split(' ')[1]-0;\n const x=input[1].split(' ').map(e=>{\n return e-0;\n });\n var pointer=x.findIndex(e=>{\n return e=>0;\n })-K;\n if(pointer<0){\n pointer=0;\n }\n var temp;\n var ret=Infinity;\n for(var i=0;i=x.length){\n break;\n }\n if(x[pointer+i]*x[pointer+i+K-1]<0){\n temp=Math.min(-x[pointer+i],x[pointer+i+K-1])-x[pointer+i]+x[pointer+i+K-1];\n }else{\n temp=Math.max(Math.abs(x[pointer+i]),Math.abs(x[pointer+i+K-1]));\n }\n ret=Math.min(ret,temp);\n }\n console.log(ret);\n \n}\n\n//*この行以降は編集しないでください(標準入出力から一度に読み込み、Mainを呼び出します)\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "sample_input": "5 3\n-30 -10 10 20 50\n"}, "reference_outputs": ["40\n"], "source_document_id": "p03276", "source_text": "Score : 300 points\n\nProblem Statement\n\nThere are N candles placed on a number line.\nThe i-th candle from the left is placed on coordinate x_i.\nHere, x_1 < x_2 < ... < x_N holds.\n\nInitially, no candles are burning.\nSnuke decides to light K of the N candles.\n\nNow, he is at coordinate 0.\nHe can move left and right along the line with speed 1.\nHe can also light a candle when he is at the same position as the candle, in negligible time.\n\nFind the minimum time required to light K candles.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\n1 \\leq K \\leq N\n\nx_i is an integer.\n\n|x_i| \\leq 10^8\n\nx_1 < x_2 < ... < x_N\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN K\nx_1 x_2 ... x_N\n\nOutput\n\nPrint the minimum time required to light K candles.\n\nSample Input 1\n\n5 3\n-30 -10 10 20 50\n\nSample Output 1\n\n40\n\nHe should move and light candles as follows:\n\nMove from coordinate 0 to -10.\n\nLight the second candle from the left.\n\nMove from coordinate -10 to 10.\n\nLight the third candle from the left.\n\nMove from coordinate 10 to 20.\n\nLight the fourth candle from the left.\n\nSample Input 2\n\n3 2\n10 20 30\n\nSample Output 2\n\n20\n\nSample Input 3\n\n1 1\n0\n\nSample Output 3\n\n0\n\nThere may be a candle placed at coordinate 0.\n\nSample Input 4\n\n8 5\n-9 -7 -4 -3 1 2 3 4\n\nSample Output 4\n\n10", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 897, "cpu_time_ms": 93, "memory_kb": 39512}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s397038418", "group_id": "codeNet:p03277", "input_text": "function gets(str){\n this._s = str.split(\"\\n\");\n this._y = 0;\n};\ngets.prototype = {\n a: function(f){\n var s = this._s, y = this._y, r;\n if(typeof s[y] === \"string\")s[y] = s[y].split(\" \").reverse();\n r = s[y].pop();\n if(!s[y].length)this._y++;\n return f?r:+r;\n },\n l: function(f){\n var s = this._s[this._y++].split(\" \");\n return f?s:s.map(a=>+a);\n },\n m: function(n,f){\n var s = this._s, y = this._y, r = [], i = 0;\n if(f)for(;i < n; i++)r[i] = s[y+i].split(\" \");\n else for(;i < n; i++)r[i] = s[y+i].split(\" \").map(a=>+a);\n this._y += n;\n return r;\n },\n};\nvar o=new gets(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nfunction inv(a){\n this._a = Array(a).fill(0);\n}\ninv.prototype = {\n u:function(x,w){for(;x> 1;\n var b = n+1, k = 0, z = new inv(b*2);\n z.u(b,1);\n for(var i = 0; i < n; i++){\n k += z.q(a[i] < m ? --b : ++b);\n z.u(b,1);\n }\n k = n * (n+1) / 2 - k;\n if(k < p)l = m+1; else r = m;\n }\n return l-1;\n}", "language": "JavaScript", "metadata": {"date": 1535510422, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03277.html", "problem_id": "p03277", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03277/input.txt", "sample_output_relpath": "derived/input_output/data/p03277/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03277/JavaScript/s397038418.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s397038418", "user_id": "u643613120"}, "prompt_components": {"gold_output": "30\n", "input_to_evaluate": "function gets(str){\n this._s = str.split(\"\\n\");\n this._y = 0;\n};\ngets.prototype = {\n a: function(f){\n var s = this._s, y = this._y, r;\n if(typeof s[y] === \"string\")s[y] = s[y].split(\" \").reverse();\n r = s[y].pop();\n if(!s[y].length)this._y++;\n return f?r:+r;\n },\n l: function(f){\n var s = this._s[this._y++].split(\" \");\n return f?s:s.map(a=>+a);\n },\n m: function(n,f){\n var s = this._s, y = this._y, r = [], i = 0;\n if(f)for(;i < n; i++)r[i] = s[y+i].split(\" \");\n else for(;i < n; i++)r[i] = s[y+i].split(\" \").map(a=>+a);\n this._y += n;\n return r;\n },\n};\nvar o=new gets(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));\n\nfunction inv(a){\n this._a = Array(a).fill(0);\n}\ninv.prototype = {\n u:function(x,w){for(;x> 1;\n var b = n+1, k = 0, z = new inv(b*2);\n z.u(b,1);\n for(var i = 0; i < n; i++){\n k += z.q(a[i] < m ? --b : ++b);\n z.u(b,1);\n }\n k = n * (n+1) / 2 - k;\n if(k < p)l = m+1; else r = m;\n }\n return l-1;\n}", "problem_context": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\na_i is an integer.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "sample_input": "3\n10 30 20\n"}, "reference_outputs": ["30\n"], "source_document_id": "p03277", "source_text": "Score : 700 points\n\nProblem Statement\n\nWe will define the median of a sequence b of length M, as follows:\n\nLet b' be the sequence obtained by sorting b in non-decreasing order. Then, the value of the (M / 2 + 1)-th element of b' is the median of b. Here, / is integer division, rounding down.\n\nFor example, the median of (10, 30, 20) is 20; the median of (10, 30, 20, 40) is 30; the median of (10, 10, 10, 20, 30) is 10.\n\nSnuke comes up with the following problem.\n\nYou are given a sequence a of length N.\nFor each pair (l, r) (1 \\leq l \\leq r \\leq N), let m_{l, r} be the median of the contiguous subsequence (a_l, a_{l + 1}, ..., a_r) of a.\nWe will list m_{l, r} for all pairs (l, r) to create a new sequence m.\nFind the median of m.\n\nConstraints\n\n1 \\leq N \\leq 10^5\n\na_i is an integer.\n\n1 \\leq a_i \\leq 10^9\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the median of m.\n\nSample Input 1\n\n3\n10 30 20\n\nSample Output 1\n\n30\n\nThe median of each contiguous subsequence of a is as follows:\n\nThe median of (10) is 10.\n\nThe median of (30) is 30.\n\nThe median of (20) is 20.\n\nThe median of (10, 30) is 30.\n\nThe median of (30, 20) is 30.\n\nThe median of (10, 30, 20) is 20.\n\nThus, m = (10, 30, 20, 30, 30, 20) and the median of m is 30.\n\nSample Input 2\n\n1\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n10\n5 9 5 9 8 9 3 5 4 3\n\nSample Output 3\n\n8", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1304, "cpu_time_ms": 393, "memory_kb": 75516}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s810405713", "group_id": "codeNet:p03280", "input_text": "function Main(input) {\n input = input.trim()\n input = input.split(\" \")\n console.log((input[0]-1)*(input[1]-1))\n}Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1579057967, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03280.html", "problem_id": "p03280", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03280/input.txt", "sample_output_relpath": "derived/input_output/data/p03280/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03280/JavaScript/s810405713.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s810405713", "user_id": "u938152299"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n input = input.trim()\n input = input.split(\" \")\n console.log((input[0]-1)*(input[1]-1))\n}Main(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 100 points\n\nProblem Statement\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)\n\nWhat is the area of this yard excluding the roads? Find it.\n\nNote\n\nIt can be proved that the positions of the roads do not affect the area.\n\nConstraints\n\nA is an integer between 2 and 100 (inclusive).\n\nB is an integer between 2 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the area of this yard excluding the roads (in square yards).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n1\n\nIn this case, the area is 1 square yard.\n\nSample Input 2\n\n5 7\n\nSample Output 2\n\n24\n\nIn this case, the area is 24 square yards.", "sample_input": "2 2\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03280", "source_text": "Score: 100 points\n\nProblem Statement\n\nThere is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.)\n\nWhat is the area of this yard excluding the roads? Find it.\n\nNote\n\nIt can be proved that the positions of the roads do not affect the area.\n\nConstraints\n\nA is an integer between 2 and 100 (inclusive).\n\nB is an integer between 2 and 100 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nA B\n\nOutput\n\nPrint the area of this yard excluding the roads (in square yards).\n\nSample Input 1\n\n2 2\n\nSample Output 1\n\n1\n\nIn this case, the area is 1 square yard.\n\nSample Input 2\n\n5 7\n\nSample Output 2\n\n24\n\nIn this case, the area is 24 square yards.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 171, "cpu_time_ms": 223, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s889318166", "group_id": "codeNet:p03281", "input_text": "function Main(input) {\n input = input.split(\"\\n\");\n const N = parseInt(input[0],10);\n let ans = 0;\n for (var n = 0; n <= N; n++) {\n if (n % 2 === 0) continue;\n let count = 0;\n for (var i = 1; i <= n; i++) {\n if (n % i === 0) {\n count++;\n }\n }\n if (count === 8) {\n ans++;\n }\n }\n console.log(ans);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "language": "JavaScript", "metadata": {"date": 1596989773, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/JavaScript/s889318166.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s889318166", "user_id": "u785463294"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Main(input) {\n input = input.split(\"\\n\");\n const N = parseInt(input[0],10);\n let ans = 0;\n for (var n = 0; n <= N; n++) {\n if (n % 2 === 0) continue;\n let count = 0;\n for (var i = 1; i <= n; i++) {\n if (n % i === 0) {\n count++;\n }\n }\n if (count === 8) {\n ans++;\n }\n }\n console.log(ans);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 400, "cpu_time_ms": 223, "memory_kb": 30556}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s817040071", "group_id": "codeNet:p03281", "input_text": "function Divisor(num) {\n var ret = 0;\n for (var p = 1; p <= num; p++) if (num % p == 0) ret++;\n return ret;\n}\nfunction Main(input) {\n var cnt = 0;\n N = Number(input);\n for (var i = 1; i <= N; i+=2) if (Divisor(i) == 8) cnt++;\n console.log(cnt);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1553044773, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03281.html", "problem_id": "p03281", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03281/input.txt", "sample_output_relpath": "derived/input_output/data/p03281/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03281/JavaScript/s817040071.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s817040071", "user_id": "u024469792"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function Divisor(num) {\n var ret = 0;\n for (var p = 1; p <= num; p++) if (num % p == 0) ret++;\n return ret;\n}\nfunction Main(input) {\n var cnt = 0;\n N = Number(input);\n for (var i = 1; i <= N; i+=2) if (Divisor(i) == 8) cnt++;\n console.log(cnt);\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "sample_input": "105\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03281", "source_text": "Score: 200 points\n\nProblem Statement\n\nThe number 105 is quite special - it is odd but still it has eight divisors.\nNow, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)?\n\nConstraints\n\nN is an integer between 1 and 200 (inclusive).\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the count.\n\nSample Input 1\n\n105\n\nSample Output 1\n\n1\n\nAmong the numbers between 1 and 105, the only number that is odd and has exactly eight divisors is 105.\n\nSample Input 2\n\n7\n\nSample Output 2\n\n0\n\n1 has one divisor. 3, 5 and 7 are all prime and have two divisors. Thus, there is no number that satisfies the condition.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 323, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s203869567", "group_id": "codeNet:p03284", "input_text": "function main(input){\n var int = Number.parseInt(input);\n var sum = 0;\n var result = 'No';\n \n CakeDonut:\n for(let i=0;sum {\n const N = parseInt(input)\n\n for(let i = 0; i <= 25; i++){\n for(let j = 0; j <= 25; j++){\n let total = i * 4 + j * 7\n if(total === N){\n console.log('Yes')\n return\n }\n }\n }\n console.log('No')\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf-8'))", "language": "JavaScript", "metadata": {"date": 1542480695, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/JavaScript/s638680002.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s638680002", "user_id": "u084879520"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict'\n\nconst main = (input) => {\n const N = parseInt(input)\n\n for(let i = 0; i <= 25; i++){\n for(let j = 0; j <= 25; j++){\n let total = i * 4 + j * 7\n if(total === N){\n console.log('Yes')\n return\n }\n }\n }\n console.log('No')\n}\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf-8'))", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 378, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s388012325", "group_id": "codeNet:p03285", "input_text": "'use strict'\nfunction Main(input) {\n input = input.split(\"\\n\")\n let N = parseInt(input[0])\n if (N === 1 || N === 5) {\n console.log('No')\n return\n }\n if (N % 4 === 0 || N % 4 === 1) {\n console.log('Yes')\n return\n }\n console.log('No')\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "language": "JavaScript", "metadata": {"date": 1534524008, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/JavaScript/s388012325.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s388012325", "user_id": "u145071961"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "'use strict'\nfunction Main(input) {\n input = input.split(\"\\n\")\n let N = parseInt(input[0])\n if (N === 1 || N === 5) {\n console.log('No')\n return\n }\n if (N % 4 === 0 || N % 4 === 1) {\n console.log('Yes')\n return\n }\n console.log('No')\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"))", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 308, "cpu_time_ms": 51, "memory_kb": 11468}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s108567411", "group_id": "codeNet:p03285", "input_text": "var toInt = x=>parseInt(x,10);\nvar toIntArr = arr=>arr.map(x=>toInt(x));\nvar abs = x=>x>0?x:-x;\nfunction min(){var rest = arguments,val=rest[0];for(var i=1;ival)val = rest[i];return val}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \nfunction Main(input){\n\tvar input = input.split('\\n');\n\tvar n = toInt(input[0]);\n\n\tfor(var i = 0; i < 26; i++){\n\t\tfor(var j = 0; j < 15; j++){\n\t\t\tif(4*i + 7*j === n){\n\t\t\t\tconsole.log('Yes');\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tconsole.log('No');\n\n}", "language": "JavaScript", "metadata": {"date": 1534036033, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03285.html", "problem_id": "p03285", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03285/input.txt", "sample_output_relpath": "derived/input_output/data/p03285/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03285/JavaScript/s108567411.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s108567411", "user_id": "u511119682"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "var toInt = x=>parseInt(x,10);\nvar toIntArr = arr=>arr.map(x=>toInt(x));\nvar abs = x=>x>0?x:-x;\nfunction min(){var rest = arguments,val=rest[0];for(var i=1;ival)val = rest[i];return val}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n \nfunction Main(input){\n\tvar input = input.split('\\n');\n\tvar n = toInt(input[0]);\n\n\tfor(var i = 0; i < 26; i++){\n\t\tfor(var j = 0; j < 15; j++){\n\t\t\tif(4*i + 7*j === n){\n\t\t\t\tconsole.log('Yes');\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\tconsole.log('No');\n\n}", "problem_context": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "sample_input": "11\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03285", "source_text": "Score : 200 points\n\nProblem Statement\n\nLa Confiserie d'ABC sells cakes at 4 dollars each and doughnuts at 7 dollars each.\nDetermine if there is a way to buy some of them for exactly N dollars. You can buy two or more doughnuts and two or more cakes, and you can also choose to buy zero doughnuts or zero cakes.\n\nConstraints\n\nN is an integer between 1 and 100, inclusive.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nIf there is a way to buy some cakes and some doughnuts for exactly N dollars, print Yes; otherwise, print No.\n\nSample Input 1\n\n11\n\nSample Output 1\n\nYes\n\nIf you buy one cake and one doughnut, the total will be 4 + 7 = 11 dollars.\n\nSample Input 2\n\n40\n\nSample Output 2\n\nYes\n\nIf you buy ten cakes, the total will be 4 \\times 10 = 40 dollars.\n\nSample Input 3\n\n3\n\nSample Output 3\n\nNo\n\nThe prices of cakes (4 dollars) and doughnuts (7 dollars) are both higher than 3 dollars, so there is no such way.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 630, "cpu_time_ms": 1358, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s617505842", "group_id": "codeNet:p03288", "input_text": "function Main(input){\n\n if(input < 1200){\n console.log('ABC');\n }else if(input < 2800){\n console.log('ARC');\n }else{\n console.log('AGC');\n }\n}\n\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "language": "JavaScript", "metadata": {"date": 1557441989, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03288.html", "problem_id": "p03288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03288/input.txt", "sample_output_relpath": "derived/input_output/data/p03288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03288/JavaScript/s617505842.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s617505842", "user_id": "u720390023"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "function Main(input){\n\n if(input < 1200){\n console.log('ABC');\n }else if(input < 2800){\n console.log('ARC');\n }else{\n console.log('AGC');\n }\n}\n\n\nMain(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "sample_input": "1199\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03288", "source_text": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 220, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s030968225", "group_id": "codeNet:p03288", "input_text": "function Main(input) {\n if (input < 1200){\n console.log('ABC');\n } \n if (input >= 1200 && input < 2800){\n console.log('ARC');\n }\n if (input <= 4208){\n console.log('AGC');\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1535063205, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03288.html", "problem_id": "p03288", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03288/input.txt", "sample_output_relpath": "derived/input_output/data/p03288/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03288/JavaScript/s030968225.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s030968225", "user_id": "u365819693"}, "prompt_components": {"gold_output": "ABC\n", "input_to_evaluate": "function Main(input) {\n if (input < 1200){\n console.log('ABC');\n } \n if (input >= 1200 && input < 2800){\n console.log('ARC');\n }\n if (input <= 4208){\n console.log('AGC');\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "sample_input": "1199\n"}, "reference_outputs": ["ABC\n"], "source_document_id": "p03288", "source_text": "Score : 100 points\n\nProblem Statement\n\nA programming competition site AtCode regularly holds programming contests.\n\nThe next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.\n\nThe contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.\n\nThe contest after the ARC is called AGC, which is rated for all contestants.\n\nTakahashi's rating on AtCode is R. What is the next contest rated for him?\n\nConstraints\n\n0 ≤ R ≤ 4208\n\nR is an integer.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nR\n\nOutput\n\nPrint the name of the next contest rated for Takahashi (ABC, ARC or AGC).\n\nSample Input 1\n\n1199\n\nSample Output 1\n\nABC\n\n1199 is less than 1200, so ABC will be rated.\n\nSample Input 2\n\n1200\n\nSample Output 2\n\nARC\n\n1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.\n\nSample Input 3\n\n4208\n\nSample Output 3\n\nAGC", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 306, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s595055277", "group_id": "codeNet:p03289", "input_text": "function main(arg) {\n // 処理\n\n if (arg[0] === 'A' && arg[1] !== 'A') {\n var top = arg.slice(0,2)\n top = top.split(\"A\").join(\"a\")\n var tmp = arg.slice(2, -1)\n var bot = arg.slice(-1)\n if (tmp.split(\"C\").length === 2) {\n var text = top + tmp.split(\"C\").join(\"c\") + bot\n if (/^[A-Z]+$/.test(text)){\n console.log('AC')\n return\n }\n }\n }\n console.log('WA')\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1533523531, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03289.html", "problem_id": "p03289", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03289/input.txt", "sample_output_relpath": "derived/input_output/data/p03289/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03289/JavaScript/s595055277.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s595055277", "user_id": "u063969814"}, "prompt_components": {"gold_output": "AC\n", "input_to_evaluate": "function main(arg) {\n // 処理\n\n if (arg[0] === 'A' && arg[1] !== 'A') {\n var top = arg.slice(0,2)\n top = top.split(\"A\").join(\"a\")\n var tmp = arg.slice(2, -1)\n var bot = arg.slice(-1)\n if (tmp.split(\"C\").length === 2) {\n var text = top + tmp.split(\"C\").join(\"c\") + bot\n if (/^[A-Z]+$/.test(text)){\n console.log('AC')\n return\n }\n }\n }\n console.log('WA')\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "sample_input": "AtCoder\n"}, "reference_outputs": ["AC\n"], "source_document_id": "p03289", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given a string S. Each character of S is uppercase or lowercase English letter.\nDetermine if S satisfies all of the following conditions:\n\nThe initial character of S is an uppercase A.\n\nThere is exactly one occurrence of C between the third character from the beginning and the second to last character (inclusive).\n\nAll letters except the A and C mentioned above are lowercase.\n\nConstraints\n\n4 ≤ |S| ≤ 10 (|S| is the length of the string S.)\n\nEach character of S is uppercase or lowercase English letter.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\n\nOutput\n\nIf S satisfies all of the conditions in the problem statement, print AC; otherwise, print WA.\n\nSample Input 1\n\nAtCoder\n\nSample Output 1\n\nAC\n\nThe first letter is A, the third letter is C and the remaining letters are all lowercase, so all the conditions are satisfied.\n\nSample Input 2\n\nACoder\n\nSample Output 2\n\nWA\n\nThe second letter should not be C.\n\nSample Input 3\n\nAcycliC\n\nSample Output 3\n\nWA\n\nThe last letter should not be C, either.\n\nSample Input 4\n\nAtCoCo\n\nSample Output 4\n\nWA\n\nThere should not be two or more occurrences of C.\n\nSample Input 5\n\nAtcoder\n\nSample Output 5\n\nWA\n\nThe number of C should not be zero, either.", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 528, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s901615630", "group_id": "codeNet:p03292", "input_text": "\"use strict\"\n// inputに入力データ全体が入る\nfunction Main(input){\n let sum = 0;\n input = input.split(\" \").map(e=>parseInt(e)).sort((a, b)=>aparseInt(e)).sort((a, b)=>a {\n if (str.length === 0) {\n return \"\";\n }\n\n const tailHead = str.substr(-1);\n const heads = str.substr(0, str.length-1);\n\n return tailHead + heads;\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n'));\n", "language": "JavaScript", "metadata": {"date": 1575415767, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03293.html", "problem_id": "p03293", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03293/input.txt", "sample_output_relpath": "derived/input_output/data/p03293/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03293/JavaScript/s642851830.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s642851830", "user_id": "u932410966"}, "prompt_components": {"gold_output": "Yes\n", "input_to_evaluate": "function main(input) {\n var source = input[0];\n var target = input[1];\n \n var flag = false;\n for (var i = 0; i < source.length; i++) {\n var source = shift(source);\n if (source === target) {\n flag = true;\n break;\n }\n }\n\n console.log(flag ? 'Yes' : 'No');\n}\n\nconst shift = (str) => {\n if (str.length === 0) {\n return \"\";\n }\n\n const tailHead = str.substr(-1);\n const heads = str.substr(0, str.length-1);\n\n return tailHead + heads;\n};\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\\n'));\n", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "sample_input": "kyoto\ntokyo\n"}, "reference_outputs": ["Yes\n"], "source_document_id": "p03293", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given string S and T consisting of lowercase English letters.\n\nDetermine if S equals T after rotation.\n\nThat is, determine if S equals T after the following operation is performed some number of times:\n\nOperation: Let S = S_1 S_2 ... S_{|S|}. Change S to S_{|S|} S_1 S_2 ... S_{|S|-1}.\n\nHere, |X| denotes the length of the string X.\n\nConstraints\n\n2 \\leq |S| \\leq 100\n\n|S| = |T|\n\nS and T consist of lowercase English letters.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nS\nT\n\nOutput\n\nIf S equals T after rotation, print Yes; if it does not, print No.\n\nSample Input 1\n\nkyoto\ntokyo\n\nSample Output 1\n\nYes\n\nIn the first operation, kyoto becomes okyot.\n\nIn the second operation, okyot becomes tokyo.\n\nSample Input 2\n\nabc\narc\n\nSample Output 2\n\nNo\n\nabc does not equal arc after any number of operations.\n\nSample Input 3\n\naaaaaaaaaaaaaaab\naaaaaaaaaaaaaaab\n\nSample Output 3\n\nYes", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 541, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s467966437", "group_id": "codeNet:p03294", "input_text": "const main = function(input){\n var nums = input.split(\"\\n\")[1].split(\" \").map(i=>parseInt(i));\n var len = nums.length;\n var ans = nums.reduce((s,i)=>s+(i-1))-1;\n console.log(ans);\n \n \n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1579925733, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03294.html", "problem_id": "p03294", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03294/input.txt", "sample_output_relpath": "derived/input_output/data/p03294/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03294/JavaScript/s467966437.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s467966437", "user_id": "u341268183"}, "prompt_components": {"gold_output": "10\n", "input_to_evaluate": "const main = function(input){\n var nums = input.split(\"\\n\")[1].split(\" \").map(i=>parseInt(i));\n var len = nums.length;\n var ans = nums.reduce((s,i)=>s+(i-1))-1;\n console.log(ans);\n \n \n}\n\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 300 points\n\nProblem Statement\n\nYou are given N positive integers a_1, a_2, ..., a_N.\n\nFor a non-negative integer m, let f(m) = (m\\ mod\\ a_1) + (m\\ mod\\ a_2) + ... + (m\\ mod\\ a_N).\n\nHere, X\\ mod\\ Y denotes the remainder of the division of X by Y.\n\nFind the maximum value of f.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 3000\n\n2 \\leq a_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum value of f.\n\nSample Input 1\n\n3\n3 4 6\n\nSample Output 1\n\n10\n\nf(11) = (11\\ mod\\ 3) + (11\\ mod\\ 4) + (11\\ mod\\ 6) = 10 is the maximum value of f.\n\nSample Input 2\n\n5\n7 46 11 20 11\n\nSample Output 2\n\n90\n\nSample Input 3\n\n7\n994 518 941 851 647 2 581\n\nSample Output 3\n\n4527", "sample_input": "3\n3 4 6\n"}, "reference_outputs": ["10\n"], "source_document_id": "p03294", "source_text": "Score : 300 points\n\nProblem Statement\n\nYou are given N positive integers a_1, a_2, ..., a_N.\n\nFor a non-negative integer m, let f(m) = (m\\ mod\\ a_1) + (m\\ mod\\ a_2) + ... + (m\\ mod\\ a_N).\n\nHere, X\\ mod\\ Y denotes the remainder of the division of X by Y.\n\nFind the maximum value of f.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 3000\n\n2 \\leq a_i \\leq 10^5\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\na_1 a_2 ... a_N\n\nOutput\n\nPrint the maximum value of f.\n\nSample Input 1\n\n3\n3 4 6\n\nSample Output 1\n\n10\n\nf(11) = (11\\ mod\\ 3) + (11\\ mod\\ 4) + (11\\ mod\\ 6) = 10 is the maximum value of f.\n\nSample Input 2\n\n5\n7 46 11 20 11\n\nSample Output 2\n\n90\n\nSample Input 3\n\n7\n994 518 941 851 647 2 581\n\nSample Output 3\n\n4527", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 248, "cpu_time_ms": 54, "memory_kb": 7500}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s945523082", "group_id": "codeNet:p03295", "input_text": "module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,\"a\",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p=\"\",t(t.s=0)}([function(e,r,t){t(1)(t(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,r){e.exports=function(e){for(var r=e.split(\"\\n\"),t=r[0].split(\" \"),n=(Number(t[0]),Number(t[1])),o=[],u=0;ua&&(a=o[p].b-1,c+=1);console.log(c)}},function(e,r){e.exports=require(\"fs\")}]);", "language": "JavaScript", "metadata": {"date": 1566270149, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03295.html", "problem_id": "p03295", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03295/input.txt", "sample_output_relpath": "derived/input_output/data/p03295/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03295/JavaScript/s945523082.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s945523082", "user_id": "u501148202"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&\"object\"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,\"default\",{enumerable:!0,value:e}),2&r&&\"string\"!=typeof e)for(var o in e)t.d(n,o,function(r){return e[r]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,\"a\",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p=\"\",t(t.s=0)}([function(e,r,t){t(1)(t(2).readFileSync(\"/dev/stdin\",\"UTF-8\"))},function(e,r){e.exports=function(e){for(var r=e.split(\"\\n\"),t=r[0].split(\" \"),n=(Number(t[0]),Number(t[1])),o=[],u=0;ua&&(a=o[p].b-1,c+=1);console.log(c)}},function(e,r){e.exports=require(\"fs\")}]);", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "sample_input": "5 2\n1 4\n2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03295", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 1351, "cpu_time_ms": 297, "memory_kb": 33328}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s040165482", "group_id": "codeNet:p03295", "input_text": "function main(input) {\n var array = input.split('\\n');\n array.shift();\n var bridgeList = [];\n var cut = 1;\n\n for(var i = 0; i < array.length; i++){\n bridgeList[i]=[];\n for(var j = array[i][0]; j < array[i][2]; j++){\n bridgeList[i].push(parseInt(j));\n }\n }\n\n for(var i = 0; i < bridgeList.length-1; i++){\n console.log(bridgeList);\n if(sameArray(bridgeList[i], bridgeList[i+1]).length != 0){\n bridgeList[i] = sameArray(bridgeList[i], bridgeList[i+1]);\n bridgeList.splice(i+1, 1);\n i--;\n }\n else{\n cut++;\n }\n }\n console.log(parseInt(cut));\n}\n\nfunction sameArray(arr1, arr2) {\n var newArr = [];\n for(var i = 0 ; i < arr1.length; i++){\n if(arr2.indexOf(arr1[i]) >= 0 ){\n newArr.push(arr1[i]);\n } \n }\n return newArr;\n }\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1532229815, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03295.html", "problem_id": "p03295", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03295/input.txt", "sample_output_relpath": "derived/input_output/data/p03295/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03295/JavaScript/s040165482.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s040165482", "user_id": "u645487439"}, "prompt_components": {"gold_output": "1\n", "input_to_evaluate": "function main(input) {\n var array = input.split('\\n');\n array.shift();\n var bridgeList = [];\n var cut = 1;\n\n for(var i = 0; i < array.length; i++){\n bridgeList[i]=[];\n for(var j = array[i][0]; j < array[i][2]; j++){\n bridgeList[i].push(parseInt(j));\n }\n }\n\n for(var i = 0; i < bridgeList.length-1; i++){\n console.log(bridgeList);\n if(sameArray(bridgeList[i], bridgeList[i+1]).length != 0){\n bridgeList[i] = sameArray(bridgeList[i], bridgeList[i+1]);\n bridgeList.splice(i+1, 1);\n i--;\n }\n else{\n cut++;\n }\n }\n console.log(parseInt(cut));\n}\n\nfunction sameArray(arr1, arr2) {\n var newArr = [];\n for(var i = 0 ; i < arr1.length; i++){\n if(arr2.indexOf(arr1[i]) >= 0 ){\n newArr.push(arr1[i]);\n } \n }\n return newArr;\n }\n\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "sample_input": "5 2\n1 4\n2 5\n"}, "reference_outputs": ["1\n"], "source_document_id": "p03295", "source_text": "Score : 400 points\n\nProblem Statement\n\nThere are N islands lining up from west to east, connected by N-1 bridges.\n\nThe i-th bridge connects the i-th island from the west and the (i+1)-th island from the west.\n\nOne day, disputes took place between some islands, and there were M requests from the inhabitants of the islands:\n\nRequest i: A dispute took place between the a_i-th island from the west and the b_i-th island from the west. Please make traveling between these islands with bridges impossible.\n\nYou decided to remove some bridges to meet all these M requests.\n\nFind the minimum number of bridges that must be removed.\n\nConstraints\n\nAll values in input are integers.\n\n2 \\leq N \\leq 10^5\n\n1 \\leq M \\leq 10^5\n\n1 \\leq a_i < b_i \\leq N\n\nAll pairs (a_i, b_i) are distinct.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN M\na_1 b_1\na_2 b_2\n:\na_M b_M\n\nOutput\n\nPrint the minimum number of bridges that must be removed.\n\nSample Input 1\n\n5 2\n1 4\n2 5\n\nSample Output 1\n\n1\n\nThe requests can be met by removing the bridge connecting the second and third islands from the west.\n\nSample Input 2\n\n9 5\n1 8\n2 7\n3 5\n4 6\n7 9\n\nSample Output 2\n\n2\n\nSample Input 3\n\n5 10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n\nSample Output 3\n\n4", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 941, "cpu_time_ms": 2111, "memory_kb": 86004}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s248914606", "group_id": "codeNet:p03307", "input_text": "function Main(input) {\n var a = input[0];\n\n if(a % 2 === 0) {\n console.log(a);\n } else {\n console.log(a * 2);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n", "language": "JavaScript", "metadata": {"date": 1536272372, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/JavaScript/s248914606.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s248914606", "user_id": "u960327804"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function Main(input) {\n var a = input[0];\n\n if(a % 2 === 0) {\n console.log(a);\n } else {\n console.log(a * 2);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));\n\n", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 182, "cpu_time_ms": 53, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s116967916", "group_id": "codeNet:p03307", "input_text": "function Main(input) {\n var rest = input % 2\n if (rest === 0) {\n console.log(input);\n }else{\n console.log(input * 2);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1536272211, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/JavaScript/s116967916.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s116967916", "user_id": "u365819693"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function Main(input) {\n var rest = input % 2\n if (rest === 0) {\n console.log(input);\n }else{\n console.log(input * 2);\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 204, "cpu_time_ms": 52, "memory_kb": 7372}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s751503154", "group_id": "codeNet:p03307", "input_text": "function main(input) {\n var input = input.split('\\n')[1];\n var max = 0;\n var min = 10000000000;\n for (var i=0;i max) {\n \t\tmax = tmp;\n \t}\n \tif (tmp < min) {\n \t\tmin = tmp;\n \t}\n \t\n }\n console.log('0');", "language": "JavaScript", "metadata": {"date": 1530493098, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/JavaScript/s751503154.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s751503154", "user_id": "u738369226"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function main(input) {\n var input = input.split('\\n')[1];\n var max = 0;\n var min = 10000000000;\n for (var i=0;i max) {\n \t\tmax = tmp;\n \t}\n \tif (tmp < min) {\n \t\tmin = tmp;\n \t}\n \t\n }\n console.log('0');", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 276, "cpu_time_ms": 50, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s430594554", "group_id": "codeNet:p03307", "input_text": "function main(input){\n\tvar x = 2, y = Number(input), z, a = x * y;\n\tif (x < y) {\n\t\tt = x;\n\t\tx = y;\n\t\ty = t;\n\t}\n\n\tz = x % y;\n\tfor (;;) {\n\t\tx = y;\n\t\ty = z;\n\t\tz = x % y;\n\t\tif (z === 0) break;\n\t}\n\n\tconsole.log(a / y);\n}\n \nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1530492456, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/JavaScript/s430594554.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Time Limit Exceeded", "submission_id": "s430594554", "user_id": "u646148705"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function main(input){\n\tvar x = 2, y = Number(input), z, a = x * y;\n\tif (x < y) {\n\t\tt = x;\n\t\tx = y;\n\t\ty = t;\n\t}\n\n\tz = x % y;\n\tfor (;;) {\n\t\tx = y;\n\t\ty = z;\n\t\tz = x % y;\n\t\tif (z === 0) break;\n\t}\n\n\tconsole.log(a / y);\n}\n \nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 277, "cpu_time_ms": 2108, "memory_kb": 21064}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s253505041", "group_id": "codeNet:p03307", "input_text": "function main(input){\n\tvar x = 2, y = Number(input), z, a = x * y;\n\tif (x < y) [x, y] = [y, x];\n\n\tz = x % y;\n\twhile (z !== 0) {\n\t\tx = y;\n\t\ty = z;\n\t\tz = x % y;\n\t}\n\n\tconsole.log(a/y);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1530491813, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03307.html", "problem_id": "p03307", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03307/input.txt", "sample_output_relpath": "derived/input_output/data/p03307/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03307/JavaScript/s253505041.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s253505041", "user_id": "u646148705"}, "prompt_components": {"gold_output": "6\n", "input_to_evaluate": "function main(input){\n\tvar x = 2, y = Number(input), z, a = x * y;\n\tif (x < y) [x, y] = [y, x];\n\n\tz = x % y;\n\twhile (z !== 0) {\n\t\tx = y;\n\t\ty = z;\n\t\tz = x % y;\n\t}\n\n\tconsole.log(a/y);\n}\n\nmain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "sample_input": "3\n"}, "reference_outputs": ["6\n"], "source_document_id": "p03307", "source_text": "Score : 100 points\n\nProblem Statement\n\nYou are given a positive integer N.\nFind the minimum positive integer divisible by both 2 and N.\n\nConstraints\n\n1 \\leq N \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\n\nOutput\n\nPrint the minimum positive integer divisible by both 2 and N.\n\nSample Input 1\n\n3\n\nSample Output 1\n\n6\n\n6 is divisible by both 2 and 3.\nAlso, there is no positive integer less than 6 that is divisible by both 2 and 3.\nThus, the answer is 6.\n\nSample Input 2\n\n10\n\nSample Output 2\n\n10\n\nSample Input 3\n\n999999999\n\nSample Output 3\n\n1999999998", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 240, "cpu_time_ms": 1393, "memory_kb": 21948}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s387460064", "group_id": "codeNet:p03308", "input_text": "function main(input) {\n let inputs = input.split(/\\n/);\n let args = inputs[1].split(/\\s/);\n console.log(Math.max(...args) - Math.min(...args));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1593211791, "filename_ext": "js", "original_language": "JavaScript (Node.js 12.16.1)", "problem_description_relpath": "problem_descriptions/p03308.html", "problem_id": "p03308", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03308/input.txt", "sample_output_relpath": "derived/input_output/data/p03308/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03308/JavaScript/s387460064.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Accepted", "submission_id": "s387460064", "user_id": "u720603143"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function main(input) {\n let inputs = input.split(/\\n/);\n let args = inputs[1].split(/\\s/);\n console.log(Math.max(...args) - Math.min(...args));\n}\nmain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "sample_input": "4\n1 4 6 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03308", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 204, "cpu_time_ms": 61, "memory_kb": 29840}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s065721301", "group_id": "codeNet:p03308", "input_text": "function Main(input) {\n line = input.split('\\n');\n var n = parseInt(line[0]);\n var a = line[1].split(' ').map((n) => Number(n));\n\n var ma = -100;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++) {\n ma = Math.max(ma, Math.abs(a[i] - a[j]));\n }\n }\n console.log(ma);\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "language": "JavaScript", "metadata": {"date": 1572142448, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03308.html", "problem_id": "p03308", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03308/input.txt", "sample_output_relpath": "derived/input_output/data/p03308/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03308/JavaScript/s065721301.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Runtime Error", "submission_id": "s065721301", "user_id": "u771524928"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function Main(input) {\n line = input.split('\\n');\n var n = parseInt(line[0]);\n var a = line[1].split(' ').map((n) => Number(n));\n\n var ma = -100;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++) {\n ma = Math.max(ma, Math.abs(a[i] - a[j]));\n }\n }\n console.log(ma);\n}\n\nMain(require('fs').readFileSync('/dev/stdin', 'utf8'));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "sample_input": "4\n1 4 6 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03308", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 383, "cpu_time_ms": 51, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s335215516", "group_id": "codeNet:p03308", "input_text": "function Main(n, input) {\n var m = n - 1;\n var max;\n var min;\n while(m--){\n if(input[m] - input[m - 1] < 0){\n max = input[m - 1];\n min = input[m];\n }else{\n max = input[m];\n min = input[m - 1];\n }\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "language": "JavaScript", "metadata": {"date": 1536273461, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03308.html", "problem_id": "p03308", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03308/input.txt", "sample_output_relpath": "derived/input_output/data/p03308/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03308/JavaScript/s335215516.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s335215516", "user_id": "u365819693"}, "prompt_components": {"gold_output": "5\n", "input_to_evaluate": "function Main(n, input) {\n var m = n - 1;\n var max;\n var min;\n while(m--){\n if(input[m] - input[m - 1] < 0){\n max = input[m - 1];\n min = input[m];\n }else{\n max = input[m];\n min = input[m - 1];\n }\n }\n}\nMain(require(\"fs\").readFileSync(\"/dev/stdin\", \"utf8\"));", "problem_context": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "sample_input": "4\n1 4 6 3\n"}, "reference_outputs": ["5\n"], "source_document_id": "p03308", "source_text": "Score : 200 points\n\nProblem Statement\n\nYou are given an integer sequence A of length N.\nFind the maximum absolute difference of two elements (with different indices) in A.\n\nConstraints\n\n2 \\leq N \\leq 100\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the maximum absolute difference of two elements (with different indices) in A.\n\nSample Input 1\n\n4\n1 4 6 3\n\nSample Output 1\n\n5\n\nThe maximum absolute difference of two elements is A_3-A_1=6-1=5.\n\nSample Input 2\n\n2\n1000000000 1\n\nSample Output 2\n\n999999999\n\nSample Input 3\n\n5\n1 1 1 1 1\n\nSample Output 3\n\n0", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 336, "cpu_time_ms": 49, "memory_kb": 7244}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s049836783", "group_id": "codeNet:p03308", "input_text": "// inputに入力データ全体が入る\nfunction Main(input) {\ninp = input.split('\\n')\nn = inp[0]\nina = inp[1].split(' ')\nfor(i=0;i Number(value));\n\n var i = 1; var cnt = [];\n for (const span of spans) {\n\n cnt[i - 1] = span - i;\n i++;\n }\n cnt.sort((a, b) => a - b);\n\n for (const array of cnt) {\n result += Math.abs(array - cnt[Math.floor(Number(N) / 2)]);\n }\n\n console.log(result);\n});", "language": "JavaScript", "metadata": {"date": 1555771786, "filename_ext": "js", "original_language": "JavaScript (node.js v5.12)", "problem_description_relpath": "problem_descriptions/p03309.html", "problem_id": "p03309", "resource_group": "medium_resource", "sample_input_relpath": "derived/input_output/data/p03309/input.txt", "sample_output_relpath": "derived/input_output/data/p03309/output.txt", "source_dataset": "Project CodeNet", "source_relpath": "data/p03309/JavaScript/s158545118.js", "split_policy": "Global OOD problem IDs are disjoint from train, validation, and in-distribution test problem IDs.", "status": "Wrong Answer", "submission_id": "s158545118", "user_id": "u266742706"}, "prompt_components": {"gold_output": "2\n", "input_to_evaluate": "var lines = [];\nvar readline = require('readline');\n\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', function (x) {\n lines.push(x);\n});\n\nrl.on('close', function () {\n var result = 0;\n\n var N = lines.shift();\n const spans = lines[0].split(\" \").map(value => Number(value));\n\n var i = 1; var cnt = [];\n for (const span of spans) {\n\n cnt[i - 1] = span - i;\n i++;\n }\n cnt.sort((a, b) => a - b);\n\n for (const array of cnt) {\n result += Math.abs(array - cnt[Math.floor(Number(N) / 2)]);\n }\n\n console.log(result);\n});", "problem_context": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "sample_input": "5\n2 2 3 5 5\n"}, "reference_outputs": ["2\n"], "source_document_id": "p03309", "source_text": "Score : 300 points\n\nProblem Statement\n\nSnuke has an integer sequence A of length N.\n\nHe will freely choose an integer b.\nHere, he will get sad if A_i and b+i are far from each other.\nMore specifically, the sadness of Snuke is calculated as follows:\n\nabs(A_1 - (b+1)) + abs(A_2 - (b+2)) + ... + abs(A_N - (b+N))\n\nHere, abs(x) is a function that returns the absolute value of x.\n\nFind the minimum possible sadness of Snuke.\n\nConstraints\n\n1 \\leq N \\leq 2 \\times 10^5\n\n1 \\leq A_i \\leq 10^9\n\nAll values in input are integers.\n\nInput\n\nInput is given from Standard Input in the following format:\n\nN\nA_1 A_2 ... A_N\n\nOutput\n\nPrint the minimum possible sadness of Snuke.\n\nSample Input 1\n\n5\n2 2 3 5 5\n\nSample Output 1\n\n2\n\nIf we choose b=0, the sadness of Snuke would be abs(2-(0+1))+abs(2-(0+2))+abs(3-(0+3))+abs(5-(0+4))+abs(5-(0+5))=2.\nAny choice of b does not make the sadness of Snuke less than 2, so the answer is 2.\n\nSample Input 2\n\n9\n1 2 3 4 5 6 7 8 9\n\nSample Output 2\n\n0\n\nSample Input 3\n\n6\n6 5 4 3 2 1\n\nSample Output 3\n\n18\n\nSample Input 4\n\n7\n1 1 1 1 2 3 4\n\nSample Output 4\n\n6", "split": "validation", "target_descriptions": {"code_size_bytes": "Submitted source-code file size, in bytes.", "cpu_time_ms": "Execution CPU time reported by official Project CodeNet metadata, in milliseconds.", "memory_kb": "Peak memory usage reported by official Project CodeNet metadata, in kilobytes."}, "targets": {"code_size_bytes": 624, "cpu_time_ms": 292, "memory_kb": 58444}, "variant": "medium_resource"} +{"dataset": "codeNet", "domain": "code_generation", "example_id": "codeNet:JavaScript:s457759304", "group_id": "codeNet:p03315", "input_text": "function Main(input){\n\tinput = input.split(\"\");\n var sum = 0;\n for(var i = 0; i < 4;i++){\n \tinput[i]==\"+\"?sum++:sum--;\n }\n return sum\n}\n\n// If you are interested in the algorithms I used, \n// there is no need to read down from this line.\n\n((b,c,d)=>\"undefined\"!=typeof require?console.log(Main(require(\"fs\").readFileSync(\"/dev/stdin\",\"utf8\"))):[b=b.split(\"\\n\").slice(1,-1).join(\"\\n\"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,\"string\"==d||(c=JSON.stringify(c)),$(\"
\").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?\"