{"lang": "JavaScript", "source_code": "var [n, k] = readline().split(' ');\nfor (var i = 0; i < k; i++) {\n if (n % 10) {\n n--;\n }\n else {\n n /= 10;\n }\n}\nprint(n);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "0e89ea8ad4021df6044a9ef7b5461850", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var num = readline().split(\" \").map(x => parseInt(x));\nvar h,l;\nh=num[0],l=num[1];\n\nconst aStr = h.toString();\nconst aLength = aStr.length;\nlet aArr = aStr.split('').reverse();\naArr = aArr.map((data) => parseInt(data)+1);\nvar counter = 0;\nvar res = '';\nwhile(aArr[counter] < l){\n l = l - aArr[counter];\n counter++;\n}\naArr[counter] = aArr[counter] - l;\n\nfor(var i = aArr.length-1; i >= counter; i--) {\n if(aArr[i] == 0) continue;\n res += (aArr[i]-1).toString();\n}\n \nvar r= parseInt(res);\nprint(r);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "c6ac77cb8599e8de73ef50310dba6b65", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var numbers = readline().split(\" \");\nvar n = numbers[0];\nvar k = numbers[1];\n\nfor(var i=0; i parseInt(x));\nvar n,k;\nn=num[0],k=num[1];\n\nlet result = n;\nfor(let i=0; i\n\n\n\t\n\tzadacha\n\n\n\t\n\t\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e0f84a21bb84f53f4a7444f387919156", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let input = readline().split(\" \").map(function(x) { return parseInt(x); });\n\nfor(let i=0; i < input[1]; i++){\n\tif(input[0] % 10 == 0) \n\t\tinput[0] /= 10;\n\telse input[0] -= 1;\n}\n\nprint(input[0]);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "fa05ff9eadf2ab69a3c000c4d5bad767", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "const data = readline().split(' ').map(x => Number(x));\nfor (let i = data[1]; i > 0; i--) {\n if(data[0]%10 === 0) data[0] = data[0]/10;\n else data[0]--;\n}\nprint(data[0]);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "9d5487f76835dec185ce20bc746beb3d", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": " function toNumber(x) { return +x; }\n // function readNumbers() { return readline().split(/\\s/).map(function (x) { return toNumber(x); }); }\n function readNumbers() { return readline().split(/\\s/).map(x => toNumber(x)); }\n\n var [n, k] = readNumbers();\n\n while (k--) {\n if (n % 10 != 0) {\n n--;\n } else {\n n /= 10;\n }\n }\n\n print(n);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "3dc5460cd32107044f400fd3ac37a41d", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\n\nlet n;\nlet k=1;\n//k=readline();\n//console.log(k);\n//for(let i = 1;i <= k;i++)\n//if(n%10==0){\n// n=n/10\n//}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "93651d290e73abc80054554a97bc882f", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var numbers = readline().split(\" \");\nvar n = numbers[0];\nvar k = numbers[1];\n \nfor(var i=0; i+x;\nlet n = inputs[0];\nlet k = inputs[1];\n\n// let n = 1000000000, k = 9;\nfunction subtracte(n,k){\n\n\tfor(let i = 0; i < k; i++){\n\t\tlet last = n%10;\n\t\tif(last === 0){\n\t\t\tn /= 10;\n\t\t}else {\n\t\t\tn -= 1;\n\t\t}\n\t}\n\t// console.log(n);\n\tprint(n);\n}\nsubtracte(n, k);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "1c4bbf1b200c4060ba071a416b12dfb9", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "numbers = readline().split(\"\").map((num) => parseInt(num))\n\nfor(let i = 0; i < num; i++) {\n if (numbers[0] % 10 === 0)\n numbers[0] /= 10;\n else \n numbers[0]--;\n}\nprint(numbers[0])", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "0c0935b5204c6574052f72a9c2d0e8d0", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let n = prompt(\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0447\u0438\u0441\u043b\u043e\");\n\t\tlet k = prompt(\"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0447\u0438\u0441\u043b\u043e, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0437 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0442\u0430\u043d\u043d\u043e\");\n\t\t\twhile(k>0){\n\t\t\tif(n%10!==0){\n \t\tn-- ;\n\t\t\t}\n\t\t\telse{\n\t\t\tn=n/10;}\n\t\t\tk--;\n\t\t\t}\n\t\t\talert(n);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "aa8faf59ffb7d344fcd0b4456f7dc9be", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var input = readline().split(' ')\nvar number = Number(input[0]);\nvar times = Number(input[1]);\n\nfor(let i = 0; i < times; i++) {\n if(number % 10 == 0) {\n number /= 10;\n } else {\n number -= 1\n }\n}\n\n\nprint(number)", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "6fc6280d47a199bbc004ddd12e448273", "src_uid": "064162604284ce252b88050b4174ba55", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var k = readline().split(\" \");\nvar n = readline().split(\" \");\n \nfor(var i=0; i= parseInt(scores[lmt-1]))\n t++;\n else\n break;\n}\nwrite(t);\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "37615801fa41899f643689bf7b2a20ce", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "nk = readline(\"Enter n and k\");\n valNLk = nk.split(\" \");\n array = [];\n counter = 0;\n\n for (let i = 0; i < valNLk.length; i++) {\n value = valNLk[i];\n convertToNumber = parseInt(value);\n array.push(convertToNumber);\n }\n arr = [];\n if (array[0] >= array[1]) {\n secondLineInputs = readline(\"enter n numbers\");\n secondLineSplited = secondLineInputs.split(\" \");\n secondLineSplited.map(el => {\n arr.push(parseInt(el));\n })\n \n for (k = 0; k < array[1]; k++) {\n if (arr[k] == 0 && arr[k + 1] == 0) {\n break;\n }\n if (arr[k] >= arr[k + 1]) {\n counter++;\n }\n if(arr[k] == arr[array[1]]){\n counter++;\n }\n }\n print(counter);\n }", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "c652fe622f2cc91808530dedd6ce438b", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "nk = prompt(\"Enter n and k\");\n valNLk = nk.split(\" \");\n array = [];\n counter = 0;\n\n for (let i = 0; i < valNLk.length; i++) {\n value = valNLk[i];\n convertToNumber = parseInt(value);\n array.push(convertToNumber);\n }\n arr = [];\n if (array[0] >= array[1]) {\n secondLineInputs = prompt(\"enter n numbers\");\n secondLineSplited = secondLineInputs.split(\" \");\n secondLineSplited.map(el => {\n arr.push(parseInt(el));\n })\n \n for (k = 0; k < array[1]; k++) {\n if (arr[k] == 0 && arr[k + 1] == 0) {\n break;\n }\n if (arr[k] >= arr[k + 1]) {\n counter++;\n }\n if(arr[k] == arr[array[1]]){\n counter++;\n }\n }\n print(counter);\n }", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "aa9f8447609c8906bba7f01ee875980a", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "const readline = require('readline');\n\nconst arr = [];\n\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.on('line', (input) => {\n \n arr.push(input)\n\n if(arr.length == 2) {\n compute(arr);\n }\n});\n\nfunction compute(arr) {\n\n\n var parsed = [];\n parsed.push(splitMNumber(arr[0]))\n parsed.push(splitMNumber(arr[1]))\n\n var limit = parsed[0][1]\n var last = -1;\n var sum = 0;\n\n for(let i=0;i 0 && (limit > 0 || current == last)) {\n sum++;\n }\n else {\n break;\n }\n limit--;\n last = current;\n }\n\n console.log(sum)\n\n\n}\n\nfunction splitMNumber(str) {\n return str.split(\" \");\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "1aed5474f94271a41423f316f10aba44", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var datos = readline().split(\" \"); \nvar corte = datos[1]; \nvar participantes = datos[0];\nvar notas = readline().split(\" \");\nvar cont= 0; \nfor (var i=0; icorte){\n cont++; \n }else if(notas[0]!>0){\n print(0); \n } \n print (cont); \n \n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f074e4f5f0f490d034e33f75bafb88ba", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var x = readline().split(\" \");\nvar scores = readline().split(\" \");\nvar cnt = x[0];\nvar lmt = x[1];\nvar t = 0;\nvar arr[];\nfor (var i = 0; i < cnt; i++) {\n if(!score[i])\n break;\n if(parseInt(scores[i]) >= parseInt(scores[lmt-1]))\n t++;\n else\n break;\n}\nwrite(t);\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "3a4f09017e7247fa8023e8203ddb4917", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var [n, k] = readline();\nvar scores = readline();\nvar pass = scores[k-1];\nprint(scores.filter( x => x > 0 && x >= pass).length);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "a9e2dd33d2572b56de0aea8b09f59202", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var nk = readline().split(' ');\nvar an = readline().split(' ');\nvar nextrnd = 0;\n\nvar n = nk[0];\nvar k = nk[1];\n\nif(an[k - 1] > 0)\n\tnextrnd = k - 1;\n\nif(an[k] > 0)\n{\n\tvar i = k;\n\tvar found = false;\n\twhile(i <= nk[0] && !found)\n\t{\n\t\tif(an[i] === an[k])\n\t\t\tnextrnd++;\n\t\t\ti++;\n\t\telse\n\t\t\tfound = true;\n\t}\n}\n\nprint(nextrnd);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "cfc7aab8069218520bd62a85dc4a50a4", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "Node.js", "source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet stdin = '';\n\nprocess.stdin.on('data', (input) => {\n stdin += input;\n});\n\nprocess.stdin.on('end', () => {\n const data = stdin.split('\\n');\n const [, k] = data[0].split(' ');\n const scores = data[1].split(' ');\n\n const kScore = scores[k - 1];\n\n const calculate = () => {\n let end = k;\n\n for (let i = k; i < scores.length; i++)\n if (scores[i] > 0 && scores[i] === kScore) end++;\n else break;\n\n return scores.slice(0, end).length;\n };", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "c444a33700865bd8ce168f62db9dc511", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "k = readline().split(' ');\nk = k[1];\nstr = readline().split(' ').map(Number);\n\nlet res = 0;\n\nfor (let i = 0; i < str.length; i++) {\n\tif (str[i] > k) {\n\t\tres++;\n\t};\n};\n\nprint (res);\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "89b7c9fcbb70aac35b26a0f3d5fedd03", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var l = readline().split(' ')\nvar n = +l[0]\nvar k = +l[1]\nvar a = readline().split(' ').map(function(v){return v+ ;})\nk=a[k-1]\na = a.filter(function(v){return v>=k&&v>0;})\nprint(a.length)", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "0524e9948b61a6c90ba70fcb151b9224", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var countK = readline().split(' ');\nvar input = readline().split(' ');\n\nvar minScore = input[countK[1]];\nvar advance = 0;\nfor (let i = 0; i < input.length; i++) {\n if (+input[i] >= +minScore) advance++;\n}\nprint(advance);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ec2d64b62311c5fa1b62b2f1303cb54f", "src_uid": "193ec1226ffe07522caf63e84a7d007f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var nick = readline();\nnick = nick.split.(\"\")sort();\nvar noSeRepiten = nick.length;\nvar contador = 0;\n\nfor (var i=0; i Number(v));\n\nconst answer = coverCount(n, m, a);\n\nprint(answer);\n\nfunction coverCount(n, m, a) {\n return Math.ceil(n / a) * Math.ceil(m / a);\n}\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ac7be4e1f98ce1f59f51f015d4343591", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "const [m, n, a] = readline().split(\" \").map(x => parseInt(x));\nprint(Math.ceil(m/a)*Math.ceil(n/a));", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f445856e9493a0c6c4bfaa3e34873c8f", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": " calculate = (n1, n2) => Math.ceil(n1 / n2);\n let n = 0, m = 0, a = 0;\n[n, m, a] = readline().split(' ');\nprint(calculate(n, a)*calculate(m, a));", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "8446e7ab594c66b4d7fc1baa0dfccfda", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var n=readline()\nvar m=readline()\nvar k=readline()\nvar x=(n+k-1)/k\nvar y=(m+k-1)/k\nprint y", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "361a5d0b988ccc71b484f5e2b7917f2f", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "function solve(n, m, a){\n let long = n / a\n let larg = m / a\n return Math.ceil(long) * Math.ceil(larg)\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "a469803d89b943dd18d470962d5c53d4", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "const nums = readline().split(\" \").map(x => parseInt(x));\nconst [n, m , a] = nums;\nprint(Math.round(n/a)*Math.round(m/a));", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "b0c4a6e756afb0358be59896f0977fd5", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "function id (x,y) {\n\treturn (x - x % y) / y\n}\t\n\nvar numbers = readline().split(\" \");\nvar n numbers = [0];\nvar m numbers = [1];\nvar a numbers = [2];\n\nvar resultat = 0;\n\nvar w = id(m, a);\nvar h = id(n, a);\n\nvar mr = (m % a);\n\nif (mr !==0)\n\tw = w + 1;\nif (nr !==0 )\n\th = h + 1;\n\nresult = w * h;\n\nprint(result)\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ac795caa91b622c0ad7a05c01884ddef", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "print \"4\";", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "5b1264201f3e8a79fcaf3cb816902484", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "Node.js", "source_code": "var readline = require('readline');\nvar rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\n\nrl.on('line', function(line){\n\tif(!line) {\n\t\tprocess.exit()\n\t}\n const ancho, largo, baldoza = line.split(\" \").map(n => Number(n));\n const cantidadVertical = Math.floor(largo / baldoza) + 1\n const cantidadHorizontal = Math.floor(ancho / baldoza) + 1\n\n return cantidadVertical * cantidadHorizontal;\n})\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e0c1d517ce250627b38d7e4cf48b4fe0", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "process.stdin.read();\n\nprocess.stdin.on(\"data\", c => {\n const inp = c.toString();\n const [n, m, a] = inp.split(\" \").map(v => Number(v));\n\n const answer = coverCount(n, m, a);\n\n console.log(answer);\n process.exit(0);\n});\n\nfunction coverCount(n, m, a) {\n return Math.ceil(n / a) * Math.ceil(m / a);\n}\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "649d539053eac99cbb81c65a9e6c8fdb", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "let input = readline().split(' ').map((item)=>{ return (+item); });\n\nprint (input[0]);\n\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "c9984d0d7fbf7191191ee3e82d1b069e", "src_uid": "ef971874d8c4da37581336284b688517", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var a = readline();\nvar b = readline();\nvar c = readline();\nvar max = 0;\nvar abc = [a,b,c];\nfor (i in abc){\nabc[i]=parseInt(abc[i]);\nabc.sort(mySort);\nif (abc[2]!==1){\nif(abc[1]+abc[0]>=abc[1]*abc[0]){\n\tmax = abc[2]*(abc[1]+abc[0]);}\nelse max = abc[2]*(abc[1]*abc[0]);\n}\nelse max = abc[0]+abc[1]+abc[2];\nprint(max);\nfunction mySort(a, b){return a-b;}\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "59f73e80b85001d9832e1d4719aa9b11", "src_uid": "1cad9e4797ca2d80a12276b5a790ef27", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var string = \"5+4+3+1\",\n\tmas = [];\n\nfor (var i = 0, length = string.length; i < length; i++) {\n\tif(string[i]!=\"+\") {\n\t\tmas[mas.length] = string[i];\n\t}\n}\n\nfor (var i = 0, length = mas.length - 1; i < length; i++) {\n\tif(mas[i] < mas[i+1]) {\n\t\tfor (var j = i+1, j < mas.length - 1; j++) {\n\t\t\tif (mas[i] < mas[j+1]) {\n\t\t\t\tvar current = mas[i];\n\t\t\t\tmas[i] = mas[j+1];\n\t\t\t\tmas[j+1] = current;\n\t\t\t}\n\t\t}\n\t}\n}\n\nconsole.log(mas);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "2dd1b97db10bb5543e96d0a686d473d2", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var str = readline();//.split(\" \").map(function(x) { return parseInt(x); });\n\nvar numbers = str.split(+);\nvar ones = \"\";\nvar twos = \"\";\nvar threes = \"\";\nfor(i = 0; i < numbers.length; i++){\n\tif (numbers[i] == 1){\n\t\t\n\t\tif (ones == \"\"){\n\t\t\tones += \"1\";\n\t\t}\n\t\telse{\n\t\t\tones += \"+1\";\n\t\t}\n\t}\n\tif (numbers[i] == 2){\n\t\tif (twos == \"\"){\n\t\t\ttwos += \"2\";\n\t\t}\n\t\telse{\n\t\t\ttwos += \"+2\";\n\t\t}\n\t}\n\tif (numbers[i] == 1){\n\t\tif (threes == \"\"){\n\t\t\tthrees += \"3\";\n\t\t}\n\t\telse{\n\t\t\tthrees += \"+3\";\n\t\t}\n\t}\t\n\t\n\t\n}\nvar summ = ones + \"+\" + twos + \"+\" + threes;\n print (summ);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e6b02d6fbf0f3df1396a44dcf703b9a0", "src_uid": "76c7312733ef9d8278521cf09d3ccbc8", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\"use strict\";\nlet x = +readline(), y = 0, [h, m] = readline().split(' ').map(s => +s);\nfor (; !`${h}${m}`.match(/7/); y++, m -= x)\n if (m < 0) m += 60, h = h ? h - 1 : 24;\nprint(y);\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f4e116ede4f80e9b46cd96f41762ac30", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "let x = +readline(), y = 0, t = readline().split(' ').map(s => +s);\nfor (; !`${t[0]}${t[1]}`.match(/7/); y++, t[1] -= x)\n if (t[1] < 0) t[1] += 60, t[0] = t[0] ? t[0] - 1 : 24;\nprint(y);\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "2e42aeb411d38a0babb878b3d4c9db19", "src_uid": "5ecd569e02e0164a5da9ff549fca3ceb", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "\n\n\n \n \n \n Document\n\n\n \n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "24438e5901d6998ece4fce858c8ea5dd", "src_uid": "84cb9ad2ae3ba7e912920d7feb4f6219", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var inputString = readline();\nlet str = inputString.split(\" \");\nprint(str[1])\n// inputString = inputString.toLowerCase();\n\n// let strings = inputString.split(' ');\n// let firstStrCounter = 0,\n// secondStrCounter = 0;\n\n// for (let i = 0; i < strings[0].length; i++) {\n// if (strings[0].charCodeAt(i) > strings[1].charCodeAt(i)) {\n// firstStrCounter++;\n// } else if (strings[0].charCodeAt(i) < strings[1].charCodeAt(i)) {\n// secondStrCounter++;\n// }\n// }\n\n// print(firstStrCounter - secondStrCounter)", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f410e47d84788970f941be0394a5320f", "src_uid": "ffeae332696a901813677bd1033cf01e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var l1 = readine();\nvar l2 = readine();\nfor(i in l1){\n if(l1[i].toLowerCase() < l2[i].toLowerCase()){\nreturn -1;\n}else{\nreturn 1;}\n}\nreturn 0;\n}\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "a47ba7e50738bcd807a4921c6fc891db", "src_uid": "ffeae332696a901813677bd1033cf01e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let inputString = readline();\ninputString = inputString.toLowerCase();\n\nlet strings = inputString.split(' ');\nlet firstStrCounter = 0,\n secondStrCounter = 0;\n\nfor (let i = 0; i < strings[0].length; i++) {\n if (strings[0].charCodeAt(i) > strings[1].charCodeAt(i)) {\n firstStrCounter++;\n } else if (strings[0].charCodeAt(i) < strings[1].charCodeAt(i)) {\n secondStrCounter++;\n }\n}\nprint(firstStrCounter - secondStrCounter);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "cab8f681ed9c1895c3b13e84650a40ce", "src_uid": "ffeae332696a901813677bd1033cf01e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\n\nfunction solveSplitsProblem(n) {\n let result = Math.floor((n/2 + 1));\n print(result)\n}\n\nlet n = readline();\nsolveSplitsProblem(n);\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ca247c604391b3bbb360f4daf57a91e1", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\n\n\n var n = readline();\n let result = Math.floor((n/2 + 1));\n print(result);\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "183763e7a5f73669b8223a7fcf8b3f4d", "src_uid": "5551742f6ab39fdac3930d866f439e3e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "(function f(n){\n\tif(n>2&&%2===0)\n\t\tconsole.log(YES);\n\telse \n\tconsole.log(NO);\n})();", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "77e1bc068c16e821c7b989eee8e3d850", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = readLine(parseInt());\nfunction watermelon(w) {\n if(w>2 && w%2===0) {\n console.log(\"YES\");\n } else {\n console.log(\"NO\");\n }\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "08abfe7824fa1220a3b5c559c98028f9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let k = readLine()\nif(k === 2 || k % 2 !== 0){\n print('NO')\n}else{\n print('YES')\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "84cc3a9fe172e6cc8b7d6b68d2074c9e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function delitarbuz = (w) => {\n\tif (w = 1 || w = 0) {\n\t\treturn false;\n\t}\n\tif (w%2 === 0){\n\t\treturn true;\n\t}\n\tif (w%2 != 0){\n\t\treturn false;\n\t}\n}\n\ndelitarbuz(prompt());", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "12dc399d76c72977adc48d7b29eb1045", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet w;\nrl.on('line', (input) => {\n w = input;\n console.log(w % 2 === 0 ? 'YES' : 'NO');\n\n rl.close();\n});", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f985654dbc33b266a393fa3744dc1a0e", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "a=readline();print(a%2==0&&a>2?'YES':'NO');", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e1d98b4dde664bc443260125b3cbdc11", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "const nmk = readline().split(\" \").map((x) => { return parseInt(x); });\n const N = nmk[0];\n const M = nmk[1];\n const K = nmk[2];\n const numbers = readline().split(\" \").map((x) => { return parseInt(x); });\n\n let cl = new Array(M + 1 - 1);\n\n // for (let i = 0; i < N; i++) {\n // if (!(cl[numbers[i]])) {\n // cl[numbers[i]] = [];\n // }\n // cl[numbers[i]].push(i + 1);\n // }\n //\n // let res = new Array(K);\n // let num = 0;\n // for (let i = 1; i < M + 1; i++) {\n // for (let j = 0; j < cl[i].length; j++) {\n // if (!(res[num])) {\n // res[num] = [];\n // }\n // res[num].push(cl[i][j]);\n // num = (num + 1) % K;\n // }\n // }\n //\n // for (let i = 0; i < K; i++) {\n // let resStr = res[i].length;\n // for (let j = 0; j < res[i].length; j++) {\n // resStr += ' ' + res[i][j];\n // }\n // print(resStr);\n // }\n print(1);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e2a92e449e094b4d77fae64c5a5a369f", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = prompt('what is weight','');\nif(w>2)\n {\n w=w%2 ; \n if(w==0)\n {\n document.write('yes');\n }\n else\n {\n document.write('no') ;\n }\n }\nelse\n {\n document.write('no');\n }", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "90e23a1c72c814b81f5cee08757a1e12", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let readline = require('readline');\n\nlet rl = readline.createInterface({\n\tinput: process.stdin,\n\toutput: process.stdout\n});\n\nrl.question(\"\", function(w) {\n\tif(w%2===0) {\n\t\tconsole.log(\"YES\");\n\t} else {\n\t\tconsole.log(\"NO\");\n\t}\n\trl.close();\n});\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "fb0cdae64740382aec0efdbb1466b2a6", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var kg = prompt (\"Introduce peso de la sandia\");\nkg = parseInt(kg);\nif ((kg>=1)&&(kg<=100)){}\nif ((kg%2==0)&&(kg>2)){\n\tdocument.write (\"YES\");\n} else {document.write (\"NO\");\n}}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "6886fba222068895b6d9e64500a9e886", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = readline();\n\nw%2 === 0 ? print('YES') : print('NO');", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "a19d832b5a6aecd6c82be86bc741acc3", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = prompt('what is weight','');\nif(w>2)\n {\n w=w%2 ; \n if(w==0)\n {\n console.log('yes');\n }\n else\n {\n console.log('no') ;\n }\n }\nelse\n {\n console.log('no');\n }", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "c0d0d5f04325587b5b532c6f943c6e3a", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Node.js", "source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n// Make a Snippet for the code above this and then write your logic in main();\n\n\nfunction main() {\n const x = readline();\n console.log(divideEvenWatermelon(x)\n}\nfunction divideEvenWatermelon(weight) {\n if ((weight < 1 && weight > 100 ) || (weight % 2 !== 0)) console.log('NO');\n let evenWeights = [];\n for (let i = 0; i < weight; i++) {\n if (i % 2 === 0 && i > 0) {\n evenWeights.push(i);\n }\n }\n for (let i = 0; i < evenWeights.length; i++) {\n for (let j = 0; j < evenWeights.length; j++) {\n if (evenWeights[i] + evenWeights[j] === weight) console.log('YES');\n }\n }\n}\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "058b65aed721f9f498ae201ea44fc217", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let a = prompt();\na = Number.parseInt(a);\nconst isEven = (num) => Math.floor(a/2) * 2 === a;\n\nconsole.log(isEven(a) && a !== 2 ? \"YES\" : \"NO\")", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "2d6291dbbce75d0d24a8a8af71de594c", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var pesos = new Array(100 + 1);\nvar peso = Number(readline());\n\npesos[0] = pesos[1] = pesos[2] = \"NO\"; \nfor(let i = 3; i < 100 + 1; ++i)\n{\n\tpesos[i] = (i%2 === 0 ? \"YES\" : \"NO\");\n}\n\nprint(pesos[peso]);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "90d4d0c5912aff0fdabbddae7ae250d2", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = readline();\nprint(w%2===0 && w>2 ? \"YES\":\"NO\");", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "905aa91acc8addf191eb055aaf7e6332", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var input = readline().split(' ');\nvar check = false;\nfor(var i=2;i 2) {\n console.log(\"YES\");\n} else {\n console.log(\"NO\");\n}\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "497db7af3fd1172503fd8de666bf551d", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let a = readLine();\na = Number.parseInt(a);\nconst isEven = (num) => Math.floor(a/2) * 2 === a;\n \nconsole.log(isEven(a) && a !== 2 ? \"YES\" : \"NO\")", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "a622e27c2463a40fe73733ad1ab4ddc0", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let x = readline();\nif (!(x & 1) && x != 2)print(\"YES\"); else print(\"NO\");\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "eef268e6651ca2dd55aff33a9edaa0b7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let line = readline().split(' ');\nlet b = parseInt(line[0]) - 2;\nconsole.log((b > 0 && b % 2 === 0) ? 'YES' : 'NO')", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "b438cca6cc5c53bb2c4252cafcceedde", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = readline();\n\n\nif (w % 2 === 0) {\n print('YES');\n} else if (w === 2) {\n print('NO');\n} else {\n print('NO');\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "4679b6f2556ac706ab766134df13f3bb", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "Node.js", "source_code": "console.log(process.argv[2]%2 === 0 ? \"YES\", \"NO\")", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "fe15d855f78d4c7cf7a957618b7343e8", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\n\n\n\n

\n\n\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e346774c797b02f217fe392ff8c496e9", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let x;\nx = readline();\nprint(\"YES\");", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "5da9dd8551398802f353fedd13c6afe4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let w = readline();\nprint((w%2===0 && w>2)?\"YES\":\"NO\");", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "fafad04c10e98470b6391d5c1e738bc7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false,\n});\n\nlet max_lines = -1;\nlet line_cont = 0;\nlet array = [];\n\nrl.on(\"line\", (line) => singleDigit(line));\n\n// const oneNumberSeq = (line) => {\n// if (max_lines == -1) {\n// max_lines = line; // 3\n// return;\n// }\n// //build array\n// array[line_cont] = line.trim().split(\" \");\n\n// line_cont++;\n// if (line_cont == max_lines) {\n// main(array);\n// }\n// }\nconst singleDigit = (line) => {\n main(line)\n}\n\n// const twoNumberSeq = (line) => {\n// if (max_lines == -1) {\n// seq = line.trim().split(\" \")\n// max_lines = seq[0] * seq[1] ; // 3\n// return;\n// }\n// //build array\n// array[line_cont] = line.trim().split(\" \");\n\n// line_cont++;\n// if (line_cont == max_lines) {\n// main(array);\n// }\n// }\n\nconst main = (w) => {\n console.log(w % 2 == 0 ? 'YES' : 'NO');\n};\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "3cec283a46b836295ae9509aae37dde4", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "//const readline = () => `8`;\n//const print = (str) => console.log(str);\n\nconst [w] = readline().split(\" \").map(x => parseInt(x));\n\nconst ok = () => {\n print(\"YES\");\n};\n\nconst fail = () => {\n print(\"NO\");\n};\n\n(() => {\n\n if (!(w >= 1 && w <= 100)) {\n return fail();\n }\n\n if (w % 2 === 0) {\n return ok();\n }\n\n fail();\n\n})();\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "9fdb86bcefded789ecbd7eb458d63418", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var line = readline().split(' ')\nif ( line[0] > 3 && line !% 2 ) print('YES')\nelse ('NO')", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "88202fb3de6f1eb1b9c4fcfaec268f54", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "let lines = line.split('\\n').join('')\nlet firstLine = lines[0]\n\nreturn firstLine % 2 === 0 ? 'YES' : 'NO'", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "cbfa5dd54609ab0801c78c03501e81b7", "src_uid": "230a3c4d7090401e5fa3c6b9d994cdf2", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "447901a656df5324c3d2fced464d6bdf", "src_uid": "35202a4601a03d25e18dda1539c5beba", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var str=readline().split(\" \");\nstr.sort();\nvar x = 1;\nvar strEnd = [];\nfor(var i in str) {\n if(str[i]==str[i-1]) {x++;\n if (x==4) for (j=0;j3){\n if (strEnd[0]==strEnd[1]) print(\"Elephant\");\n else print (\"Bear\");\n }\nelse print(\"Alien\");", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "8e4968a73da3ff6476793aa968496545", "src_uid": "43308fa25e8578fd9f25328e715d4dd6", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "let n= readline();\nif (n%2 === 0){\n print('mahmound');\n}else{\n print('ehab');\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "cdd1d91f811d0d6cf426bb42db1e6ff6", "src_uid": "5e74750f44142624e6da41d4b35beb9a", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "import java.io.BufferedReader;\nimport java.io.FileInputStream;\nimport java.io.FileNotFoundException;\nimport java.io.FileOutputStream;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.OutputStream;\nimport java.io.PrintWriter;\nimport java.math.BigInteger;\nimport java.util.ArrayList;\nimport java.util.Arrays;\nimport java.util.Collection;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.Iterator;\nimport java.util.PriorityQueue;\nimport java.util.Scanner;\nimport java.util.Set;\nimport java.util.SortedSet;\nimport java.util.StringTokenizer;\nimport java.util.TreeSet;\n\npublic class Main {\n\n public static void main(String[] args) throws FileNotFoundException {\n //InputStream inputStream = new FileInputStream(\"bluetube.in\");//System.in;\n //OutputStream outputStream = new FileOutputStream(\"bluetube.out\");//.out;\n InputStream inputStream = System.in;\n OutputStream outputStream = System.out;\n\n\n InputReader in = new InputReader(inputStream);\n PrintWriter out = new PrintWriter(outputStream);\n Solver solver = new Solver();\n solver.solve(in, out);\n out.close();\n }\n}\n\n\n\nclass Solver {\n\n public void solve(InputReader in, PrintWriter out) {\n BigInteger a = new BigInteger(in.next());\n BigInteger b = new BigInteger(in.next());\n out.print(a.add(b));\n }\n}\n\nclass InputReader {\n private BufferedReader reader;\n private StringTokenizer tokenizer;\n\n public InputReader(InputStream stream) {\n reader = new BufferedReader(new InputStreamReader(stream));\n tokenizer = null;\n }\n\n public String next() {\n while (tokenizer == null || !tokenizer.hasMoreTokens()) {\n try {\n tokenizer = new StringTokenizer(reader.readLine());\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n return tokenizer.nextToken();\n }\n\n public long nextLong() {\n return Long.parseLong(next());\n }\n public int nextInt() {\n return Integer.parseInt(next());\n }\n\n public double nextDouble() {\n return Double.parseDouble(next());\n }\n}\n\n\n\n\n\n\n\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "6017399e91c92d33d6e41e5cac118158", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "function main() {\n\nvar line = readline().split(' ')\nprint(parseInt(line[0]) + parseInt(line[1]))\n\n\n\nmain();", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "83e4aa5fff55f9c170cf5d1d8e1d17f0", "src_uid": "b6e3f9c9b124ec3ec20eb8fcea075add", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "var inp = readline();\n\nlet count4 = inp.match(/4/g);\nlet count7 = inp.match(/7/g);\n\nif (count4) {\n if (count7) {\n if (count4.length >= count7.length) {\n print(4);\n } else {\n print(7);\n }\n }\n} else if(count7) {\n print(7);\n} else {\n print(-1);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "da36646e5b38f7df755d166cb2349aa4", "src_uid": "639b8b8d0dc42df46b139f0aeb3a7a0a", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "function binStr(bs) {\n if (bs.length < 7) return \"no\";\n let tot = 0;\n for (let i = bs.length-1, j = 0; i >= 0; i--, j++) {\n tot += bs[i] * Math.pow(2, j);\n }\n if (tot <= 64) return \"no\";\n return \"yes\";\n}\n\nconsole.log(binStr('100010001'));", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "4f800f6f4531f410d4f366e21041f893", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "function div64(strn) {\n if (strn.length < 7)\n return 'no'\n // 1000000 === 64\n var zeros = 0\n for (let i = strn.length - 1; i >= 0; i--)\n if (strn[i] === '1' && zeros >= 6)\n return 'yes'\n else if (strn[i] === '0')\n zeros++\n return 'no'\n}\n\nvar strn = readline()\nprint(div64(strn))\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "97addf0b412ce41a176c7203e7b184b1", "src_uid": "88364b8d71f2ce2b90bdfaa729eb92ca", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "let index = 0;\nlet arrData = [];\nprocess.stdin.on('data', function(data) {\n arrData.push(data.toString());\n if(++index == 2) {\n console.log(count(arrData[0], arrData[1]));\n }\n});\n\nfunction count(daysCount, days) {\n let sToFArr = days.match( /SF/ig );\n let fToSArr = days.match( /FS/ig );\n let fToS = (fToSArr || []).length;\n let sToF = (sToFArr || []).length;\n return sToF > fToS ? 'YES' : 'NO';\n}\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "899af6cb49e0414f8ea35f1c1a77a673", "src_uid": "ab8a2070ea758d118b3c09ee165d9517", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nconst fn = (x) => {\n const s = x.reduce((r, i) => r + i, 0);\n if (s % 2) return 'NO';\n\n for (let i = 0; i < 4; i++) {\n if (x[i] === s / 2) return 'YES';\n if (x[i] > s / 2) continue;\n for (let j = i + 1; j < 4; j++) {\n const t = x[i] + x[j];\n if (t === s / 2) return 'YES';\n if (t > s / 2) continue;\n for (let k = j + 1; k < 4; k++) {\n if (t + x[k] === s / 2) return 'YES';\n if (t + x[k] > s / 2) continue;\n }\n }\n }\n return 'NO';\n}\n\nwrite(fn(readline().split(' ').map(Number);))", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "18f80d3fa3db5ba55d0cefa31b510277", "src_uid": "5a623c49cf7effacfb58bc82f8eaff37", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var n = parseInt(readline());\nvar integers = readline().split(' ').map(x => parseInt(x));\nvar ones = 0, zeros = 0, max = 0;\nlet maxSequence = [];\nfor (var i = 0; i < n; i++) {\n if (integers[i] === 1) zeros++, ones--;\n else ones++;\n if (ones < 0) ones = 0;\n max = Math.max(max, zeros);\n}\nif (zeros === n) print(n - 1);\nelse print(max + ones);\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "c2afbd377170deeb7298dcb8ed28e5af", "src_uid": "9b543e07e805fe1dd8fa869d5d7c8b99", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var y = readline();\nvar sB = readline();\n\nvar a = y.split(' ');\nvar aB = a[0];\nvar lG = a[1];\n\nvar x = cH(lG, sB);\nprint(x);\n\nfunction cH(lG,sB) {\n var aSB = sB.split(' ');\n var res = 0;\n\n for (let i = 0 ; i\ndocument.write(25);\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "923fc87641e24e33044172f149d269d9", "src_uid": "dcaff75492eafaf61d598779d6202c9d", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function getOutput(n, a, x, b, y) {\n const maxNumberOfSteps = n;\n for (let currentMinute = 0; currentMinute < maxNumberOfSteps; currentMinute++) {\n let danielCurrentStation = (a + currentMinute) % maxNumberOfSteps;\n if (danielCurrentStation === 0) {\n danielCurrentStation = n;\n }\n let vladCurrentStation = (b - currentMinute) % maxNumberOfSteps;\n if (vladCurrentStation < 0) {\n vladCurrentStation = n + vladCurrentStation;\n }\n if (vladCurrentStation === 0) {\n vladCurrentStation = n;\n }\n if (danielCurrentStation === vladCurrentStation) {\n return 'YES';\n }\n if (danielCurrentStation === x || vladCurrentStation === y) {\n break;\n }\n }\n return 'NO';\n}\n\nfunction main() {\n let line = readline().split(' ');\n let [n, a, x, b, y] = line.map(x => parseInt(x));\n console.log(getOutput(n, a, x, b, y));\n}\n\nmain();", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "bb43eb7bd442442164f000527d9ab33f", "src_uid": "5b889751f82c9f32f223cdee0c0095e4", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "function getAns(k,l,m,n,d){\n var dead = new Array(d+2);\n for (let i=1;i<=d;i++)\n dead[i]=false;\n var ans=0;\n for (let i=1;i<=d;i++){\n if (i%k===0||i%l===0||i%m===0||i%n===0){\n if (dead[i]===false){\n ans++;\n dead[i]=true;\n }\n }\n }\n return ans;\n}\n\n\nvar input=readline().split(' ');\nvar k=+input[0],l=+input[1],m=+input[2],n=+input[3],d=+input[4];\nprint(getAns(k,l,m,n,d));\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ad60ffc23a58017861182bf6d729ec16", "src_uid": "46bfdec9bfc1e91bd2f5022f3d3c8ce7", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function fat(n) {\n let res = 1;\n for(let i = 2; i <= n; i++) res=res*i;\n return res;\n}\n\nfunction main(){\n let numbers = readline().split(\" \").map(function(x) { return parseInt(x); });\n let a = numbers[0], b = numbers[1]\n // print(a,b);\n let res;\n if(a <= b) res = fat(a);\n else res = fat(b);\n print(res);\n}\n\nmain()\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "480d262e13b762a1e2c2a9483ac27085", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function fat(n) {\n let res = 1;\n for(let i = 2; i <= n; i++) res=res*i;\n return res;\n}\n\nfunction main(){\n // let numbers = readline().split(\" \").map(function(x) { return parseInt(x); });\n // let a = numbers[0], b = numbers[1]\n // // print(a,b);\n // let res;\n // if(a <= b) res = fat(a);\n // else res = fat(b);\n // print(res);\n // return res;\n}\n\nmain()\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "54dbac2e5375a6e3f73b263770714908", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function bla(n) {\n let res = 1;\n for(let i = 2; i <= n; i++) res=res*i;\n return res;\n}\n\nfunction main(){\n // let numbers = readline().split(\" \").map(function(x) { return parseInt(x); });\n // let a = numbers[0], b = numbers[1]\n // // print(a,b);\n // let res;\n // if(a <= b) res = bla(a);\n // else res = bla(b);\n // print(res);\n // return res;\n}\n\nmain()\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f549a63a6d56d758463ecdd337ea6292", "src_uid": "7bf30ceb24b66d91382e97767f9feeb6", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var line = readline();\nvar minjmp = 0;\nvar idx = -1;\n\nfunction isVowel(chr) {\n ch = chr.toLowerCase();\n return ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u';\n}\n\nfor (let i = 0; i < line.length; i++) {\n if (isVowel(line.charAt(i))) {\n minjmp = Math.max(minjmp, i - idx);\n idx = i;\n }\n}\n\nconsole.log(minjmp);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "6ef347fe6b3244eb2f73dae6a1769b4d", "src_uid": "1fc7e939cdeb015fe31f3cf1c0982fee", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "\n\n\n\n \n \n\n\n\n\n

\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd...

\n \n\n

...\ufffd\ufffd\ufffd\ufffd\ufffd \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd

\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "3fe9219308e4a052222dc70c7a9c761e", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var str = /readline();\n//var str = \"100 100 100\";\nstr = str.split(\" \");\nvar y = parseInt(str[0]);//8\nvar b = parseInt(str[1]);//13\nvar r = parseInt(str[2]);//9\nvar peque = '';\n\nif (y < b && y+1 98) {\n y = 98;\n }\n //alert(\"peque=Y\")\n b = y + 1;\n r = b + 1;\n} else if (peque == b) {\n //alert(\"peque=B\")\n y = b - 1;\n r = b + 1;\n} else if (peque == r) {\n //alert(\"peque=R\")\n b = r - 1;\n y=r-2;\n}\nprint(y+b+r)", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "835c2dc488223478e4ba72ffd1c64e1c", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var t = readline().split(' ')\nvar y = t[0]\nvar b = t[1]\nvar r = t[2]\nvar res = r;\n\nif b < (r-1) then res = b + 1;\nres = res + b;\n\nif y < (b-1) then res = y+1 + y+2;\nres = res + y;\n\nwrite(res);\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "7aa6b5ad64f396ea83516f78f4d22f20", "src_uid": "03ac8efe10de17590e1ae151a7bae1a5", "difficulty": 800.0} {"lang": "JavaScript", "source_code": " var num = readLine().split(' ').map(a=>parseInt(a))\n var n = num[0]\n var m = num[1]\n var count = 0\n var target = n+m\n for(var i = 0;i<=n+m;i++){\n for(var j = 0;j<=n+m;j++){\n if(i**2+j == n && j**2+i == m){\n count++\n }\n }\n }\n print(count)\n ", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "19eaeaaa1dbd6184935e396fe56d9f4f", "src_uid": "03caf4ddf07c1783e42e9f9085cc6efd", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\nvar input=readline();\n\nvar m= input.split(' ')[0]\nvar n= input.split(' ')[1]\n\nif(n%m!==0) {\nprint(-1)\n\n}\n let count= 0;\nlet divided =n/m\nreqursion(divided)\nprint(count)\n\n\nfunction reqursion(divided) {\nif(divided===1) {return}\nif(divided%3===0) {\ncount++;\nreqursion(divided/3)\nreturn\n}\nif(divided%2===0) {\ncount++;\nreqursion(divided/2)\nreturn\n}\nprint(-1)\nreturn\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "2f584453929769e3e416f9215a242926", "src_uid": "3f9980ad292185f63a80bce10705e806", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "\nvar input=readline();\nfunction reqursion(divided) {\nif(divided===1) {print(count)}\nif(divided%3===0) {\ncount++;\nreqursion(divided/3)\n\n}\nif(divided%2===0) {\ncount++;\nreqursion(divided/2)\n\n}\nprint(-1)\n\n}\nvar m= input.split(' ')[0]\nvar n= input.split(' ')[1]\n\nif(n%m!==0) {\nprint(-1)\n\n}\n let count= 0;\nlet divided =n/m\n\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "bc723385b5ea76f74c9fcc72eb3026ab", "src_uid": "3f9980ad292185f63a80bce10705e806", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var input=readline();\n\nvar m= input.split(' ')[0]\nvar n= input.split(' ')[1]\n\nif(n%m!==0) {\nprint(-1)\n\n}\n let count= 0;\nlet divided =n/m\nprint(7)\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "7523d4de45182c28b78a7bc3909400b3", "src_uid": "3f9980ad292185f63a80bce10705e806", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "const [startingCount, divider, priceToBuild, priceToDemolish] = readline().split(\" \").map((x) => +x)\nconst toDemolish = startingCount % divider;\nconst toBuild = divider - toDemolish;\nprint(Math.min(toDemolish * priceToDemolish, toBuild * priceToBuild)) ", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ef262c3246bb9eec69c909dee6e6eab0", "src_uid": "c05d753b35545176ad468b99ff13aa39", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var m = readline().split('');\n\nvar r = 0;\n\nfor (let i of m){\n\n if('0123456789'.indexOf(i) != -1){\n if(i % 2 == 0){\n r++;\n }\n continue;\n }\n \n if('aeiou'.indexOf(i) != -1){\n r++;\n }\n}\n\nprint(r);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "46a334450c62453bf3c727ad4a29fdd3", "src_uid": "b4af2b8a7e9844bf58ad3410c2cb5223", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var BigInteger = require('jsbn').BigInteger;\n\nfunction main() {\n var nums = readline().split(' ');\n var decimal = `${String(\n new BigInteger(Number(nums[0])).divide(new BigInteger(Number(nums[1]))),\n ).slice(2)}0`;\n var c = nums[2];\n\n // console.log('decimal', decimal);\n // console.log(decimal.indexOf(c));\n\n print(decimal.indexOf(c) + 1);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "f344cf6636a88dd56454266c6f06f817", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "/* bignumber.js v5.0.0 https://github.com/MikeMcl/bignumber.js/LICENCE */\n!(function(e) {\n 'use strict';\n function n(e) {\n function a(e, n) {\n var t,\n r,\n i,\n o,\n u,\n s,\n l = this;\n if (!(l instanceof a)) return new a(e, n);\n if (null != n && V(n, 2, 64, C, 'base')) {\n if (((n = 0 | n), (s = e + ''), 10 == n))\n return (l = new a(e instanceof a ? e : s)), I(l, B + l.e + 1, P);\n if (\n ((o = 'number' == typeof e) && 0 * e != 0) ||\n !new RegExp(\n '^-?' + (t = '[' + v.slice(0, n) + ']+') + '(?:\\\\.' + t + ')?$',\n 37 > n ? 'i' : '',\n ).test(s)\n )\n return U(l, s, o, n);\n o\n ? ((l.s = 0 > 1 / e ? ((s = s.slice(1)), -1) : 1),\n z && s.replace(/^0\\.0*|\\./, '').length > 15 && x(C, w, e),\n (o = !1))\n : (l.s = 45 === s.charCodeAt(0) ? ((s = s.slice(1)), -1) : 1),\n (s = A(s, 10, n, l.s));\n } else {\n if (e instanceof a)\n return (\n (l.s = e.s),\n (l.e = e.e),\n (l.c = (e = e.c) ? e.slice() : e),\n void (C = 0)\n );\n if ((o = 'number' == typeof e) && 0 * e == 0) {\n if (((l.s = 0 > 1 / e ? ((e = -e), -1) : 1), e === ~~e)) {\n for (r = 0, i = e; i >= 10; i /= 10, r++);\n return (l.e = r), (l.c = [e]), void (C = 0);\n }\n s = e + '';\n } else {\n if (!h.test((s = e + ''))) return U(l, s, o);\n l.s = 45 === s.charCodeAt(0) ? ((s = s.slice(1)), -1) : 1;\n }\n }\n for (\n (r = s.indexOf('.')) > -1 && (s = s.replace('.', '')),\n (i = s.search(/e/i)) > 0\n ? (0 > r && (r = i),\n (r += +s.slice(i + 1)),\n (s = s.substring(0, i)))\n : 0 > r && (r = s.length),\n i = 0;\n 48 === s.charCodeAt(i);\n i++\n );\n for (u = s.length; 48 === s.charCodeAt(--u); );\n if ((s = s.slice(i, u + 1)))\n if (\n ((u = s.length),\n o && z && u > 15 && (e > y || e !== p(e)) && x(C, w, l.s * e),\n (r = r - i - 1),\n r > G)\n )\n l.c = l.e = null;\n else if ($ > r) l.c = [(l.e = 0)];\n else {\n if (\n ((l.e = r), (l.c = []), (i = (r + 1) % b), 0 > r && (i += b), u > i)\n ) {\n for (i && l.c.push(+s.slice(0, i)), u -= b; u > i; )\n l.c.push(+s.slice(i, (i += b)));\n (s = s.slice(i)), (i = b - s.length);\n } else i -= u;\n for (; i--; s += '0');\n l.c.push(+s);\n }\n else l.c = [(l.e = 0)];\n C = 0;\n }\n function A(e, n, t, i) {\n var o,\n u,\n l,\n f,\n h,\n g,\n p,\n d = e.indexOf('.'),\n m = B,\n w = P;\n for (\n 37 > t && (e = e.toLowerCase()),\n d >= 0 &&\n ((l = W),\n (W = 0),\n (e = e.replace('.', '')),\n (p = new a(t)),\n (h = p.pow(e.length - d)),\n (W = l),\n (p.c = s(c(r(h.c), h.e), 10, n)),\n (p.e = p.c.length)),\n g = s(e, t, n),\n u = l = g.length;\n 0 == g[--l];\n g.pop()\n );\n if (!g[0]) return '0';\n if (\n (0 > d\n ? --u\n : ((h.c = g),\n (h.e = u),\n (h.s = i),\n (h = L(h, p, m, w, n)),\n (g = h.c),\n (f = h.r),\n (u = h.e)),\n (o = u + m + 1),\n (d = g[o]),\n (l = n / 2),\n (f = f || 0 > o || null != g[o + 1]),\n (f =\n 4 > w\n ? (null != d || f) && (0 == w || w == (h.s < 0 ? 3 : 2))\n : d > l ||\n (d == l &&\n (4 == w ||\n f ||\n (6 == w && 1 & g[o - 1]) ||\n w == (h.s < 0 ? 8 : 7)))),\n 1 > o || !g[0])\n )\n e = f ? c('1', -m) : '0';\n else {\n if (((g.length = o), f))\n for (--n; ++g[--o] > n; ) (g[o] = 0), o || (++u, (g = [1].concat(g)));\n for (l = g.length; !g[--l]; );\n for (d = 0, e = ''; l >= d; e += v.charAt(g[d++]));\n e = c(e, u);\n }\n return e;\n }\n function E(e, n, t, i) {\n var o, u, s, f, h;\n if (((t = null != t && V(t, 0, 8, i, m) ? 0 | t : P), !e.c))\n return e.toString();\n if (((o = e.c[0]), (s = e.e), null == n))\n (h = r(e.c)), (h = 19 == i || (24 == i && q >= s) ? l(h, s) : c(h, s));\n else if (\n ((e = I(new a(e), n, t)),\n (u = e.e),\n (h = r(e.c)),\n (f = h.length),\n 19 == i || (24 == i && (u >= n || q >= u)))\n ) {\n for (; n > f; h += '0', f++);\n h = l(h, u);\n } else if (((n -= s), (h = c(h, u)), u + 1 > f)) {\n if (--n > 0) for (h += '.'; n--; h += '0');\n } else if (((n += u - f), n > 0))\n for (u + 1 == f && (h += '.'); n--; h += '0');\n return e.s < 0 && o ? '-' + h : h;\n }\n function D(e, n) {\n var t,\n r,\n i = 0;\n for (u(e[0]) && (e = e[0]), t = new a(e[0]); ++i < e.length; ) {\n if (((r = new a(e[i])), !r.s)) {\n t = r;\n break;\n }\n n.call(t, r) && (t = r);\n }\n return t;\n }\n function F(e, n, t, r, i) {\n return (\n (n > e || e > t || e != f(e)) &&\n x(\n r,\n (i || 'decimal places') +\n (n > e || e > t ? ' out of range' : ' not an integer'),\n e,\n ),\n !0\n );\n }\n function _(e, n, t) {\n for (var r = 1, i = n.length; !n[--i]; n.pop());\n for (i = n[0]; i >= 10; i /= 10, r++);\n return (\n (t = r + t * b - 1) > G\n ? (e.c = e.e = null)\n : $ > t ? (e.c = [(e.e = 0)]) : ((e.e = t), (e.c = n)),\n e\n );\n }\n function x(e, n, t) {\n var r = new Error(\n [\n 'new BigNumber',\n 'cmp',\n 'config',\n 'div',\n 'divToInt',\n 'eq',\n 'gt',\n 'gte',\n 'lt',\n 'lte',\n 'minus',\n 'mod',\n 'plus',\n 'precision',\n 'random',\n 'round',\n 'shift',\n 'times',\n 'toDigits',\n 'toExponential',\n 'toFixed',\n 'toFormat',\n 'toFraction',\n 'pow',\n 'toPrecision',\n 'toString',\n 'BigNumber',\n ][e] +\n '() ' +\n n +\n ': ' +\n t,\n );\n throw ((r.name = 'BigNumber Error'), (C = 0), r);\n }\n function I(e, n, t, r) {\n var i,\n o,\n u,\n s,\n l,\n c,\n f,\n a = e.c,\n h = O;\n if (a) {\n e: {\n for (i = 1, s = a[0]; s >= 10; s /= 10, i++);\n if (((o = n - i), 0 > o))\n (o += b),\n (u = n),\n (l = a[(c = 0)]),\n (f = ((l / h[i - u - 1]) % 10) | 0);\n else if (((c = g((o + 1) / b)), c >= a.length)) {\n if (!r) break e;\n for (; a.length <= c; a.push(0));\n (l = f = 0), (i = 1), (o %= b), (u = o - b + 1);\n } else {\n for (l = s = a[c], i = 1; s >= 10; s /= 10, i++);\n (o %= b),\n (u = o - b + i),\n (f = 0 > u ? 0 : ((l / h[i - u - 1]) % 10) | 0);\n }\n if (\n ((r =\n r || 0 > n || null != a[c + 1] || (0 > u ? l : l % h[i - u - 1])),\n (r =\n 4 > t\n ? (f || r) && (0 == t || t == (e.s < 0 ? 3 : 2))\n : f > 5 ||\n (5 == f &&\n (4 == t ||\n r ||\n (6 == t &&\n ((o > 0 ? (u > 0 ? l / h[i - u] : 0) : a[c - 1]) % 10) &\n 1) ||\n t == (e.s < 0 ? 8 : 7)))),\n 1 > n || !a[0])\n )\n return (\n (a.length = 0),\n r\n ? ((n -= e.e + 1), (a[0] = h[(b - n % b) % b]), (e.e = -n || 0))\n : (a[0] = e.e = 0),\n e\n );\n if (\n (0 == o\n ? ((a.length = c), (s = 1), c--)\n : ((a.length = c + 1),\n (s = h[b - o]),\n (a[c] = u > 0 ? p((l / h[i - u]) % h[u]) * s : 0)),\n r)\n )\n for (;;) {\n if (0 == c) {\n for (o = 1, u = a[0]; u >= 10; u /= 10, o++);\n for (u = a[0] += s, s = 1; u >= 10; u /= 10, s++);\n o != s && (e.e++, a[0] == N && (a[0] = 1));\n break;\n }\n if (((a[c] += s), a[c] != N)) break;\n (a[c--] = 0), (s = 1);\n }\n for (o = a.length; 0 === a[--o]; a.pop());\n }\n e.e > G ? (e.c = e.e = null) : e.e < $ && (e.c = [(e.e = 0)]);\n }\n return e;\n }\n var L,\n U,\n C = 0,\n M = a.prototype,\n T = new a(1),\n B = 20,\n P = 4,\n q = -7,\n k = 21,\n $ = -1e7,\n G = 1e7,\n z = !0,\n V = F,\n j = !1,\n H = 1,\n W = 0,\n J = {\n decimalSeparator: '.',\n groupSeparator: ',',\n groupSize: 3,\n secondaryGroupSize: 0,\n fractionGroupSeparator: ' ',\n fractionGroupSize: 0,\n };\n return (\n (a.another = n),\n (a.ROUND_UP = 0),\n (a.ROUND_DOWN = 1),\n (a.ROUND_CEIL = 2),\n (a.ROUND_FLOOR = 3),\n (a.ROUND_HALF_UP = 4),\n (a.ROUND_HALF_DOWN = 5),\n (a.ROUND_HALF_EVEN = 6),\n (a.ROUND_HALF_CEIL = 7),\n (a.ROUND_HALF_FLOOR = 8),\n (a.EUCLID = 9),\n (a.config = a.set = function() {\n var e,\n n,\n t = 0,\n r = {},\n i = arguments,\n s = i[0],\n l =\n s && 'object' == typeof s\n ? function() {\n return s.hasOwnProperty(n) ? null != (e = s[n]) : void 0;\n }\n : function() {\n return i.length > t ? null != (e = i[t++]) : void 0;\n };\n return (\n l((n = 'DECIMAL_PLACES')) && V(e, 0, S, 2, n) && (B = 0 | e),\n (r[n] = B),\n l((n = 'ROUNDING_MODE')) && V(e, 0, 8, 2, n) && (P = 0 | e),\n (r[n] = P),\n l((n = 'EXPONENTIAL_AT')) &&\n (u(e)\n ? V(e[0], -S, 0, 2, n) &&\n V(e[1], 0, S, 2, n) &&\n ((q = 0 | e[0]), (k = 0 | e[1]))\n : V(e, -S, S, 2, n) && (q = -(k = 0 | (0 > e ? -e : e)))),\n (r[n] = [q, k]),\n l((n = 'RANGE')) &&\n (u(e)\n ? V(e[0], -S, -1, 2, n) &&\n V(e[1], 1, S, 2, n) &&\n (($ = 0 | e[0]), (G = 0 | e[1]))\n : V(e, -S, S, 2, n) &&\n (0 | e\n ? ($ = -(G = 0 | (0 > e ? -e : e)))\n : z && x(2, n + ' cannot be zero', e))),\n (r[n] = [$, G]),\n l((n = 'ERRORS')) &&\n (e === !!e || 1 === e || 0 === e\n ? ((C = 0), (V = (z = !!e) ? F : o))\n : z && x(2, n + d, e)),\n (r[n] = z),\n l((n = 'CRYPTO')) &&\n (e === !0 || e === !1 || 1 === e || 0 === e\n ? e\n ? ((e = 'undefined' == typeof crypto),\n !e && crypto && (crypto.getRandomValues || crypto.randomBytes)\n ? (j = !0)\n : z\n ? x(2, 'crypto unavailable', e ? void 0 : crypto)\n : (j = !1))\n : (j = !1)\n : z && x(2, n + d, e)),\n (r[n] = j),\n l((n = 'MODULO_MODE')) && V(e, 0, 9, 2, n) && (H = 0 | e),\n (r[n] = H),\n l((n = 'POW_PRECISION')) && V(e, 0, S, 2, n) && (W = 0 | e),\n (r[n] = W),\n l((n = 'FORMAT')) &&\n ('object' == typeof e\n ? (J = e)\n : z && x(2, n + ' not an object', e)),\n (r[n] = J),\n r\n );\n }),\n (a.max = function() {\n return D(arguments, M.lt);\n }),\n (a.min = function() {\n return D(arguments, M.gt);\n }),\n (a.random = (function() {\n var e = 9007199254740992,\n n =\n (Math.random() * e) & 2097151\n ? function() {\n return p(Math.random() * e);\n }\n : function() {\n return (\n 8388608 * ((1073741824 * Math.random()) | 0) +\n ((8388608 * Math.random()) | 0)\n );\n };\n return function(e) {\n var t,\n r,\n i,\n o,\n u,\n s = 0,\n l = [],\n c = new a(T);\n if (\n ((e = null != e && V(e, 0, S, 14) ? 0 | e : B), (o = g(e / b)), j)\n )\n if (crypto.getRandomValues) {\n for (\n t = crypto.getRandomValues(new Uint32Array((o *= 2)));\n o > s;\n\n )\n (u = 131072 * t[s] + (t[s + 1] >>> 11)),\n u >= 9e15\n ? ((r = crypto.getRandomValues(new Uint32Array(2))),\n (t[s] = r[0]),\n (t[s + 1] = r[1]))\n : (l.push(u % 1e14), (s += 2));\n s = o / 2;\n } else if (crypto.randomBytes) {\n for (t = crypto.randomBytes((o *= 7)); o > s; )\n (u =\n 281474976710656 * (31 & t[s]) +\n 1099511627776 * t[s + 1] +\n 4294967296 * t[s + 2] +\n 16777216 * t[s + 3] +\n (t[s + 4] << 16) +\n (t[s + 5] << 8) +\n t[s + 6]),\n u >= 9e15\n ? crypto.randomBytes(7).copy(t, s)\n : (l.push(u % 1e14), (s += 7));\n s = o / 7;\n } else (j = !1), z && x(14, 'crypto unavailable', crypto);\n if (!j) for (; o > s; ) (u = n()), 9e15 > u && (l[s++] = u % 1e14);\n for (\n o = l[--s],\n e %= b,\n o && e && ((u = O[b - e]), (l[s] = p(o / u) * u));\n 0 === l[s];\n l.pop(), s--\n );\n if (0 > s) l = [(i = 0)];\n else {\n for (i = -1; 0 === l[0]; l.splice(0, 1), i -= b);\n for (s = 1, u = l[0]; u >= 10; u /= 10, s++);\n b > s && (i -= b - s);\n }\n return (c.e = i), (c.c = l), c;\n };\n })()),\n (L = (function() {\n function e(e, n, t) {\n var r,\n i,\n o,\n u,\n s = 0,\n l = e.length,\n c = n % R,\n f = (n / R) | 0;\n for (e = e.slice(); l--; )\n (o = e[l] % R),\n (u = (e[l] / R) | 0),\n (r = f * o + u * c),\n (i = c * o + (r % R) * R + s),\n (s = ((i / t) | 0) + ((r / R) | 0) + f * u),\n (e[l] = i % t);\n return s && (e = [s].concat(e)), e;\n }\n function n(e, n, t, r) {\n var i, o;\n if (t != r) o = t > r ? 1 : -1;\n else\n for (i = o = 0; t > i; i++)\n if (e[i] != n[i]) {\n o = e[i] > n[i] ? 1 : -1;\n break;\n }\n return o;\n }\n function r(e, n, t, r) {\n for (var i = 0; t--; )\n (e[t] -= i),\n (i = e[t] < n[t] ? 1 : 0),\n (e[t] = i * r + e[t] - n[t]);\n for (; !e[0] && e.length > 1; e.splice(0, 1));\n }\n return function(i, o, u, s, l) {\n var c,\n f,\n h,\n g,\n d,\n m,\n w,\n v,\n y,\n O,\n R,\n S,\n A,\n E,\n D,\n F,\n _,\n x = i.s == o.s ? 1 : -1,\n L = i.c,\n U = o.c;\n if (!(L && L[0] && U && U[0]))\n return new a(\n i.s && o.s && (L ? !U || L[0] != U[0] : U)\n ? (L && 0 == L[0]) || !U ? 0 * x : x / 0\n : NaN,\n );\n for (\n v = new a(x),\n y = v.c = [],\n f = i.e - o.e,\n x = u + f + 1,\n l || ((l = N), (f = t(i.e / b) - t(o.e / b)), (x = (x / b) | 0)),\n h = 0;\n U[h] == (L[h] || 0);\n h++\n );\n if ((U[h] > (L[h] || 0) && f--, 0 > x)) y.push(1), (g = !0);\n else {\n for (\n E = L.length,\n F = U.length,\n h = 0,\n x += 2,\n d = p(l / (U[0] + 1)),\n d > 1 &&\n ((U = e(U, d, l)),\n (L = e(L, d, l)),\n (F = U.length),\n (E = L.length)),\n A = F,\n O = L.slice(0, F),\n R = O.length;\n F > R;\n O[R++] = 0\n );\n (_ = U.slice()),\n (_ = [0].concat(_)),\n (D = U[0]),\n U[1] >= l / 2 && D++;\n do {\n if (((d = 0), (c = n(U, O, F, R)), 0 > c)) {\n if (\n ((S = O[0]),\n F != R && (S = S * l + (O[1] || 0)),\n (d = p(S / D)),\n d > 1)\n )\n for (\n d >= l && (d = l - 1),\n m = e(U, d, l),\n w = m.length,\n R = O.length;\n 1 == n(m, O, w, R);\n\n )\n d--, r(m, w > F ? _ : U, w, l), (w = m.length), (c = 1);\n else 0 == d && (c = d = 1), (m = U.slice()), (w = m.length);\n if (\n (R > w && (m = [0].concat(m)),\n r(O, m, R, l),\n (R = O.length),\n -1 == c)\n )\n for (; n(U, O, F, R) < 1; )\n d++, r(O, R > F ? _ : U, R, l), (R = O.length);\n } else 0 === c && (d++, (O = [0]));\n (y[h++] = d),\n O[0] ? (O[R++] = L[A] || 0) : ((O = [L[A]]), (R = 1));\n } while ((A++ < E || null != O[0]) && x--);\n (g = null != O[0]), y[0] || y.splice(0, 1);\n }\n if (l == N) {\n for (h = 1, x = y[0]; x >= 10; x /= 10, h++);\n I(v, u + (v.e = h + f * b - 1) + 1, s, g);\n } else (v.e = f), (v.r = +g);\n return v;\n };\n })()),\n (U = (function() {\n var e = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i,\n n = /^([^.]+)\\.$/,\n t = /^\\.([^.]+)$/,\n r = /^-?(Infinity|NaN)$/,\n i = /^\\s*\\+(?=[\\w.])|^\\s+|\\s+$/g;\n return function(o, u, s, l) {\n var c,\n f = s ? u : u.replace(i, '');\n if (r.test(f)) o.s = isNaN(f) ? null : 0 > f ? -1 : 1;\n else {\n if (\n !s &&\n ((f = f.replace(e, function(e, n, t) {\n return (\n (c = 'x' == (t = t.toLowerCase()) ? 16 : 'b' == t ? 2 : 8),\n l && l != c ? e : n\n );\n })),\n l && ((c = l), (f = f.replace(n, '$1').replace(t, '0.$1'))),\n u != f)\n )\n return new a(f, c);\n z && x(C, 'not a' + (l ? ' base ' + l : '') + ' number', u),\n (o.s = null);\n }\n (o.c = o.e = null), (C = 0);\n };\n })()),\n (M.absoluteValue = M.abs = function() {\n var e = new a(this);\n return e.s < 0 && (e.s = 1), e;\n }),\n (M.ceil = function() {\n return I(new a(this), this.e + 1, 2);\n }),\n (M.comparedTo = M.cmp = function(e, n) {\n return (C = 1), i(this, new a(e, n));\n }),\n (M.decimalPlaces = M.dp = function() {\n var e,\n n,\n r = this.c;\n if (!r) return null;\n if (((e = ((n = r.length - 1) - t(this.e / b)) * b), (n = r[n])))\n for (; n % 10 == 0; n /= 10, e--);\n return 0 > e && (e = 0), e;\n }),\n (M.dividedBy = M.div = function(e, n) {\n return (C = 3), L(this, new a(e, n), B, P);\n }),\n (M.dividedToIntegerBy = M.divToInt = function(e, n) {\n return (C = 4), L(this, new a(e, n), 0, 1);\n }),\n (M.equals = M.eq = function(e, n) {\n return (C = 5), 0 === i(this, new a(e, n));\n }),\n (M.floor = function() {\n return I(new a(this), this.e + 1, 3);\n }),\n (M.greaterThan = M.gt = function(e, n) {\n return (C = 6), i(this, new a(e, n)) > 0;\n }),\n (M.greaterThanOrEqualTo = M.gte = function(e, n) {\n return (C = 7), 1 === (n = i(this, new a(e, n))) || 0 === n;\n }),\n (M.isFinite = function() {\n return !!this.c;\n }),\n (M.isInteger = M.isInt = function() {\n return !!this.c && t(this.e / b) > this.c.length - 2;\n }),\n (M.isNaN = function() {\n return !this.s;\n }),\n (M.isNegative = M.isNeg = function() {\n return this.s < 0;\n }),\n (M.isZero = function() {\n return !!this.c && 0 == this.c[0];\n }),\n (M.lessThan = M.lt = function(e, n) {\n return (C = 8), i(this, new a(e, n)) < 0;\n }),\n (M.lessThanOrEqualTo = M.lte = function(e, n) {\n return (C = 9), -1 === (n = i(this, new a(e, n))) || 0 === n;\n }),\n (M.minus = M.sub = function(e, n) {\n var r,\n i,\n o,\n u,\n s = this,\n l = s.s;\n if (((C = 10), (e = new a(e, n)), (n = e.s), !l || !n))\n return new a(NaN);\n if (l != n) return (e.s = -n), s.plus(e);\n var c = s.e / b,\n f = e.e / b,\n h = s.c,\n g = e.c;\n if (!c || !f) {\n if (!h || !g) return h ? ((e.s = -n), e) : new a(g ? s : NaN);\n if (!h[0] || !g[0])\n return g[0] ? ((e.s = -n), e) : new a(h[0] ? s : 3 == P ? -0 : 0);\n }\n if (((c = t(c)), (f = t(f)), (h = h.slice()), (l = c - f))) {\n for (\n (u = 0 > l) ? ((l = -l), (o = h)) : ((f = c), (o = g)),\n o.reverse(),\n n = l;\n n--;\n o.push(0)\n );\n o.reverse();\n } else\n for (\n i = (u = (l = h.length) < (n = g.length)) ? l : n, l = n = 0;\n i > n;\n n++\n )\n if (h[n] != g[n]) {\n u = h[n] < g[n];\n break;\n }\n if (\n (u && ((o = h), (h = g), (g = o), (e.s = -e.s)),\n (n = (i = g.length) - (r = h.length)),\n n > 0)\n )\n for (; n--; h[r++] = 0);\n for (n = N - 1; i > l; ) {\n if (h[--i] < g[i]) {\n for (r = i; r && !h[--r]; h[r] = n);\n --h[r], (h[i] += N);\n }\n h[i] -= g[i];\n }\n for (; 0 == h[0]; h.splice(0, 1), --f);\n return h[0]\n ? _(e, h, f)\n : ((e.s = 3 == P ? -1 : 1), (e.c = [(e.e = 0)]), e);\n }),\n (M.modulo = M.mod = function(e, n) {\n var t,\n r,\n i = this;\n return (\n (C = 11),\n (e = new a(e, n)),\n !i.c || !e.s || (e.c && !e.c[0])\n ? new a(NaN)\n : !e.c || (i.c && !i.c[0])\n ? new a(i)\n : (9 == H\n ? ((r = e.s),\n (e.s = 1),\n (t = L(i, e, 0, 3)),\n (e.s = r),\n (t.s *= r))\n : (t = L(i, e, 0, H)),\n i.minus(t.times(e)))\n );\n }),\n (M.negated = M.neg = function() {\n var e = new a(this);\n return (e.s = -e.s || null), e;\n }),\n (M.plus = M.add = function(e, n) {\n var r,\n i = this,\n o = i.s;\n if (((C = 12), (e = new a(e, n)), (n = e.s), !o || !n))\n return new a(NaN);\n if (o != n) return (e.s = -n), i.minus(e);\n var u = i.e / b,\n s = e.e / b,\n l = i.c,\n c = e.c;\n if (!u || !s) {\n if (!l || !c) return new a(o / 0);\n if (!l[0] || !c[0]) return c[0] ? e : new a(l[0] ? i : 0 * o);\n }\n if (((u = t(u)), (s = t(s)), (l = l.slice()), (o = u - s))) {\n for (\n o > 0 ? ((s = u), (r = c)) : ((o = -o), (r = l)), r.reverse();\n o--;\n r.push(0)\n );\n r.reverse();\n }\n for (\n o = l.length,\n n = c.length,\n 0 > o - n && ((r = c), (c = l), (l = r), (n = o)),\n o = 0;\n n;\n\n )\n (o = ((l[--n] = l[n] + c[n] + o) / N) | 0),\n (l[n] = N === l[n] ? 0 : l[n] % N);\n return o && ((l = [o].concat(l)), ++s), _(e, l, s);\n }),\n (M.precision = M.sd = function(e) {\n var n,\n t,\n r = this,\n i = r.c;\n if (\n (null != e &&\n e !== !!e &&\n 1 !== e &&\n 0 !== e &&\n (z && x(13, 'argument' + d, e), e != !!e && (e = null)),\n !i)\n )\n return null;\n if (((t = i.length - 1), (n = t * b + 1), (t = i[t]))) {\n for (; t % 10 == 0; t /= 10, n--);\n for (t = i[0]; t >= 10; t /= 10, n++);\n }\n return e && r.e + 1 > n && (n = r.e + 1), n;\n }),\n (M.round = function(e, n) {\n var t = new a(this);\n return (\n (null == e || V(e, 0, S, 15)) &&\n I(t, ~~e + this.e + 1, null != n && V(n, 0, 8, 15, m) ? 0 | n : P),\n t\n );\n }),\n (M.shift = function(e) {\n var n = this;\n return V(e, -y, y, 16, 'argument')\n ? n.times('1e' + f(e))\n : new a(\n n.c && n.c[0] && (-y > e || e > y)\n ? n.s * (0 > e ? 0 : 1 / 0)\n : n,\n );\n }),\n (M.squareRoot = M.sqrt = function() {\n var e,\n n,\n i,\n o,\n u,\n s = this,\n l = s.c,\n c = s.s,\n f = s.e,\n h = B + 4,\n g = new a('0.5');\n if (1 !== c || !l || !l[0])\n return new a(!c || (0 > c && (!l || l[0])) ? NaN : l ? s : 1 / 0);\n if (\n ((c = Math.sqrt(+s)),\n 0 == c || c == 1 / 0\n ? ((n = r(l)),\n (n.length + f) % 2 == 0 && (n += '0'),\n (c = Math.sqrt(n)),\n (f = t((f + 1) / 2) - (0 > f || f % 2)),\n c == 1 / 0\n ? (n = '1e' + f)\n : ((n = c.toExponential()),\n (n = n.slice(0, n.indexOf('e') + 1) + f)),\n (i = new a(n)))\n : (i = new a(c + '')),\n i.c[0])\n )\n for (f = i.e, c = f + h, 3 > c && (c = 0); ; )\n if (\n ((u = i),\n (i = g.times(u.plus(L(s, u, h, 1)))),\n r(u.c).slice(0, c) === (n = r(i.c)).slice(0, c))\n ) {\n if (\n (i.e < f && --c,\n (n = n.slice(c - 3, c + 1)),\n '9999' != n && (o || '4999' != n))\n ) {\n (!+n || (!+n.slice(1) && '5' == n.charAt(0))) &&\n (I(i, i.e + B + 2, 1), (e = !i.times(i).eq(s)));\n break;\n }\n if (!o && (I(u, u.e + B + 2, 0), u.times(u).eq(s))) {\n i = u;\n break;\n }\n (h += 4), (c += 4), (o = 1);\n }\n return I(i, i.e + B + 1, P, e);\n }),\n (M.times = M.mul = function(e, n) {\n var r,\n i,\n o,\n u,\n s,\n l,\n c,\n f,\n h,\n g,\n p,\n d,\n m,\n w,\n v,\n y = this,\n O = y.c,\n S = ((C = 17), (e = new a(e, n))).c;\n if (!(O && S && O[0] && S[0]))\n return (\n !y.s || !e.s || (O && !O[0] && !S) || (S && !S[0] && !O)\n ? (e.c = e.e = e.s = null)\n : ((e.s *= y.s),\n O && S ? ((e.c = [0]), (e.e = 0)) : (e.c = e.e = null)),\n e\n );\n for (\n i = t(y.e / b) + t(e.e / b),\n e.s *= y.s,\n c = O.length,\n g = S.length,\n g > c && ((m = O), (O = S), (S = m), (o = c), (c = g), (g = o)),\n o = c + g,\n m = [];\n o--;\n m.push(0)\n );\n for (w = N, v = R, o = g; --o >= 0; ) {\n for (\n r = 0, p = S[o] % v, d = (S[o] / v) | 0, s = c, u = o + s;\n u > o;\n\n )\n (f = O[--s] % v),\n (h = (O[s] / v) | 0),\n (l = d * f + h * p),\n (f = p * f + (l % v) * v + m[u] + r),\n (r = ((f / w) | 0) + ((l / v) | 0) + d * h),\n (m[u--] = f % w);\n m[u] = r;\n }\n return r ? ++i : m.splice(0, 1), _(e, m, i);\n }),\n (M.toDigits = function(e, n) {\n var t = new a(this);\n return (\n (e = null != e && V(e, 1, S, 18, 'precision') ? 0 | e : null),\n (n = null != n && V(n, 0, 8, 18, m) ? 0 | n : P),\n e ? I(t, e, n) : t\n );\n }),\n (M.toExponential = function(e, n) {\n return E(this, null != e && V(e, 0, S, 19) ? ~~e + 1 : null, n, 19);\n }),\n (M.toFixed = function(e, n) {\n return E(\n this,\n null != e && V(e, 0, S, 20) ? ~~e + this.e + 1 : null,\n n,\n 20,\n );\n }),\n (M.toFormat = function(e, n) {\n var t = E(\n this,\n null != e && V(e, 0, S, 21) ? ~~e + this.e + 1 : null,\n n,\n 21,\n );\n if (this.c) {\n var r,\n i = t.split('.'),\n o = +J.groupSize,\n u = +J.secondaryGroupSize,\n s = J.groupSeparator,\n l = i[0],\n c = i[1],\n f = this.s < 0,\n a = f ? l.slice(1) : l,\n h = a.length;\n if ((u && ((r = o), (o = u), (u = r), (h -= r)), o > 0 && h > 0)) {\n for (r = h % o || o, l = a.substr(0, r); h > r; r += o)\n l += s + a.substr(r, o);\n u > 0 && (l += s + a.slice(r)), f && (l = '-' + l);\n }\n t = c\n ? l +\n J.decimalSeparator +\n ((u = +J.fractionGroupSize)\n ? c.replace(\n new RegExp('\\\\d{' + u + '}\\\\B', 'g'),\n '$&' + J.fractionGroupSeparator,\n )\n : c)\n : l;\n }\n return t;\n }),\n (M.toFraction = function(e) {\n var n,\n t,\n i,\n o,\n u,\n s,\n l,\n c,\n f,\n h = z,\n g = this,\n p = g.c,\n d = new a(T),\n m = (t = new a(T)),\n w = (l = new a(T));\n if (\n (null != e &&\n ((z = !1),\n (s = new a(e)),\n (z = h),\n (!(h = s.isInt()) || s.lt(T)) &&\n (z &&\n x(\n 22,\n 'max denominator ' + (h ? 'out of range' : 'not an integer'),\n e,\n ),\n (e = !h && s.c && I(s, s.e + 1, 1).gte(T) ? s : null))),\n !p)\n )\n return g.toString();\n for (\n f = r(p),\n o = d.e = f.length - g.e - 1,\n d.c[0] = O[(u = o % b) < 0 ? b + u : u],\n e = !e || s.cmp(d) > 0 ? (o > 0 ? d : m) : s,\n u = G,\n G = 1 / 0,\n s = new a(f),\n l.c[0] = 0;\n (c = L(s, d, 0, 1)), (i = t.plus(c.times(w))), 1 != i.cmp(e);\n\n )\n (t = w),\n (w = i),\n (m = l.plus(c.times((i = m)))),\n (l = i),\n (d = s.minus(c.times((i = d)))),\n (s = i);\n return (\n (i = L(e.minus(t), w, 0, 1)),\n (l = l.plus(i.times(m))),\n (t = t.plus(i.times(w))),\n (l.s = m.s = g.s),\n (o *= 2),\n (n =\n L(m, w, o, P)\n .minus(g)\n .abs()\n .cmp(\n L(l, t, o, P)\n .minus(g)\n .abs(),\n ) < 1\n ? [m.toString(), w.toString()]\n : [l.toString(), t.toString()]),\n (G = u),\n n\n );\n }),\n (M.toNumber = function() {\n return +this;\n }),\n (M.toPower = M.pow = function(e, n) {\n var t,\n r,\n i,\n o = p(0 > e ? -e : +e),\n u = this;\n if (\n (null != n && ((C = 23), (n = new a(n))),\n (!V(e, -y, y, 23, 'exponent') &&\n (!isFinite(e) ||\n (o > y && (e /= 0)) ||\n (parseFloat(e) != e && !(e = NaN)))) ||\n 0 == e)\n )\n return (t = Math.pow(+u, e)), new a(n ? t % n : t);\n for (\n n\n ? e > 1 && u.gt(T) && u.isInt() && n.gt(T) && n.isInt()\n ? (u = u.mod(n))\n : ((i = n), (n = null))\n : W && (t = g(W / b + 2)),\n r = new a(T);\n ;\n\n ) {\n if (o % 2) {\n if (((r = r.times(u)), !r.c)) break;\n t ? r.c.length > t && (r.c.length = t) : n && (r = r.mod(n));\n }\n if (((o = p(o / 2)), !o)) break;\n (u = u.times(u)),\n t ? u.c && u.c.length > t && (u.c.length = t) : n && (u = u.mod(n));\n }\n return n\n ? r\n : (0 > e && (r = T.div(r)), i ? r.mod(i) : t ? I(r, W, P) : r);\n }),\n (M.toPrecision = function(e, n) {\n return E(\n this,\n null != e && V(e, 1, S, 24, 'precision') ? 0 | e : null,\n n,\n 24,\n );\n }),\n (M.toString = function(e) {\n var n,\n t = this,\n i = t.s,\n o = t.e;\n return (\n null === o\n ? i ? ((n = 'Infinity'), 0 > i && (n = '-' + n)) : (n = 'NaN')\n : ((n = r(t.c)),\n (n =\n null != e && V(e, 2, 64, 25, 'base')\n ? A(c(n, o), 0 | e, 10, i)\n : q >= o || o >= k ? l(n, o) : c(n, o)),\n 0 > i && t.c[0] && (n = '-' + n)),\n n\n );\n }),\n (M.truncated = M.trunc = function() {\n return I(new a(this), this.e + 1, 1);\n }),\n (M.valueOf = M.toJSON = function() {\n var e,\n n = this,\n t = n.e;\n return null === t\n ? n.toString()\n : ((e = r(n.c)),\n (e = q >= t || t >= k ? l(e, t) : c(e, t)),\n n.s < 0 ? '-' + e : e);\n }),\n (M.isBigNumber = !0),\n null != e && a.config(e),\n a\n );\n }\n function t(e) {\n var n = 0 | e;\n return e > 0 || e === n ? n : n - 1;\n }\n function r(e) {\n for (var n, t, r = 1, i = e.length, o = e[0] + ''; i > r; ) {\n for (n = e[r++] + '', t = b - n.length; t--; n = '0' + n);\n o += n;\n }\n for (i = o.length; 48 === o.charCodeAt(--i); );\n return o.slice(0, i + 1 || 1);\n }\n function i(e, n) {\n var t,\n r,\n i = e.c,\n o = n.c,\n u = e.s,\n s = n.s,\n l = e.e,\n c = n.e;\n if (!u || !s) return null;\n if (((t = i && !i[0]), (r = o && !o[0]), t || r))\n return t ? (r ? 0 : -s) : u;\n if (u != s) return u;\n if (((t = 0 > u), (r = l == c), !i || !o)) return r ? 0 : !i ^ t ? 1 : -1;\n if (!r) return (l > c) ^ t ? 1 : -1;\n for (s = (l = i.length) < (c = o.length) ? l : c, u = 0; s > u; u++)\n if (i[u] != o[u]) return (i[u] > o[u]) ^ t ? 1 : -1;\n return l == c ? 0 : (l > c) ^ t ? 1 : -1;\n }\n function o(e, n, t) {\n return (e = f(e)) >= n && t >= e;\n }\n function u(e) {\n return '[object Array]' == Object.prototype.toString.call(e);\n }\n function s(e, n, t) {\n for (var r, i, o = [0], u = 0, s = e.length; s > u; ) {\n for (i = o.length; i--; o[i] *= n);\n for (o[(r = 0)] += v.indexOf(e.charAt(u++)); r < o.length; r++)\n o[r] > t - 1 &&\n (null == o[r + 1] && (o[r + 1] = 0),\n (o[r + 1] += (o[r] / t) | 0),\n (o[r] %= t));\n }\n return o.reverse();\n }\n function l(e, n) {\n return (\n (e.length > 1 ? e.charAt(0) + '.' + e.slice(1) : e) +\n (0 > n ? 'e' : 'e+') +\n n\n );\n }\n function c(e, n) {\n var t, r;\n if (0 > n) {\n for (r = '0.'; ++n; r += '0');\n e = r + e;\n } else if (((t = e.length), ++n > t)) {\n for (r = '0', n -= t; --n; r += '0');\n e += r;\n } else t > n && (e = e.slice(0, n) + '.' + e.slice(n));\n return e;\n }\n function f(e) {\n return (e = parseFloat(e)), 0 > e ? g(e) : p(e);\n }\n var a,\n h = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\n g = Math.ceil,\n p = Math.floor,\n d = ' not a boolean or binary digit',\n m = 'rounding mode',\n w = 'number type has more than 15 significant digits',\n v = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',\n N = 1e14,\n b = 14,\n y = 9007199254740991,\n O = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\n R = 1e7,\n S = 1e9;\n (a = n()),\n (a['default'] = a.BigNumber = a),\n 'function' == typeof define && define.amd\n ? define(function() {\n return a;\n })\n : 'undefined' != typeof module && module.exports\n ? (module.exports = a)\n : (e ||\n (e = 'undefined' != typeof self ? self : Function('return this')()),\n (e.BigNumber = a));\n})(this);\n//# sourceMappingURL=bignumber.js.map\n\nfunction main() {\n var nums = readline().split(' ');\n var decimal = `${String(\n new BigNumber(Number(nums[0])).dividedBy(new BigNumber(Number(nums[1]))),\n ).slice(2)}0`;\n var c = nums[2];\n\n // console.log('decimal', decimal);\n // console.log(decimal.indexOf(c));\n\n print(decimal.indexOf(c) + 1);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "995df1f8aa8689147827b44247664911", "src_uid": "0bc7bf67b96e2898cfd8d129ad486910", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "const line = readline();\nconst numb = Number.parseInt(line);\nlet i = 1;\nlet res = 0;\nwhile (i <= Math.pow(10, 9)) {\n i & numb && res++;\n}\nprint(res);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "0e803e08b59fd51e908e2508fbda74d6", "src_uid": "03e4482d53a059134676f431be4c16d2", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var line = readline().split(' ');\n// print(parseInt(line[0]) + parseInt(line[1]));\n\n// let line = '1 1 1'.split(' ');\nlet a = parseInt(line[0]);\nlet b = parseInt(line[1]);\nlet c = parseInt(line[2]);\nlet answ = c * 2 + 2 * Math.min(a, b) + (a !== b ? 1 : 0);\nprint(answ);\n// console.log(answ);\n\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "ea42b017706f5589f801555c4ff75e6f", "src_uid": "609f131325c13213aedcf8d55fc3ed77", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var [n, a, b] = readline().split(\" \").map( (x) => parseInt(x));\nprint(n);", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "0bf63a53b106997f0fc00c3201389fa9", "src_uid": "af07223819aeb5bd6ded4340c472b2b6", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "let a = +readLine();\nif(a % 2 === 0){\n print(Math.pow(a/2, 2));\n}\nelse{\n print(0);\n}", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "2b60e743d91c679b5be09e3f3ab1d1a0", "src_uid": "4b7ff467ed5907e32fd529fb39b708db", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "let [n, x] = readline().split(' ').map(s=>+s);\nlet vs = readline().split(' ').map(s=>+s);\nprint(new Array(x)\n .fill(0)\n .map((_,i) => vs.includes(i) ? 0 : 1)\n .reduce((a, b) => a + b, 0)\n + (vs.includes(x) ? 1 : 0));\n", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "9d8b0f57cd93f8fd892a1f7f8c618a3a", "src_uid": "21f579ba807face432a7664091581cd8", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "const SPLIT_BY_SPACE = function(line) {\n return line.split(' ');\n};\nconst STRING_LINE = function(line) {\n return line;\n}\nfunction getInput(...parseLineFunc) {\n let line = readline();\n let iFunc = 0;\n let data = [];\n parseLineFunc = parseLineFunc || [];\n\n do{\n let func = parseLineFunc[iFunc] || SPLIT_BY_SPACE;\n data[iFunc] = func(line);\n line = readline();\n iFunc++;\n }\n while(line);\n return data;\n\n};\nfunction solution() {\n let data = getInput(SPLIT_BY_SPACE, STRING_LINE);\n let N = parseInt(data[0]);\n let S = data[1];\n let maps = {};\n for (let s of S) {\n if (maps[s]) {\n print('Yes');\n return;\n }\n maps[s] = true;\n }\n print('No');\n return;\n} \n\nsolution();", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "586041bd65607fc8862e0c0d07f10270", "src_uid": "6b22e93f7e429693dcfe3c099346dcda", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "const w = readline()\nconst ww = [[0, 0]]\nconst s = {'-1:0': true, '1:0': true, '0:1': true, '0:-1': true}\nconst p = [0, 0]\nfor (let i = 0; i < w.length; i++) {\n switch (w[i]) {\n case 'L': {\n p[0] -= 1\n break;\n }\n case 'R': {\n p[0] += 1\n break;\n }\n case 'U': {\n p[1] += 1\n break;\n }\n case 'D': {\n p[1] -= 1\n break;\n }\n }\n ww.push([p[0], p[1]])\n s[[p[0] - 1, p[1]].join(':')] = true\n s[[p[0], p[1] - 1].join(':')] = true\n s[[p[0], p[1] + 1].join(':')] = true\n s[[p[0] + 1, p[1]].join(':')] = true\n}\n\nprint(ww.length * 3 + 2 == Object.keys(s).length)", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "20cf902dc455aba909a2da3f5e8c423b", "src_uid": "bb7805cc9d1cc907b64371b209c564b3", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var arr = readline().split(' ');\nvar len = Number(arr[0]);\narr = readline().split(' ');\n\nvar str = arr[0];\nvar num_in_p = 0;\nvar max_len = 0;\nvar tmp_len = 0;\nvar p_flag = false;\nvar s_flag = false;\n\nfor (var i = 0;i < str.length;i ++) {\n\tif (!s_flag && !p_flag && helper(str[i]) == -1) {\n\t\ttmp_len ++;\n\t\ts_flag = true;\n\t} else if (s_flag && !p_flag && helper(str[i]) == -1) {\n\t\ttmp_len ++;\n\t} else if (helper(str[i]) != -1 && !p_flag) {\n\t\ts_flag = false;\n\t\tmax_len < tmp_len ? max_len = tmp_len : null;\n\t\ttmp_len = 0;\n\t} \n\tif (!p_flag && helper(str[i]) == 1) {\n\t\tp_flag = true;\n\t} else if (p_flag && helper(str[i]) == 2) {\n\t\tp_flag = false;\n\t}\n\n\tif (p_flag && helper(str[i]) == -1 && !s_flag) {\n\t\ts_flag = true;\n\t} else if (p_flag && s_flag && helper(str[i]) != -1) {\n\t\tnum_in_p ++;\n\t\ts_flag = false;\n\t} \n}\nmax_len < tmp_len ? max_len = tmp_len : null;\n\nprint(max_len);\nprint(num_in_p);\n\nfunction helper(_c) {\n\tif (_c == '_') {\n\t\treturn 0;\n\t} else if (_c == '(') {\n\t\treturn 1;\n\t} else if (_c == ')') {\n\t\treturn 2;\n\t} else {\n\t\treturn -1;\n\t}\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "dde768b121749aa8120c660d7e48bce3", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var arr = readline().split(' ');\nvar len = Number(arr[0]);\narr = readline().split(' ');\n\nvar str = arr[0];\nvar num_in_p = 0;\nvar max_len = 0;\nvar tmp_len = 0;\nvar p_flag = false;\nvar s_flag = false;\n\nfor (var i = 0;i < str.length;i ++) {\n\tif (!s_flag && !p_flag && helper(str[i]) == -1) {\n\t\ttmp_len ++;\n\t\ts_flag = true;\n\t} else if (s_flag && !p_flag && helper(str[i]) == -1) {\n\t\ttmp_len ++;\n\t} else if (helper(str[i]) != -1 && !p_flag) {\n\t\ts_flag = false;\n\t\tmax_len < tmp_len ? max_len = tmp_len : null;\n\t\ttmp_len = 0;\n\t} \n\tif (!p_flag && helper(str[i]) == 1) {\n\t\tp_flag = true;\n\t} else if (p_flag && helper(str[i]) == 2) {\n\t\tp_flag = false;\n\t}\n\n\tif (p_flag && helper(str[i]) == -1 && !s_flag) {\n\t\ts_flag = true;\n\t} else if (p_flag && s_flag && helper(str[i]) != -1) {\n\t\tnum_in_p ++;\n\t} \n}\nmax_len < tmp_len ? max_len = tmp_len : null;\n\nprint(max_len);\nprint(num_in_p);\n\nfunction helper(_c) {\n\tif (_c == '_') {\n\t\treturn 0;\n\t} else if (_c == '(') {\n\t\treturn 1;\n\t} else if (_c == ')') {\n\t\treturn 2;\n\t} else {\n\t\treturn -1;\n\t}\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8befd4d7184c6e41abeb392ad94b0e09", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var arr = readline().split(' ');\nvar len = Number(arr[0]);\narr = readline().split(' ');\n\nvar str = arr[0];\nvar num_in_p = 0;\nvar max_len = 0;\nvar tmp_len = 0;\nvar p_flag = false;\nvar s_flag = false;\n\nfor (var i = 0;i < str.length;i ++) {\n\tif (!s_flag && !p_flag && helper(str[i]) == -1) {\n\t\ttmp_len ++;\n\t\ts_flag = true;\n\t} else if (s_flag && !p_flag && helper(str[i]) == -1) {\n\t\ttmp_len ++;\n\t} else if (helper(str[i]) != -1 && !p_flag && s_flag) {\n\t\ts_flag = false;\n\t\tmax_len < tmp_len ? max_len = tmp_len : null;\n\t\ttmp_len = 0;\n\t} \n\tif (!p_flag && helper(str[i]) == 1) {\n\t\tp_flag = true;\n\t} else if (p_flag && helper(str[i]) == 2) {\n\t\tp_flag = false;\n\t}\n\n\tif (p_flag && helper(str[i]) == -1 && !s_flag) {\n\t\ts_flag = true;\n\t\tnum_in_p ++;\n\t} else if (p_flag && s_flag && helper(str[i]) != -1) {\n\t\ts_flag = false;\n\t} \n}\nmax_len < tmp_len ? max_len = tmp_len : null;\n\nprint(max_len);\nprint(num_in_p);\n\nfunction helper(_c) {\n\tif (_c == '_') {\n\t\treturn 0;\n\t} else if (_c == '(') {\n\t\treturn 1;\n\t} else if (_c == ')') {\n\t\treturn 2;\n\t} else {\n\t\treturn -1;\n\t}\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "94a32bbd15c1aaf108ade202bd0b98e7", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "readline();\nvar input = readline() + '(_)_';\nprint([\n Math.max(...input.replace(/[(][a-z_]*[)]/gi, '_').split('_').map(el => el.length)),\n input.match(/[(][a-z_]*[)]/gi).map(el => el.split(/[()_]/gi).filter(el => el.length)).map(el => el.length).reduce((a, b) => a + b)\n].join(' '));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e35eeb065b728ac7a37886eae1bea97a", "src_uid": "fc86df4931e787fa3a1a40e2aecf0b92", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "(function () {\n var read = {\n number: function () {\n return +readline();\n },\n arr: function (divider) {\n return readline().split(divider ? divider : '');\n },\n arrNumber: function (divider) {\n return readline()\n .split(divider ? divider : '')\n .map(item => +item);\n }\n }\n\n var n = read.number();\n var a = [...new Set(read.arrNumber(' '))];\n\n var max = a[0], min = a[0];\n a.forEach(i => {\n if(i > max) max = i;\n if(i < min) min = i;\n });\n\n mid = min + (max - min)/2\n\n var midUse = false;\n var minuse = false;\n var maxuse = false\n \n for(var f = 0; f < a.length; f++) {\n var i = a[f]\n if(i === mid) {\n midUse = true;\n }\n else if(i === max) {\n minuse = true;\n }\n else if(i === min) {\n maxuse = true;\n }\n else {\n print(-1);\n return;\n }\n }\n\n if(midUse) {\n print(max - mid)\n }\n else {\n if((max - min) %2 === 1)\n print(max - min);\n else {\n print((max - min) / 2)\n }\n }\n}());\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "1fdca9f57f9aa5053da82fb72e5e078c", "src_uid": "d486a88939c132848a7efdf257b9b066", "difficulty": 1200.0} {"lang": "Node.js", "source_code": "'use strict';\n\nconst fs = require('fs');\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.replace(/\\s*$/, '')\n .split('\\n')\n .map(str => str.replace(/\\s*$/, ''));\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++].split(' ');\n}\n\nfunction readInt(s) {\n return parseInt(s, 10);\n}\n\nfunction readIntArray(a) {\n return a.map(e => parseInt(e, 10));\n}\n\nfunction solve(n, ar) {\n ar.sort((a, b) => a - b);\n let ans = (ar[n - 1] - ar[0]) % 2 === 0 ? (ar[n - 1] - ar[0]) / 2 : -1;\n for (let i = 0; i < n; i++) {\n if (ar[i] !== ar[0] && ar[i] !== ar[n - 1] && ar[i] !== ar[0] + ans) ans = -1;\n }\n if (ans === -1) {\n ans = ar[n - 1] - ar[0];\n for (let i = 0; i < n; i++) {\n if (ar[i] !== ar[0] && ar[i] !== ar[n - 1]) ans = -1;\n }\n }\n\n\n return ans;\n}\n\nfunction main() {\n\n const nk = readLine();\n\n const n = readInt(nk[0]);\n const a = readIntArray(readLine());\n\n let result = solve(n, a);\n console.log(result);\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "9d49f555008405e6c1f5809c0e1227a4", "src_uid": "d486a88939c132848a7efdf257b9b066", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var n=readline();\nvar arry=readline().split(' ');\n\nfunction uniqueArr(arr) {\n var output=[];\n \n for (var i = 0; i < arr.length; i++) {\n var counter = 0;\n \n for (var j = 0; j < output.length; j++) {\n if ( arr[i] == output[j] ) {\n counter++;\n }\n }\n \n if (counter == 0) output.push(arr[i]);\n }\n \n for (var x = 0; x < output.length - 1; x++) {\n var minNum = output[x], index = x, old = output[x];\n \n for (var k = x + 1; k < output.length; k++) {\n if (minNum > output[k]) {\n index = k;\n minNum = output[k];\n }\n }\n \n output[x] = minNum;\n output[index] = old;\n }\n \n return output;\n}\n\nfunction findD(arr) {\n arr = uniqueArr(arr);\n \n if (arr.length == 1) {\n return 0;\n }\n \n else if (arr.length == 2) {\n var D = Math.abs( (arr[0] - arr[1])/2 );\n if ( D == Math.floor(D) ) {\n return D;\n }else return Math.abs(arr[0] - arr[1]);\n }\n \n \n else if (arr.length == 3) {\n var D1 = Math.abs(arr[0] - arr[1]), D2 = Math.abs(arr[0] - arr[2]);\n if ( D1 == D2 || 2*D1 == D2) {\n return D1;\n }\n else if (D1 == 2*D2) {\n return D2;\n }\n else return -1;\n }\n \n return -1;\n}\n\nprint( findD(arry) ) ", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c6ff410fbf8843f030506140672d79d7", "src_uid": "d486a88939c132848a7efdf257b9b066", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var line = readline().split(' ');\nvar n = parseInt(line[0]);\nvar v = parseInt(line[1]);\nvar arr = readline().split(' ');\nvar a = [];\nvar cur = [];\nvar sum = 0;\nfor (var i = 0; i < arr.length; i ++)\n{\n a[i] = parseInt(arr[i]);\n cur[i] = a[i]%2===0?a[i]/2:parseInt(a[i]/2)+1;\n sum += cur[i];\n}\nif (sum > v)\n{\n print(-1);\n}\nwhile(v-sum > 0)\n{\n var max = 0;\n var maxi = 0;\n for (var i = 0; i < a.length; i ++)\n {\n if (a[i] > max && cur[i]!=a[i])\n {\n max = a[i];\n maxi = i;\n }\n }\n var put = Math.min(Math.min(v-sum), (a[maxi]-cur[maxi]));\n cur[maxi]+=put;\n sum+=put;\n}\n\nprint( cur.join(\" \") );\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "5e7e288b62d2364264a02081aaf30b72", "src_uid": "5d3bb9e03f4c5c8ecb6233bd5f90f3a3", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": " var tmp = readline().split(' ').map(x => parseInt(x));\n var n = tmp[0];\n var w = tmp[1];\n var a = readline().split(' ').map(x => parseInt(x));\n var idx = new Array(n).fill(0).map((x, i) => i).sort((x, y) => a[y] - a[x]);\n var res = [];\n var sum = 0;\n var sumC = 0;\n for(var i = 0; i < n; i += 1) {\n res[i] = (a[i] + 1) / 2 | 0;\n sum += res[i];\n sumC += a[i];\n }\n // console.log(sum, sumC, res)\n if(sum > w || sumC < w) {\n print(-1);\n } else {\n var r = w - sum;\n var k = 0;\n while(r > 0) {\n if(a[idx[k]] - res[idx[k]] < r) {\n r -= a[idx[k]] - res[idx[k]];\n res[idx[k]] = a[idx[k]];\n } else {\n res[idx[k]] += r;\n r -= r;\n }\n k += 1;\n }\n print(res.join(' '));\n }\n ", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "23edb71e2581106f50af4f688e157cda", "src_uid": "5d3bb9e03f4c5c8ecb6233bd5f90f3a3", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var line = readline().split(' ');\nvar n = line[0];\nvar a = line[1];\n\nif (a % 2) {\n\tvar house = a;\n} else {\n\tvar house = n - a;\n}\n\nvar res = Math.floor(house/2) + 1;\n\nprint(res);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "a6a2c4fdb6d6397e731de9eda0988345", "src_uid": "aa62dcdc47d0abbba7956284c1561de8", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var data = readline().split(\" \"),\n\tn = data[0],\n\ta = data[1];\n\nvar homes = [];\n\nfor(let i=0;i(v%2==0));\n\n\tfor( let i=0; i(v%2!=0)).reverse();\n\n\tfor( let i=0; i parseInt(x));\n a.sort((x,y) => x-y);\n \n let c = 0;\n for(let i=0;i parseInt(x));\na.sort((x,y) => x-y);\n\nvar c = 0;\nfor(var i=0;i= 0; j--){\n if (a[i]%a[j] == 0){\n count++;\n break;\n }\n }\n if (count == 0){\n c++;\n }\n};\nwrite(c);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "81ee1b0889759f00fb14c37cfcd89847", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "(function() {\nvar INPUT = ``;\nvar OUTPUT = ``;\n \nvar main = function() {\"use strict\";\n // TODO\n var n = rdN();\n var A = rdArN().sortLt();\n var W = crAr(n, false);\n var res = 0;\n for (var i = 0; i < n; ++i) {\n if (!W[i]) {\n for (var j = i+1; j < n; ++j) {\n if (A[j]%A[i] === 0) {\n W[j] = true;\n }\n }\n\n ++res;\n }\n }\n wr(res);\n};\n \nif(INPUT){INPUT=INPUT.split('\\n').reverse();\nreadline=()=>INPUT.pop();\nwrite=(...s)=>{OUTPUT+=[...s].join(' ')};\nprint=(...s)=>{write(...s);OUTPUT+='\\n'};}\nconst\nrdS=readline,\nrdN=()=>+rdS(),\nrdArS=()=>rdS().split(' '),\nrdArN=()=>rdArS().map(v=>+v),\nwr=write,\npr=print,\nprAr=(a)=>pr(...a),\nprOb=(o)=>pr(JSON.stringify(o,null,4)),\ncrAr=function(length,...fillArgs){return new Array(length).fill(...fillArgs);},\ngetPrimes=function(n){var sieve=crAr(n+1,true),primes=[],i,j;for(i=2,j=4;j1;){if(primes[last]%p===0){primes[last]/=p;factors.push(p);}else{p=primes[++i];}}return factors;},\ndefineProperty=(o,pN,v)=>Object.defineProperty(o,pN,{value:v,writable:true,enumerable:false,configurable:true});\ndefineProperty(Array.prototype,'sortLt',function(){return this.sort((a,b)=>a-b);});\ndefineProperty(Array.prototype,'sortGt',function(){return this.sort((a,b)=>b-a);});\n \nmain();\nreturn OUTPUT;\n})();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "4e9f95db7f0b833a60941a8b331719b7", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var ns = function (a,b) {\n return a - b;\n};\nreadline();\nvar a = readline().split(\" \");\na.sort(ns);\nvar c = a.length;\n\nfor (var i = 0; i < a.length; i++){\n for (var j = i-1; j >= 0; j--){\n if (a[i]%a[j] == 0){\n c--\n break;\n }\n }\n};\nwrite(c);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "df0745fb1efb349836b2be9a6553952a", "src_uid": "63d9b7416aa96129c57d20ec6145e0cd", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const readline = require(\"readline\");\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.question(\"\", function(word) {\n let ans = word.split('')\n let j = ans.length - 1;\n let ans2 = ans.join('');\n let found = false\n for(let i = 0; !found && i < ans.length; i++){\n for(let j = 0; j < ans.length; j++){\n let ans1 = ans2.slice(0, i) + ans[j] + ans2.slice(i, ans.length )\n if(checkPolindrom(ans1)){\n found = true;\n console.log(ans1);\n break;\n }\n }\n }\n\n for(let i = 0; !found && i < ans.length; i++){\n if(ans[i] !== ans[j]){\n let ans1 = ans2 + ans[j];\n if(checkPolindrom(ans1)){\n found = true\n console.log(ans1)\n break;\n }\n ans1 = ans[j] + ans2;\n if(checkPolindrom(ans1)){\n found = true\n console.log(ans1)\n break;\n }\n ans1 = ans[i] + ans2;\n if(checkPolindrom(ans1)){\n found = true\n console.log(ans1)\n break;\n }\n ans1 = ans2 + ans[i];\n if(checkPolindrom(ans1)){\n found = true\n console.log(ans1)\n break;\n }\n }\n }\n if(!found)\n console.log('NA')\n process.exit(0)\n})\n\nrl.on(\"close\", function() {\n console.log(\"\\nBYE BYE !!!\");\n process.exit(0);\n});\n\n\nfunction checkPolindrom(ans1){\n var splitString = ans1.split(\"\");\n var reverseArray = splitString.reverse();\n let check = reverseArray.join(\"\");\n return check === ans1;\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "708ec74b0392556f365025125aa97904", "src_uid": "24e8aaa7e3e1776adf342ffa1baad06b", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "T=readline().split(' ')\nvar n=Number(T[0]),pos=Number(T[1]),l=Number(T[2]),r=Number(T[3]);\n\nif (l==1 && r==n) {\n print(0)\n} else {\n var A=0;\n if (l>1) {\n A += Math.abs(l-pos) + 1\n pos = l\n }\n if (r parseInt(x));\nvar allTabs = input[0];\nvar pos = input[1];\nvar l = input[2];\nvar r = input[3];\nvar start = 1;\nvar end = allTabs;\nvar result = 0;\nvar goLeft = false;\nvar goRight = false;\n\nfunction calc() {\n if (pos < l) {\n result += l - pos;\n if (goRight) {\n result += Math.abs(l - r);\n }\n } else if (pos > r) {\n result += pos - r;\n if (goLeft) {\n result += Math.abs(l - r);\n }\n } else {\n if (goLeft && goRight) {\n result += Math.min(...[Math.abs(pos - l), Math.abs(pos - r)]) + Math.abs(l - r);\n } else if (goLeft) {\n result += Math.abs(pos - l);\n } else {\n result += Math.abs(pos - r);\n }\n\n }\n}\n\nif (l != start) {\n goLeft = true;\n result += 1;\n}\nif (r != end) {\n goRight = true;\n result += 1;\n}\n\nif (goLeft || goRight) {\n calc();\n}\n\nprint(result);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c1029b0f82c7eeedaa4f8e3186c41af6", "src_uid": "5deaac7bd3afedee9b10e61997940f78", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "var line = readline().split(' ');\n\nvar a = line[0];\nvar b = line[1];\nvar f = line[2];\nvar k = line[3];\n\nvar count = k;\nvar position = 1;\nvar amount = b;\nvar refill = 0;\n\nif (amount < f || amount < a - f) {\n print(0);\n} else {\n while (count > 0) {\n if (position === 1) {\n position = 2;\n count--;\n if (amount < 2 * a - f) {\n refill += 1;\n amount = b - (a - f);\n } else {\n amount -= a;\n }\n continue;\n }\n if (position === 2) {\n position = 1;\n count--;\n if (amount < a + f) {\n refill += 1;\n amount = b - f;\n } else {\n amount -= a;\n }\n }\n }\n print(refill);\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c6f9c4754795b7910c7d19245b1fde0f", "src_uid": "283aff24320c6518e8518d4b045e1eca", "difficulty": 1500.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet grid = [];\n// Read Inputs\n\nrl.on('line', lineInput => {\n grid.push(lineInput);\n})\nrl.on('close', () => { \n let r = grid[0].split(\" \")[0];\n let c = grid[0].split(\" \")[1];\n\n \n // rows\n let clearRows = 0, rows = [];\n for (let i = 1; i <= r; i++) {\n const row = grid[i];\n rows.push(row)\n if (!row.split('').includes('S'))\n clearRows++;\n }\n\n // cols\n let clearCols = 0;\n for (let i = 0; i < c; i++) {\n let f = 0;\n for (let j = 0; j < r; j++) {\n const box = rows[j].split('')[i];\n if (box === 'S') { f = 1; break; }\n }\n if (!f)\n clearCols++;\n }\n let overlaps = clearCols * clearRows;\n let ans = ((clearCols * r) + (clearRows * c)) - overlaps\n\n console.log(ans)\n\n});", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "eac4bab1d5c130f2d43827cf03fb5606", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\n\nlet secondLine = false;\n\n\n// Create readline Interface\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet inputs = [];\n\n\n\nrl.on('line', lineInput => {\n inputs.push(lineInput);\n})\n\n// Read Inputs\nrl.on('close', () => {\n const line1 = inputs[0].split(' ');\n const r = parseInt(line1[0]);\n const c = parseInt(line1[1]);\n\n const rows = [];\n let clearRows = 0;\n let clearCols = 0; \n\n // rows\n for (let i = 1; i < r + 1; i++) {\n const row = inputs[i];\n rows.push(row)\n if (!row.split('').includes('S'))\n clearRows++;\n }\n\n // // cols\n for (let i = 0; i < c; i++) {\n let f = 0;\n for (let j = 0; j < r; j++) {\n const box = rows[j].split('')[i];\n if (box === 'S') { f = 1; break; }\n }\n if (!f)\n clearCols++;\n }\n let overlaps = clearCols * clearRows;\n let maximumCakes = ((clearCols * r) + (clearRows * c)) - overlaps\n\n console.log(maximumCakes)\n\n});\n\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c4679ce6a9d07a41b0d7381c833218bb", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\n// 330A \u0422\u043e\u0440\u0442\u043c\u0438\u043d\u0430\u0442\u043e\u0440 \n\n\n//var n = parseInt(readline());\nvar input_line = readline().split(' ').map(Number);\nvar r = input_line[0];\nvar c = input_line[1];\n//var m = input_line[1];\n\nvar arrEnableS = [];\nvar countNullStr = 0;\nvar countS = 0;\n\nfor (var i = 0; i < r; i++) {\n var str = readline();\n var flagS = 'false';\n\n for (var j = 0; j < c; j++) {\n if (str[j] === 's') {\n arrEnableS[j] = 's';\n flagS = 'true';\n };\n };\n\n if (!flagS) countNullStr ++;\n\n arrEnableS.forEach(function(item, i, arrEnableS) {\n if (item === 's') countS ++;\n })\n}\n\nvar out = countNullStr * c + countS * (r - countNullStr);\n\nprint(out);\n\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d8b2539efc087ef7c6bce82d93c702cd", "src_uid": "ebaf7d89c623d006a6f1ffd025892102", "difficulty": 800.0} {"lang": "Node.js", "source_code": "'use strict';\r\n\r\nfunction solve(n, a) {\r\n let cur = n;\r\n let cnt = 0;\r\n while (cur) {\r\n cnt++;\r\n cur = a[cur - 1];\r\n }\r\n return cnt === 3 ? 'YES' : 'NO';\r\n}\r\n\r\nasync function main(read) {\r\n try {\r\n let t = Number(await read());\r\n let res = new Array(t);\r\n for (let i = 0; i < t; i++) {\r\n const n = Number(await read());\r\n const a = (await read()).split(' ').map(Number);\r\n res[i] = solve(n, a);\r\n }\r\n return res.join('\\n');\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\n\r\nlet inputs,\r\n str = '';\r\nfunction read() {\r\n return inputs.next().value.trim();\r\n}\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf8');\r\nprocess.stdin.on('data', input => str += input);\r\nprocess.stdin.on('end', async () => {\r\n inputs = str.split('\\n').values();\r\n const output = await main(read);\r\n process.stdout.write(output);\r\n});\r\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "745322935fb89a184a98ab3b6e50fa5d", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "difficulty": 800.0} {"lang": "Node.js", "source_code": "'use strict';\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n\n main();\n});\n\nfunction readline() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n let t = Number(readline())\n while (t--) {\n let key = Number(readline())\n let doors = readline().split(' ').map(v => Number(v))\n let openedDoors = 0\n\n while (key != 0) {\n key = doors[key - 1]\n openedDoors += 1\n }\n\n if (openedDoors == 3) console.log('YES')\n else console.log('NO')\n }\n\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "49f0e9a647c414522fc8aedcd4b517dc", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var limit = parseInt(readline());\r\nfor (var i = 0; i < limit; i++)\r\n{\r\n var keyInHand = parseInt(readline());\r\n var keysArray = readline().split(\" \");\r\n var flag = false;\r\n var secondKey = parseInt(keysArray[keyInHand-1]);\r\n if (secondKey !== 0)\r\n {\r\n var thirdKey = parseInt(keysArray[secondKey-1]);\r\n if (thirdKey !== 0) flag = true;\r\n }\r\n if (flag) print(\"YES\"); else print(\"NO\");\r\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "a0fe439da531aac47d4dce5411c44976", "src_uid": "5cd113a30bbbb93d8620a483d4da0349", "difficulty": 800.0} {"lang": "Node.js", "source_code": "'use strict';\r\n\r\nvar fs = require('fs');\r\n\r\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\r\n\r\nvar fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);\r\n\r\nfunction solve(read) {\r\n const [rn, rb, rns, re, rbs] = convertInput(read);\r\n const n = rn(),\r\n k = rn();\r\n const MOD = 10 ** 9 + 7;\r\n const f = new Array(n);\r\n f[0] = f[1] = 1;\r\n for (let i = 2; i <= n; i++) {\r\n f[i] = mul(f[i - 1], i);\r\n }\r\n const g = new Array(n);\r\n g[n] = power(f[n], MOD - 2);\r\n g[0] = 1;\r\n for (let i = n; i >= 2; i--) {\r\n g[i - 1] = mul(g[i], i);\r\n }\r\n let res = 0,\r\n max = Math.min(n, k);\r\n for (let i = 0; i <= max; i++) {\r\n res = (res + mul(f[n], g[i], g[n - i])) % MOD;\r\n }\r\n return res;\r\n}\r\nconst MOD = 10 ** 9 + 7;\r\nfunction power(a, b) {\r\n let res = 1;\r\n while (b) {\r\n if (b & 1) res = mul(res, a);\r\n a = mul(a, a);\r\n b = b >> 1;\r\n }\r\n return res;\r\n}\r\nfunction mul(...args) {\r\n if (args.length === 0) throw new Error('\u53c2\u6570\u4e0d\u80fd\u4e3a\u7a7a');\r\n if (args.length === 1) return args[0];\r\n const [a, b] = args;\r\n if (args.length > 2) return mul(mul(a, b), ...args.slice(2));\r\n return (Math.floor(a / 65536) * b % MOD * 65536 + (a & 65535) * b) % MOD;\r\n}\r\nfunction convertInput(read) {\r\n const rn = () => Number(read());\r\n const rb = () => BigInt(read());\r\n const rns = n => {\r\n let res = new Array(n);\r\n for (let i = 0; i < n; i++) res[i] = rn();\r\n return res;\r\n };\r\n const re = n => {\r\n let res = new Array(n);\r\n for (let i = 0; i < n; i++) res[i] = rn() - 1;\r\n return res;\r\n };\r\n const rbs = n => {\r\n let res = new Array(n);\r\n for (let i = 0; i < n; i++) res[i] = rb();\r\n return res;\r\n };\r\n return [rn, rb, rns, re, rbs];\r\n}\r\nfunction main(r) {\r\n try {\r\n let t = 1;\r\n let res = new Array(t);\r\n let limit = 100;\r\n for (let i = 0; i < t; i++) {\r\n var _solve;\r\n const s = (_solve = solve(r)) !== null && _solve !== void 0 ? _solve : '';\r\n if (t < limit) {\r\n process.stdout.write(s.toString());\r\n process.stdout.write('\\n');\r\n }\r\n }\r\n if (t >= limit) ; else {\r\n return '';\r\n }\r\n } catch (error) {\r\n console.log(error);\r\n }\r\n}\r\n\r\nconst inputs = fs__default[\"default\"].readFileSync(0, 'utf-8').split(/\\s+/);\r\nvoid function () {\r\n const read = ((i = 0) => () => inputs[i++])();\r\n const output = main(read);\r\n process.stdout.write(output);\r\n}();\r\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "b15b84cc13a9f9e4fe3f99be67b8de76", "src_uid": "dc7b887afcc2e95c4e90619ceda63071", "difficulty": 1900.0} {"lang": "JavaScript", "source_code": "var s = readline().trim(), x = 0;\nfor (var i = 0, j = s.length - 1; i < j; i++, j--)\n if (s[i] != s[j]) x += 1;\nprint(((x | s.length & 1) === 1) ? \"YES\" : \"NO\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d98760e504a3dff763f6e0459cb1c73e", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var N = readline();\nvar R = 0;\nfor (var i = 0; i < N.length >> 1; ++i) {\n R += N[i] == N[N.length - 1 - i] ? 0 : 1;\n}\nprint(R == 1 ? \"YES\\n\" : \"NO\\n\");\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e5c627279ea3d23bb1faef1b0cbd79cd", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var s = readline().trim(), cnt = 0;\nfor (var i = 0, j = s.length - 1; i < j; i++, j--) {\n if (s[i] != s[j]) {\n cnt += 1;\n if (cnt > 1) {\n break\n }\n }\n}\nprint((cnt == 1) ? \"YES\" : \"NO\");\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "522a80cd987b1e9a6867ba9bd6125ee2", "src_uid": "fe74313abcf381f6c5b7b2057adaaa52", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "function dis(p1, p2) {\n\treturn (p1.x-p2.x) * (p1.x-p2.x) + (p1.y-p2.y) * (p1.y-p2.y);\n}\n\nfunction needCover(d1, r1, d2 ,r2) {\n\tif (d1 > r1 && d2 > r2) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n} \n\nvar first = readline().split(\" \").map(Number);\nvar n = first[0];\nvar p1 = {x : first[1], y : first[2]};\nvar p2 = {x : first[3], y : first[4]};\nvar a = [];\nfor (var i = 0; i < n; i++) {\n\tvar body = readline().split(\" \").map(Number);\n\ta[i] = {x : body[0], y : body[1]};\n}\n\nvar r1 = 0, r2 = 0;\nfor (var i = 0; i < n; i++){\n\tvar d1 = dis(p1, a[i]);\n\tvar d2 = dis(p2, a[i]);\n\tif (needCover(d1, r1, d2 ,r2)) {\n\t\tif (d1 < d2 && r1 < d1) {\n\t\t\tr1 = d1;\n\t\t}\n\t\tif (d2 < d1 && r2 < d2) {\n\t\t\tr2 = d2;\n\t\t}\n\t}\n}\n\nprint(r1 + r2);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f47626755d72b5bd39c77a1c80bc0511", "src_uid": "ba49b6c001bb472635f14ec62233210e", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var n = parseInt(readline());\nvar x = [];\nvar y = [];\nvar cx = 0;\nvar cy = 0;\nfor(var i=0;i new Date(2017, month, 0).getDate();\n\nrl.on('line', (data) => {\n const [m, d] = data.split(' ').map(Number);\n const days = daysInMonth(m);\n const ans = Math.ceil(days / 7);\n\n console.log(ans);\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c4d027c4845153283de86dec1c5f9a67", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var i = readline().split(' ').map(function(x){return parseInt(x);}),\n o = (i[0] == 2) ? 28 : ([4, 6, 9, 11].indexOf(i[0]) < 0 ? 31 : 30);\no += i[1] - 1;\nprint(Math.ceil(o / 7) + '\\n');\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3762219e79a7cd63671a486caa061574", "src_uid": "5b969b6f564df6f71e23d4adfb2ded74", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var s = readline();\n\nvar l = s.length, m = -1, n = 0, i = 0, ss = \"\", out = \"\";\n\nfor(i = 0; i< l; i++)\n{\n if( s.charCodeAt(i) > m )\n {\n m = s.charCodeAt(i);\n n = 0\n }\n else if( s.charCodeAt(i) == m )\n {\n n++;\n }\n}\n\nss.fromCharCode(m); \n\nfor(i = 0; i< n; i++)\n{\n out = out + ss;\n}\n\nprint(out);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2d3731959b8745def51164fe3ca97093", "src_uid": "9a40e9b122962a1f83b74ddee6246a40", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nlet n, d;\n\nrl.on('line', (data) => {\n if (c === 0) {\n c++;\n [n, d] = data.split(' ').map(Number);\n return;\n }\n\n const arr = data.split('').map(Number);\n let ans = 0;\n let best = 0;\n let inc = 1;\n\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] === 1) {\n best = Math.max(best, i);\n }\n\n if (inc === d || i + 1 === arr.length) {\n if (best === 0) {\n ans = -1;\n break;\n }\n else {\n ans++;\n i = best;\n best = 0;\n inc = 0;\n }\n }\n\n inc++;\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d7c5fce9a89522bb2ed20174361932c0", "src_uid": "c08d2ecdfc66cd07fbbd461b1f069c9e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": ";(function () { // 344B\n\n\tprint(function(a, b, c) {\n\n\t\tif ( (a + b > c) || (a + c > b) || (b + c > a) ) return 'Impossible';\n\n\t\treturn [\n\t\t\t(0 + a + b - c) / 2,\n\t\t\t(0 - a + b + c) / 2,\n\t\t\t(0 + a - b + c) / 2\n\t\t].join(' ');\n\n\t}.apply(null, readline().split(' ').map(Number)));\n\n}).call(this);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "6950f732e28ac3b10d4b26719ab215ec", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": ";(function () { // 344B\n\n\tprint(function(a, b, c) {\n\n\t\tif ( (a + b < c) || (a + c < b) || (b + c < a) ) return 'Impossible';\n\n\t\treturn [\n\t\t\t(0 + a + b - c) / 2,\n\t\t\t(0 - a + b + c) / 2,\n\t\t\t(0 + a - b + c) / 2\n\t\t].join(' ');\n\n\t}.apply(null, readline().split(' ').map(Number)));\n\n}).call(this);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "6b8554bf07b930e467ed234e554d699c", "src_uid": "b3b986fddc3770fed64b878fa42ab1bc", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": ";(function () {\n\t\n\tvar s = readline().split(' ').map(Number);\n\tvar n = s[0], x = s[1], y = s[2];\n\n\tvar r = Math.ceil(n * (y / 100));\n\n\tprint( ( r - x ) );\n\n}).call(this);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c7749f47e34ba22ce0770d031642f678", "src_uid": "7038d7b31e1900588da8b61b325e4299", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "function main() {\n var n = parseInt(readline());\n \n if (n & 1) {\n print('1');\n } else {\n print('2');\n }\n}\n\nmain();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "679fbb0377432764c2e2e4d5f5830995", "src_uid": "816ec4cd9736f3113333ef05405b8e81", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var bord = [1, 2, 3, 4, 5, 6];\nvar size = bord.length;\nvar num1 = [2, 4, 6];\nvar tru = num1.sort(function (a, b) {return a - b; });\nvar four = tru[1] - tru[0],\n fourT = tru[2] - tru[1];\nif (four === 1 && fourT === 1) {\n var out = 4;\n} else if (four === 1 || fourT === 1) {\n var out = 1;\n} else if (four === 2 && fourT === 2) {\n var out = 0;\n} else {\n var out = 2;\n}\nvar out;", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "5a64935c7a83dbbd25b6cc3c12970838", "src_uid": "0efe9afd8e6be9e00f7949be93f0ca1a", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "print(function(a, b, c){\n\tfor(var x=1; x<=a; x++)\n\t\tif(a%x===0 && b%(a/x)===0 && x*(b/(a/x))===c)\n\t\t\treturn 4*(x+a/x+b/(a/x));\n}.apply(0, readline().split(' ').map(Number)));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d6b3c5de9fce833a29e357f955a18d62", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "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 [ab, bc, ac] = readLine()\n .split(\" \")\n .map((n) => parseInt(n));\n\n const b = Math.sqrt((ab * bc) / ac);\n const a = ab / b;\n const c = bc / b;\n\n console.log(4 * (a + b + c));\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "89054f60a790ee8f022a193941b28875", "src_uid": "c0a3290be3b87f3a232ec19d4639fefc", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var xy = window.prompt();\nxy = xy.split(\" \");\nvar x = parseInt(xy[0]);\nvar y = parseInt(xy[1]);\nif((y == 0 && x == 0) || (y == 0 && x == 1))\n{\n window.alert(\"0\");\n}\nelse if((Math.abs(x) < Math.abs(y) && y > 0) || (-x == y && y > 0))\n{\n window.alert(Math.abs(y*4) - 2);\n}\nelse if((Math.abs(x) > Math.abs(y) && x < 0) || (x == y && x < 0))\n{\n window.alert(Math.abs(x*4) - 1);\n}\nelse if((Math.abs(x) < Math.abs(y) && y < 0) || (-x == y && y < 0) || x == -y + 1)\n{\n window.alert(Math.abs(y*4));\n}\nelse if((Math.abs(x) > Math.abs(y) && x > 0) || (x == y && x > 0))\n{\n window.alert(Math.abs((x-1)*4) + 1);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e2105cfad88dfb3616ef4593fb4aaff2", "src_uid": "2fb2a129e01efc03cfc3ad91dac88382", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var l1 = readline()\nvar l2 = readline()\nvar l3 = readline()\n\nfunction test() {\n\tif (l1[0] == 'X' && l3[2] != 'X') return 'NO'\n\tif (l1[1] == 'X' && l3[1] != 'X') return 'NO'\n\tif (l1[2] == 'X' && l3[0] != 'X') return 'NO'\n\tif (l2[0] == 'X' && l2[2] != 'X') return 'NO'\n\tif (l2[2] == 'X' && l2[0] != 'X') return 'NO'\n\tif (l3[0] == 'X' && l1[2] != 'X') return 'NO'\n\tif (l3[1] == 'X' && l1[1] != 'X') return 'NO'\n\tif (l3[2] == 'X' && l1[0] != 'X') return 'NO'\n\treturn 'YES'\n}\n\nprint(test())", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0ed7c706c9f4409e97136f038b4b0475", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function trim(s) {\n\treturn s.replace(/^\\s+|\\s+$/gm, '');\n}\n\nfunction tokenize(s) {\n\treturn trim(s).split(/\\s+/);\n}\n\nfunction tokenizeIntegers(s) {\n\tvar tokens = tokenize(s);\n\tfor (var i = 0; i < tokens.length; i += 1) {\n\t\ttokens[i] = parseInt(tokens[i]);\n\t};\n\treturn tokens;\n}\n\nfunction main() {\n\tvar grid = [];\n\tfor (var r = 0; r < 3; r += 1) {\n\t\tgrid.push(trim(readline()));\n\t}\n\tfor (var r = 0; r < 3; r += 1) {\n\t\tfor (var c = 0; c < 3; c += 1) {\n\t\t\tif (grid[r][c] == 'X') {\n\t\t\t\tif (grid[2-r][2-c] == '.') {\n\t\t\t\t\tprint(\"NO\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tprint(\"YES\");\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "30898e8273cc5ed3b5298bc447d8a7e3", "src_uid": "6a5fe5fac8a4e3993dc3423180cdd6a9", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var str=\"\";\nstr = readline();\n \nvar cnt = 0;\nfor(var i = 0;i y10){\n write(\">\");\n}else{\n write(\"<\");\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f9af515c4dd3fc07f799b17feb8d219f", "src_uid": "d6ab5f75a7bee28f0af2bf168a0b2e67", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "(function() {\n 'use strict';\n let n = readline();\n let r = readline().split('').map(String);\n let y = [];\n for(let i = 2; i <= n; i++) {\n if (n % i === 0) {\n y += i + ' ';\n }\n }\n if (y.length !== 0)\n y = y.split(' ').map(Number);\n y.splice(y.length - 1, 1);\n for (let i = 0; i < y.length; i++) {\n let m = r.splice(0, y[i]);\n m = m.reverse();\n r.splice.apply(r, [0, 0].concat(m));\n \n }\n \n print(r.join(''));\n}());", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c792df25a1dabe17c6522d21720d4474", "src_uid": "1b0b2ee44c63cb0634cb63f2ad65cdd3", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var line1 = readline().split(\" \");\nvar d = Number(line1[0]);\nvar sumTime = Number(line1[1]);\nvar sumTime2 = sumTime;\n\nvar input = [];\nvar ans = [];\nvar min = 0;\nvar max = 0;\n\nfor (var i=0; i < d; i++) {\n\tinput.push(readline().split(\" \").map(function (e) { return Number(e); }));\n\tmin += input[i][0];\n\tmax += input[i][1];\n\t\n\tans.push(input[i][0]);\n\tsumTime2 -= ans[i];\n\tinput[i] = input[i][1] - input[i][0];\n}\n\nif (sumTime < min || sumTime > max) {\n\tprint(\"NO\");\n} else {\n\tprint(\"YES\");\n\n\tvar answer = \"\";\n\tvar take = 0;\n\tfor (var i in input) {\n\t\tfor (var j=1; j <= input[i]; j++) {\n\t\t\tif (sumTime2 - j >= 0) {\n\t\t\t\t\n\t\t\t\ttake = j;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tans[i]+=take;\n\t\tsumTime2-=take;\n\t}\n\tprint(ans.join(\" \"));\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "7f509aa70516808d195c9f62c2482253", "src_uid": "f48ff06e65b70f49eee3d7cba5a6aed0", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var X = +readline()\n\nvar way = 0\n\nvar dif = countDif(X)\nway += dif * 2\n\nfunction countDif(x) {\n var s = 0\n var i = 0\n var ls = 0\n while ((s += (i += 1)) <= x) {\n ls = s\n way++\n }\n return x - ls\n}\n\nprint(way)", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "22a053bddce41c6a4f2a7e959eec6611", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "difficulty": 1600.0} {"lang": "JavaScript", "source_code": "var X = Math.abs(+readline())\n\nvar way = 0\n\nprint(countDif(X))\n\nfunction countDif(x) {\n var s = 0\n var i = 0\n\tvar li = 0\n var ls = 0\n while ((s += (i += 1)) <= x) {\n ls = s\n\t\tli = i\n way++\n }\n\n if (x == ls) {\n\t\treturn way\n\t} else if (i % 2 == (x - ls) % 2) {\n\t\treturn way + 1\n\t} else if (ls % 2 == s % 2 || x - ls == 1) {\n\t\treturn way + 2\n\t} else {\n\t\treturn way + 3\n\t}\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "6227cb22bbd562f5b827638d552b929c", "src_uid": "18644c9df41b9960594fdca27f1d2fec", "difficulty": 1600.0} {"lang": "JavaScript", "source_code": "var app = {\n operandNumber : 0,\n modedNumber : 0,\n modNumber : 0,\n result : 0,\n main : function() {\n this.initialize();\n this.readValues();\n this.sovleResult();\n this.printResult();\n },\n initialize : function() {},\n readValues : function() {\n this.operandNumber = readline().split(/\\s/gi).map(Number);\n },\n sovleResult : function() {\n this.modedNumber = this.operandNumber[1];\n this.operandNumber = this.operandNumber[0];\n this.modNumber = this.operandNumber - this.modedNumber;\n \n if(this.modNumber == 0) {\n this.result = 'infinity';\n return;\n }\n \n for(var n = 1; n * n <= this.modNumber; n++) {\n if(this.modNumber % n == 0) {\n var solve = this.modNumber / n;\n if(solve > this.modedNumber) {\n this.result++;\n if(Math.pow(n, 2) != this.modNumber) {\n if(this.modNumber / solve > this.modedNumber) {\n this.result++;\n }\n }\n }\n }\n }\n },\n printResult : function() {\n print(this.result);\n }\n};\n\napp.main();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "23b72b3414d90ca4c8edb0099321c7da", "src_uid": "6e0715f9239787e085b294139abb2475", "difficulty": 1600.0} {"lang": "JavaScript", "source_code": "solve();\n\n\n\nfunction solve() {\n var n, S, ans = 0;\n var input = readline().split(' ').map(Number);\n n = input[0];\n S = input[1];\n print(S % n ? Math.floor(S / n + 1) : S / n);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "6b4254fdb28ed650832105990a448fea", "src_uid": "04c067326ec897091c3dbcf4d134df96", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var l=readline().split(\" \");\nprint(Math.ceil(parseInt(l[1])/parseInt(l[0])));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "580f268035b81385187ca8a907e0969d", "src_uid": "04c067326ec897091c3dbcf4d134df96", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nlet lll\nlll = readline().split(' ').map(v => parseInt(v))\nlet n = lll[0]\nlet x1 = lll[1]\nlet y1 = lll[2]\nlet x2 = lll[3]\nlet y2 = lll[4]\n\nlet s = 0\n\nlet by\nif (x1 == 0) {\n by = y1\n} else if (y1 == 0) {\n by = n - x1 - 1\n} else if (x1 == n) {\n by = n - y1 - 1\n} else {\n by = x1\n}\n\nlet ag\nif (x2 == 0) {\n ag = n - y2 - 1\n} else if (y2 == 0) {\n ag = x2\n} else if (x2 == n) {\n ag = y2\n} else {\n ag = n - x1 - 1\n}\n\nif (x1 == 0 && x2 == n || y1 == 0 && y2 == n) {\n s = by + ag + n\n s = Math.min(s, 4 * n - s)\n} else {\n s = by + ag\n s = Math.min(s, 2 * n - s)\n}\n\nprint(s)", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "7d7f75008c6660e2f2c82deb1242dfa2", "src_uid": "685fe16c217b5b71eafdb4198822250e", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nlet lll\nlll = readline().split(' ').map(v => parseInt(v))\nlet n = lll[0]\nlet x1 = lll[1]\nlet y1 = lll[2]\nlet x2 = lll[3]\nlet y2 = lll[4]\n\nlet s\nif (x1 == 0 && x2 == n || x1 == n && x2 == 0) {\n s = Math.min(n + y2 + y1, n + n + n - y1 - y2)\n} else if (y1 == 0 && y2 == n || y1 == n && y2 == 0) {\n s = Math.min(n + x2 + x1, n + n + n - x1 - x2)\n} else {\n s = Math.abs(x1 - x2) + Math.abs(y1 - y2)\n}\n\nprint(s)", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8081d33501f2fbe1a7a739fdfdfc8edf", "src_uid": "685fe16c217b5b71eafdb4198822250e", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "// Polyfill for NodeJS\nif (undefined == readline) {\n\tvar rLines = require('fs').readFileSync(\"/dev/stdin\", \"utf8\").split(\"\\n\"), \n\t\trIndex = 0,\n\t\treadline = function() {\n\t\t\trIndex ++\n\t\t\treturn rLines[rIndex - 1]\n\t\t}\n}\nif (undefined == print) {\n\tvar print = console.log\n}\n\n// Useful Read functions\nvar int = function() {\n\treturn parseInt(readline())\n}\n\nvar ints = function() {\n\treturn readline().split(' ')\n\t\t.map(function(x) {\n\t\t\treturn parseInt(x)\n\t\t})\n}\n\n\n\nvar numbers = ints();\nvar n = numbers[0];\nvar m = numbers[1];\nvar d = numbers[2];\n\nvar aw = [];\nvar ac = [];\nvar bw = [];\nvar bc = [];\n\nfor(var i=0;iac[y]) return -1;\n \n if(aw[x] > aw[y]) return 1;\n if(aw[x] < aw[y]) return -1;\n \n return 0;\n});\n\n\nb.sort(function(x,y) \n{\n if(bc[x]bc[y]) return -1;\n \n if(bw[x] > bw[y]) return 1;\n if(bw[x] < bw[y]) return -1;\n \n return 0;\n});\n\nvar pa = 0;\nvar pb = 0;\nvar suma = aw[a[0]];\nvar sumb = bw[b[0]];\n\nif(suma + sumb > d)\n{\n print(\"0\");\n} else {\n\nvar totalc = ac[a[0]] + bc[b[0]];\n\nwhile (pb+1 < m && suma+sumb+bw[b[pb+1]]<=d)\n{\n pb++;\n sumb += bw[b[pb]];\n totalc += bc[b[pb]];\n}\nvar bestc = totalc;\n\n/*\nfor(var i=0;i 0)\n{\n pa++;\n suma += aw[a[pa]];\n \n while (pb>= 0 && suma+sumb > d)\n {\n sumb -= bw[b[pb]];\n totalc -= bc[b[pb]];\n pb--;\n }\n\n if (suma+sumb <= d && bestc < totalc) bestc = totalc;\n\n}\n\nprint(bestc);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d9ac414c9105d491906267b167ded9de", "src_uid": "da573a39459087ed7c42f70bc1d0e8ff", "difficulty": 2100.0} {"lang": "JavaScript", "source_code": "var _ = readline().split( ' ' );\nvar N = +_[ 0 ];\nvar M = +_[ 1 ];\nvar D = +_[ 2 ];\nvar ACW = [];\nfor( var i = 0; i < N; ++i ) {\n var __ = readline().split( ' ' );\n ACW.push( [ +__[ 0 ], +__[ 1 ] ] );\n}\nACW.sort().reverse();\nvar BCW = [];\nfor( var i = 0; i < M; ++i ) {\n var __ = readline().split( ' ' );\n BCW.push( [ +__[ 0 ], +__[ 1 ] ] );\n}\nBCW.sort().reverse();\nvar curc = 0;\nvar curw = 0;\nvar bptr = 0; // [ 0, bptr )\nwhile( bptr < M ) {\n if( curw + BCW[ bptr ][ 1 ] > D ) break;\n curw += BCW[ bptr ][ 1 ];\n curc += BCW[ bptr ][ 0 ];\n ++bptr;\n}\nvar bok = bptr > 0;\nvar ans = 0;\nfor( var aptr = 0; bok && aptr < N; ++i ) {\n curw += ACW[ aptr ][ 1 ];\n curc += ACW[ aptr ][ 0 ];\n while( curw > D && bptr > 0 ) {\n --bptr;\n curw -= BCW[ bptr ][ 1 ];\n curc -= BCW[ bptr ][ 0 ];\n }\n if( curw > D ) break;\n ans = Math.max( ans, curc );\n}\nprint( ans );\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e0261728cf5008f3fbe96736973c7127", "src_uid": "da573a39459087ed7c42f70bc1d0e8ff", "difficulty": 2100.0} {"lang": "JavaScript", "source_code": "var _ = readline().split( ' ' );\nvar N = +_[ 0 ];\nvar M = +_[ 1 ];\nvar D = +_[ 2 ];\nvar ACW = [];\nfor( var i = 0; i < N; ++i ) {\n var __ = readline().split( ' ' );\n ACW.push( [ +__[ 0 ], +__[ 1 ] ] );\n}\nACW.sort().reverse();\nvar BCW = [];\nfor( var i = 0; i < M; ++i ) {\n var __ = readline().split( ' ' );\n BCW.push( [ +__[ 0 ], +__[ 1 ] ] );\n}\nBCW.sort().reverse();\nvar curc = 0;\nvar curw = 0;\nvar bptr = 0; // [ 0, bptr )\nwhile( bptr < M ) {\n if( curw + BCW[ bptr ][ 1 ] > D ) break;\n curw += BCW[ bptr ][ 1 ];\n curc += BCW[ bptr ][ 0 ];\n ++bptr;\n}\nvar ans = 0;\nfor( var aptr = 0; aptr < N; ++i ) {\n curw += ACW[ aptr ][ 1 ];\n curc += ACW[ aptr ][ 0 ];\n while( curw > D && bptr > 0 ) {\n --bptr;\n curw -= BCW[ bptr ][ 1 ];\n curc -= BCW[ bptr ][ 0 ];\n }\n if( bptr === 0 || curw > D ) break;\n ans = Math.max( ans, curc );\n}\nprint( ans );", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "4265056ba49d9ef16dbc032056131f35", "src_uid": "da573a39459087ed7c42f70bc1d0e8ff", "difficulty": 2100.0} {"lang": "JavaScript", "source_code": "// Polyfill for NodeJS\nif (undefined == readline) {\n\tvar rLines = require('fs').readFileSync(\"/dev/stdin\", \"utf8\").split(\"\\n\"), \n\t\trIndex = -1,\n\t\treadline = function() {\n\t\t\trIndex++;\n\t\t\treturn rLines[rIndex]\n\t\t}\n}\nif (undefined == print) {\n\tvar print = console.log\n}\n\n// Useful Read functions\nvar int = function() {\n\treturn parseInt(readline())\n}\n\nvar ints = function() {\n var tmp = readline().split(' ');\n var ans = [];\n for(var i=0;iac[y]) return -1;\n \n if(aw[x] > aw[y]) return 1;\n if(aw[x] < aw[y]) return -1;\n \n return 0;\n});\n\n\nb.sort(function(x,y) \n{\n if(bc[x]bc[y]) return -1;\n \n if(bw[x] > bw[y]) return 1;\n if(bw[x] < bw[y]) return -1;\n \n return 0;\n});\n\nvar pa = 0;\nvar pb = 0;\nvar sum = aw[a[0]] + bw[b[0]];\n\nif(sum > d)\n{\n print(\"0\");\n} else {\n\nvar totalc = ac[a[0]] + bc[b[0]];\n\nwhile (pb+1 < m && sum + bw[b[pb+1]]<=d)\n{\n pb++;\n sum += bw[b[pb]];\n totalc += bc[b[pb]];\n}\nvar bestc = totalc;\n\n//print(pb);\n\n/*\nfor(var i=0;i 0 && pa < n)\n{\n pa++;\n sum += aw[a[pa]];\n totalc += ac[a[pa]];\n\n //print(pa + \" \" + pb);\n\n while (pb >= 0 && sum > d)\n {\n sum -= bw[b[pb]];\n totalc -= bc[b[pb]];\n pb--;\n }\n\n if (sum <= d && bestc < totalc)\n bestc = totalc;\n}\n\nprint(bestc);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0b990786c69d940350519bf236473039", "src_uid": "da573a39459087ed7c42f70bc1d0e8ff", "difficulty": 2100.0} {"lang": "JavaScript", "source_code": "\nvar l = readline().split(' ');\nvar a,b,w,x,c;\na=+l[0];\nb=+l[1];\nw=+l[2];\nx=+l[3];\nc=+l[4];\n\nvar _b=b;\nvar _a=a;\nvar step=0;\nwhile(c>a){\n\tc--;\n\tif(b>=x){\n\t\tb=b-x;\n\t}else{\n\t\ta=a-1;\n\t\tb=w+(b-x);\n\t}\n\tstep++;\n\tif(b==_b){\n\t\tbreak;\n\t}\n}\n\n\nvar o=step;\nvar _a=_a-a;\nif(c>a){\n\twhile(c>a){\n\t\tc-=o;\n\t\ta-=_a;\n\t\tstep+=o;\n\t}\n\n\tc+=o;\n\ta+=_a;\n\tstep-=o;\n\twhile(c>a){\n\t\tc--;\n\t\tif(b>=x){\n\t\t\tb=b-x;\n\t\t}else{\n\t\t\ta=a-1;\n\t\t\tb=w+(b-x);\n\t\t}\n\t\tstep++;\n\t}\n}\n\n\nprint(step);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "97361c9623ddb4cbcf2bba7e2528fc4a", "src_uid": "a1db3dd9f8d0f0cad7bdeb1780707143", "difficulty": 2000.0} {"lang": "JavaScript", "source_code": "var arr = readline().split(' ').map(Number);\nprint(arr[0]>=arr[1]&&arr[0]>=arr[2]? 1:0);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "5d793b9790b8d06e4ac37b73089b3831", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n});\n\nrl.on('line', n => {\n let [participants, pens, notebooks] = n.split(' ').map(number => Number(number));\n participants <= pens && participants <= notebooks ? console.log('Yes') : console.log('No');\n return rl.close();\n});", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "61f36e40f55840dc0d63080fa1b59d96", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const input = [];\n\nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', line => input.push(line));\n\nRL.on('close', () => {\n const [n, m, k] = input[0].split(' ').map(x => parseInt(x));\n console.log( Math.min(m, k) >= n ? \"YES\" : \"NO\" );\n});", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f681020b5f3e619aa7fbbbdfab5d5f45", "src_uid": "6cd07298b23cc6ce994bb1811b9629c4", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n let [n, v] = d.split(' ').map(Number);\n let ans = Math.min(n, v);\n let price = 1;\n n -= v + 1;\n\n while (n > 0) {\n price++;\n ans += price;\n\n n--;\n }\n\n console.log(ans);\n\n c++;\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e8c538d7a0d8d48ec6ec46829e23d7f1", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900.0} {"lang": "Node.js", "source_code": "\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar input= '', readline, print;\n\nprocess.stdin.on('data', function(chunk) {\n input+=chunk;\n});\n\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n print = function(data) {process.stdout.write(data+'\\n')};\n var inputLineIndex = 0;\n readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};\n\n process.exit(main(...input) || 0);\n});\n\nconst even = ['a', 'o', 'u', 'i', 'e'];\n\nfunction minPrice(n, v) {\n var currentPrice = Math.min(v, n - 1);\n var currentLiters = Math.min(v, n - 1);\n\n for(var i = 2; i < n; i++) {\n if(currentLiters > n - i) break;\n\n currentLiters++;\n currentPrice += i;\n }\n\n return currentPrice;\n}\n\nfunction main(n, v) {\n arr = n.split(' ');\n console.log(minPrice(+arr[0], +arr[1]));\n}\n\n// main(\"ninja\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2f7f77a574e2a800db83d740aceffe93", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900.0} {"lang": "Node.js", "source_code": "function minPrice(n, v) {\n var currentPrice = Math.min(v, n - 1);\n var currentLiters = Math.min(v, n - 1);\n\n for(var i = 2; i < n; i++) {\n if(currentLiters > n - i) break;\n\n currentLiters++;\n currentPrice += i;\n }\n\n return currentPrice;\n}\n\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar input= '', readline, print;\n\nprocess.stdin.on('data', function(chunk) {\n input+=chunk;\n});\n\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n print = function(data) {process.stdout.write(data+'\\n')};\n var inputLineIndex = 0;\n readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};\n\n process.exit(main(...input) || 0);\n});\n\nconst even = ['a', 'o', 'u', 'i', 'e'];\n\nfunction main(n, v) {\n console.log(minPrice(n, v))\n}\n\n// main(\"ninja\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "558d448d7edf1f7cc7a37d2268ce25e7", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var n=readline();\nvar m=readline();\nif( m>=n ){\n print(n-1);\n return 0;\n}\nvar l=2;\nvar cnt=n-m-1;\nvar ans=ans+m;\nfor( var i=1;i<=cnt;i++ ){\n ans=ans+l;\n l++;\n}\nprint(ans);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ed0cff3262b91e87acc096a055b9e920", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900.0} {"lang": "Node.js", "source_code": "\nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf8');\n\nvar input= '', readline, print;\n\nprocess.stdin.on('data', function(chunk) {\n input+=chunk;\n});\n\nprocess.stdin.on('end', function() {\n input = input.split('\\n');\n print = function(data) {process.stdout.write(data+'\\n')};\n var inputLineIndex = 0;\n readline = function(){return inputLineIndex>=input.length?undefined:input[inputLineIndex++]};\n\n process.exit(main(...input) || 0);\n});\n\nconst even = ['a', 'o', 'u', 'i', 'e'];\n\nfunction minPrice(n, v) {\n var currentPrice = Math.min(v, n - 1);\n var currentLiters = Math.min(v, n - 1);\n\n for(var i = 2; i < n; i++) {\n if(currentLiters >= n - 1) break;\n\n currentLiters++;\n currentPrice += i;\n }\n\n return currentPrice;\n}\n\nfunction main(n, v) {\n arr = n.split(' ');\n console.log(minPrice(+arr[0], +arr[1]));\n}\n\n//console.log(minPrice(4, 2)); // 1 2 3 4 5 -> 2 4 7", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0c0d5926b32d663a861d42764ac29953", "src_uid": "f8eb96deeb82d9f011f13d7dac1e1ab7", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var line = readline().split(' ');\nvar n = +line[0];\nvar c = +line[1];\n\nvar p = readline().split(' ');\nvar t = readline().split(' ');\n\nvar sum = 0, tp = 0;\n\nfor (var i = 0 ; i < n ; i++) {\n tp += +t[i];\n sum += Math.max(0, +p[i] - c*tp);\n}\n\ntp = 0;\n\nfor (var i = n-1 ; i >= 0 ; i--) {\n tp += +t[i];\n sum -= Math.max(0, +p[i] - c*tp);\n}\n\nif (sum > 0)\n print(\"Limak\");\nelse if (sum < 0)\n print(\"Radewoosh\");\nelse\n print(\"Tie\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "bd49c4eacf30507d021cdc95cfa8eb90", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var line1 = readline().split(' ').map(Number);\nvar n = line1[0];\nvar c = line1[1];\nvar p = readline().split(' ').map(Number);\nvar t = readline().split(' ').map(Number);\n\nvar limak = 0;\nvar time = 0;\nfor(var i = 0; i < n; i++){\n time += t[i];\n limak += Math.max(0, p[i] - time * c);\n}\n\nvar radewoosh = 0;\nvar time2 = 0;\nfor(var j = n - 1; j > -1; j--){\n time2 += t[j];\n radewoosh += Math.max(0, p[j] - time2 * c);\n}\n\nif(limak > radewoosh){\n print(\"Limak\");\n} else if (limak < radewoosh){\n print(\"Radewoosh\");\n} else {\n print(\"Tie\");\n}\n\n/*\n3 2\\n50 85 250\\n10 15 25\\n\n*/\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0adfabfb2526d9bf58e1514305ab88ae", "src_uid": "8c704de75ab85f9e2c04a926143c8b4a", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function trim(s) {\n\treturn s.replace(/^\\s+|\\s+$/gm, '');\n}\n\nfunction tokenize(s) {\n\treturn trim(s).split(/\\s+/);\n}\n\nfunction tokenizeIntegers(s) {\n\tvar tokens = tokenize(s);\n\tfor (var i = 0; i < tokens.length; i += 1) {\n\t\ttokens[i] = parseInt(tokens[i], 10);\n\t};\n\treturn tokens;\n}\n\nfunction main() {\n\tvar data = tokenizeIntegers(readline()),\n\t\tpointNum = data[0], segmentNum = data[1],\n\t\tpoints = tokenizeIntegers(readline());\n\tfor (var i = 0; i < segmentNum; ++i) {\n\t\tdata = tokenizeIntegers(readline());\n\t}\n\tvar result = [];\n\tfor (var i = 0; i < pointNum; ++i) {\n\t\tresult.push(i%2 == 0 ? 1 : 0);\n\t}\n\tprint(result.join(' '));\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "60025b25cf8094018abf56e1f1f8fa44", "src_uid": "692698d4b49ad446984f3a7a631f961d", "difficulty": 1600.0} {"lang": "Node.js", "source_code": "'use strict';\r\n\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf-8');\r\n\r\nlet inputString = '';\r\nlet currentLine = 0;\r\n\r\nprocess.stdin.on('data', inputStdin => {\r\n inputString += inputStdin;\r\n});\r\n\r\nprocess.stdin.on('end', _ => {\r\n inputString = inputString.trim().split('\\n').map(string => {\r\n return string.trim();\r\n });\r\n \r\n main(); \r\n});\r\n\r\nfunction readline() {\r\n return inputString[currentLine++];\r\n}\r\n\r\nfunction output(x) {\r\n if (typeof x !== 'string') \r\n {\r\n x = x.toString();\r\n }\r\n console.log(x);\r\n}\r\nfunction reverseString(str) {\r\n var splitString = str.split(\"\");\r\n var reverseArray = splitString.reverse();\r\n var joinArray = reverseArray.join(\"\"); \r\n return joinArray;\r\n}\r\nfunction main() \r\n{\r\n let N = readline();\r\n for (let test = 0; test < N; test++) \r\n {\r\n let s = Number(readline());\r\n let result = '';\r\n let last_Digit = 9;\r\n while(s > last_Digit)\r\n {\r\n result += String.fromCharCode(48+last_Digit);\r\n s -= last_Digit ;\r\n last_Digit--;\r\n }\r\n if(s > 0)\r\n {\r\n result += String.fromCharCode(48+s);\r\n }\r\n output(reverseString(result));\r\n }\r\n}\r\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "20de7d5a3c3ea1e421cb8ff0a2f1586a", "src_uid": "fe126aaa93acaca8c8559bc9e7e27b9f", "difficulty": 800.0} {"lang": "Node.js", "source_code": "\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf-8');\r\nlet inputString = '', currentLine = 0;\r\nprocess.stdin.on('data', inputStdin => { inputString += inputStdin; });\r\nprocess.stdin.on('end', _ => { \r\n inputString = inputString.trim().split('\\n').map(string => string.trim());\r\n main(); \r\n});\r\nfunction readLine() {\r\n return inputString[currentLine++];\r\n}\r\n\r\nfunction main() {\r\n const t = +readLine();\r\n for(let i = 0; i < t; i++){\r\n const s = +readLine();\r\n // const s = readLine().split(' ').map(p => +p);\r\n let result = myFunc(s);\r\n console.log(result);\r\n }\r\n}\r\n\r\nfunction myFunc(s){\r\n let acum = 0;\r\n let arr = [9, 8, 7, 6, 5, 4, 3, 2, 1];\r\n let resp = [];\r\n\r\n for(let i = 0; i < arr.length; i++){\r\n if(s - acum <= arr[i]){\r\n resp.push(s-acum);\r\n break;\r\n }\r\n acum += arr[i];\r\n resp.push(arr[i]);\r\n }\r\n\r\n return resp.reverse().join('');\r\n\r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "37109fadcd860fa1c4dfd071e9782d4d", "src_uid": "fe126aaa93acaca8c8559bc9e7e27b9f", "difficulty": 800.0} {"lang": "Node.js", "source_code": "\r\nprocess.stdin.resume();\r\nprocess.stdin.setEncoding('utf-8');\r\nlet inputString = '', currentLine = 0;\r\nprocess.stdin.on('data', inputStdin => { inputString += inputStdin; });\r\nprocess.stdin.on('end', _ => { \r\n inputString = inputString.trim().split('\\n').map(string => string.trim());\r\n main(); \r\n});\r\nfunction readLine() {\r\n return inputString[currentLine++];\r\n}\r\n\r\nfunction main() {\r\n const t = +readLine();\r\n for(let i = 0; i < t; i++){\r\n const s = +readLine();\r\n // const s = readLine().split(' ').map(p => +p);\r\n let result = myFunc(s);\r\n console.log(result);\r\n }\r\n}\r\n\r\nfunction myFunc(s){\r\n let acum = 0;\r\n let arr = [9, 8, 7, 6, 5, 4, 3, 2, 1];\r\n let resp = [];\r\n\r\n for(let i = 0; i < arr.length; i++){\r\n if(s - acum < arr[i]){\r\n resp.push(s-acum);\r\n break;\r\n }\r\n acum += arr[i];\r\n resp.push(arr[i]);\r\n }\r\n\r\n return resp.reverse().join('');\r\n\r\n\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ccb895f561e965010f08412f89135fe3", "src_uid": "fe126aaa93acaca8c8559bc9e7e27b9f", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "/******/ (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\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\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.loaded = 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// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar List = __webpack_require__(1);\n\tvar n = List.map(parseInt, readline().split(' '))[0];\n\tvar single = 0;\n\tfor (var x = 1; x <= 3; x++) {\n\t for (var y = 1; y <= 3; y++) {\n\t for (var z = 1; z <= 3; z++) {\n\t if (x + y + z == 6)\n\t single++;\n\t }\n\t }\n\t}\n\tvar mod = 1000000007;\n\tfunction pow(base, exp, mod) {\n\t if (exp == 0)\n\t return 1 % mod;\n\t if (exp == 1)\n\t return base % mod;\n\t var half = pow(base, Math.floor(exp / 2), mod);\n\t half = (half * half) % mod;\n\t if (exp % 2 == 1) {\n\t half = (half * base) % mod;\n\t }\n\t return half;\n\t}\n\tprint((pow(3, 3 * n, mod) - pow(single, n, mod) + mod) % mod);\n\n\n/***/ },\n/* 1 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Prelude_1 = __webpack_require__(2);\n\tfunction add(xs, ys) {\n\t return xs.concat(ys);\n\t}\n\texports.add = add;\n\tfunction head(xs) {\n\t return xs[0];\n\t}\n\texports.head = head;\n\tfunction last(xs) {\n\t return xs[xs.length - 1];\n\t}\n\texports.last = last;\n\tfunction tail(xs) {\n\t return xs.slice(1);\n\t}\n\texports.tail = tail;\n\tfunction init(xs) {\n\t return xs.slice(0, xs.length - 1);\n\t}\n\texports.init = init;\n\tfunction map(f, xs) {\n\t var result = new Array(xs.length);\n\t for (var i = 0; i < xs.length; i++) {\n\t result[i] = f(xs[i]);\n\t }\n\t return result;\n\t}\n\texports.map = map;\n\tfunction reverse(xs) {\n\t return xs.slice().reverse();\n\t}\n\texports.reverse = reverse;\n\tfunction intersperse(x, xs) {\n\t if (xs.length == 0) {\n\t return [];\n\t }\n\t var result = new Array(xs.length + xs.length - 1);\n\t for (var i = 0; i + 1 < xs.length; i++) {\n\t result[i + i] = xs[i];\n\t result[i + i + 1] = x;\n\t }\n\t result[result.length - 1] = xs[xs.length - 1];\n\t return result;\n\t}\n\texports.intersperse = intersperse;\n\tfunction intercalate(xs, xss) {\n\t return concat(intersperse(xs, xss));\n\t}\n\texports.intercalate = intercalate;\n\tfunction foldl(f, initial, xs) {\n\t var result = initial;\n\t for (var i = 0; i < xs.length; i++) {\n\t result = f(result, xs[i]);\n\t }\n\t return result;\n\t}\n\texports.foldl = foldl;\n\tfunction foldr(f, initial, xs) {\n\t var result = initial;\n\t for (var i = xs.length - 1; i >= 0; i--) {\n\t result = f(xs[i], result);\n\t }\n\t return result;\n\t}\n\texports.foldr = foldr;\n\tfunction concat(xss) {\n\t var total = sum(map(function (xs) { return xs.length; }, xss));\n\t var result = new Array(total);\n\t var m = 0;\n\t for (var i = 0; i < xss.length; i++) {\n\t var xs = xss[i];\n\t for (var j = 0; j < xs.length; j++) {\n\t result[m++] = xs[j];\n\t }\n\t }\n\t return result;\n\t}\n\texports.concat = concat;\n\tfunction sum(xs) {\n\t var result = 0;\n\t for (var i = 0; i < xs.length; i++) {\n\t result += xs[i];\n\t }\n\t return result;\n\t}\n\texports.sum = sum;\n\tfunction product(xs) {\n\t var result = 1;\n\t for (var i = 0; i < xs.length; i++) {\n\t result *= xs[i];\n\t }\n\t return result;\n\t}\n\texports.product = product;\n\tfunction sort(xs, compare) {\n\t return copy(xs).sort(compare);\n\t}\n\texports.sort = sort;\n\tfunction sortInPlace(xs, compare) {\n\t xs.sort(compare);\n\t return xs;\n\t}\n\texports.sortInPlace = sortInPlace;\n\tfunction maximumInRange(xs, s, e) {\n\t var result = xs[s];\n\t for (var i = s + 1; i <= e; i++) {\n\t if (result < xs[i])\n\t result = xs[i];\n\t }\n\t return result;\n\t}\n\texports.maximumInRange = maximumInRange;\n\tfunction maximum(xs) {\n\t return maximumInRange(xs, 0, xs.length - 1);\n\t}\n\texports.maximum = maximum;\n\tfunction maximumInRangeWith(xs, s, e, f) {\n\t var result = f(xs[s]);\n\t for (var i = s + 1; i <= e; i++) {\n\t var candidate = f(xs[i]);\n\t if (result < candidate)\n\t result = candidate;\n\t }\n\t return result;\n\t}\n\texports.maximumInRangeWith = maximumInRangeWith;\n\tfunction maximumWith(xs, f) {\n\t return maximumInRangeWith(xs, 0, xs.length - 1, f);\n\t}\n\texports.maximumWith = maximumWith;\n\tfunction minimumInRange(xs, s, e) {\n\t var result = xs[s];\n\t for (var i = s + 1; i <= e; i++) {\n\t if (result > xs[i])\n\t result = xs[i];\n\t }\n\t return result;\n\t}\n\texports.minimumInRange = minimumInRange;\n\tfunction minimum(xs) {\n\t return minimumInRange(xs, 0, xs.length - 1);\n\t}\n\texports.minimum = minimum;\n\tfunction minimumInRangeWith(xs, s, e, f) {\n\t var result = f(xs[s]);\n\t for (var i = s + 1; i <= e; i++) {\n\t var candidate = f(xs[i]);\n\t if (result > candidate)\n\t result = candidate;\n\t }\n\t return result;\n\t}\n\texports.minimumInRangeWith = minimumInRangeWith;\n\tfunction minimumWith(xs, f) {\n\t return minimumInRangeWith(xs, 0, xs.length - 1, f);\n\t}\n\texports.minimumWith = minimumWith;\n\tfunction replicate(n, x) {\n\t var result = new Array(n);\n\t for (var i = 0; i < result.length; i++) {\n\t result[i] = x;\n\t }\n\t return result;\n\t}\n\texports.replicate = replicate;\n\tfunction take(n, xs) {\n\t return xs.slice(0, n);\n\t}\n\texports.take = take;\n\tfunction drop(n, xs) {\n\t return xs.slice(n);\n\t}\n\texports.drop = drop;\n\tfunction splitAt(n, xs) {\n\t return [take(n, xs), drop(n, xs)];\n\t}\n\texports.splitAt = splitAt;\n\tfunction takeWhile(f, xs) {\n\t for (var i = 0; i < xs.length; i++) {\n\t if (!f(xs[i])) {\n\t return xs.slice(0, i);\n\t }\n\t }\n\t return xs.slice();\n\t}\n\texports.takeWhile = takeWhile;\n\tfunction dropWhile(f, xs) {\n\t for (var i = 0; i < xs.length; i++) {\n\t if (!f(xs[i])) {\n\t return xs.slice(i);\n\t }\n\t }\n\t return [];\n\t}\n\texports.dropWhile = dropWhile;\n\tfunction group(xs) {\n\t if (xs.length == 0)\n\t return [];\n\t var result = [];\n\t var last = [xs[0]];\n\t for (var i = 1; i < xs.length; i++) {\n\t if (last[0] === xs[i]) {\n\t last.push(xs[i]);\n\t }\n\t else {\n\t result.push(last);\n\t last = [xs[i]];\n\t }\n\t }\n\t result.push(last);\n\t return result;\n\t}\n\texports.group = group;\n\tfunction nub(xs) {\n\t if (xs.length == 0)\n\t return [];\n\t var result = [];\n\t result.push(xs[0]);\n\t for (var i = 1; i < xs.length; i++) {\n\t if (xs[i] !== xs[i - 1]) {\n\t result.push(xs[i]);\n\t }\n\t }\n\t return result;\n\t}\n\texports.nub = nub;\n\tfunction filter(f, xs) {\n\t var result = [];\n\t for (var i = 0; i < xs.length; i++) {\n\t if (f(xs[i]))\n\t result.push(xs[i]);\n\t }\n\t return result;\n\t}\n\texports.filter = filter;\n\tfunction zip(xs, ys) {\n\t var n = Prelude_1.min(xs.length, ys.length);\n\t var result = new Array(n);\n\t for (var i = 0; i < n; i++) {\n\t result[i] = [xs[i], ys[i]];\n\t }\n\t return result;\n\t}\n\texports.zip = zip;\n\tfunction unzip(xs) {\n\t var r1 = new Array(xs.length);\n\t var r2 = new Array(xs.length);\n\t for (var i = 0; i < xs.length; i++) {\n\t r1[i] = xs[i][0];\n\t r2[i] = xs[i][1];\n\t }\n\t return [r1, r2];\n\t}\n\texports.unzip = unzip;\n\tfunction range(from, to) {\n\t var result = Array(to - from + 1);\n\t for (var i = from; i <= to; i++) {\n\t result[i - from] = i;\n\t }\n\t return result;\n\t}\n\texports.range = range;\n\tfunction copy(xs) {\n\t return xs.slice(0);\n\t}\n\texports.copy = copy;\n\tfunction apply_permutation(p, xs) {\n\t var n = xs.length;\n\t var result = new Array(n);\n\t for (var i = 0; i < n; i++) {\n\t result[i] = xs[p[i]];\n\t }\n\t return result;\n\t}\n\texports.apply_permutation = apply_permutation;\n\tfunction next_permutation(p) {\n\t var n = p.length;\n\t if (n < 2)\n\t return null;\n\t var r = copy(p);\n\t var k = n - 2;\n\t for (; k >= 0 && r[k] >= r[k + 1]; k--)\n\t ;\n\t if (k < 0)\n\t return null;\n\t for (var i = k + 1, j = n - 1; i < j; i++, j--) {\n\t var t_1 = r[i];\n\t r[i] = r[j];\n\t r[j] = t_1;\n\t }\n\t var next = k + 1;\n\t for (; r[next] <= r[k]; next++)\n\t ;\n\t var t = r[k];\n\t r[k] = r[next];\n\t r[next] = t;\n\t return r;\n\t}\n\texports.next_permutation = next_permutation;\n\tfunction create(n, value) {\n\t return replicate(n, value);\n\t}\n\texports.create = create;\n\tfunction createWith(n, f) {\n\t var result = new Array(n);\n\t for (var i = 0; i < n; i++) {\n\t result[i] = f(i);\n\t }\n\t return result;\n\t}\n\texports.createWith = createWith;\n\tfunction create2D(n1, n2, value) {\n\t return map(function (_) { return replicate(n2, value); }, replicate(n1, 0));\n\t}\n\texports.create2D = create2D;\n\tfunction create2DWith(n1, n2, f) {\n\t var result = new Array(n1);\n\t for (var i = 0; i < n1; i++) {\n\t result[i] = new Array(n2);\n\t for (var j = 0; j < n2; j++) {\n\t result[i][j] = f(i, j);\n\t }\n\t }\n\t return result;\n\t}\n\texports.create2DWith = create2DWith;\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports) {\n\n\tfunction min(a, b) {\n\t return a < b ? a : b;\n\t}\n\texports.min = min;\n\tfunction max(a, b) {\n\t return a < b ? b : a;\n\t}\n\texports.max = max;\n\tfunction curry(f) {\n\t return function (x) { return function (y) { return f(x, y); }; };\n\t}\n\texports.curry = curry;\n\tfunction uncurry(f) {\n\t return function (x, y) { return f(x)(y); };\n\t}\n\texports.uncurry = uncurry;\n\tfunction id(x) {\n\t return x;\n\t}\n\texports.id = id;\n\tfunction constant(x) {\n\t return function (_) { return x; };\n\t}\n\texports.constant = constant;\n\tfunction flip(f) {\n\t return function (y) { return function (x) { return f(x)(y); }; };\n\t}\n\texports.flip = flip;\n\tfunction flip2(f) {\n\t return function (y, x) { return f(x, y); };\n\t}\n\texports.flip2 = flip2;\n\tfunction compose(g, f) {\n\t return function (x) { return g(f(x)); };\n\t}\n\texports.compose = compose;\n\tfunction gcd(a, b) {\n\t var r = a % b;\n\t while (r !== 0) {\n\t a = b;\n\t b = r;\n\t r = a % b;\n\t }\n\t return b;\n\t}\n\texports.gcd = gcd;\n\n\n/***/ }\n/******/ ]);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "499a94c3496114c5840e6dbe3c828e58", "src_uid": "eae87ec16c284f324d86b7e65fda093c", "difficulty": 1500.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nlet l = 0;\nlet k, s = 0\nrl.on('line', (input) => {\n arr = input.split(\" \").map(x => parseInt(x))\n n = arr[0]\n k = arr[1]\n rl.close();\n\n for (let i = k - 1; i >= 0; i--) {\n if (n % i === 0) {\n let c = n / i\n console.log(c * k + i)\n return\n }\n }\n})", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ec842ca2a6f2e06c281305905e28608c", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "function main() {\n let line = stdin[0].split(' ');\n let n = parseInt(line[0]);\n let k = parseInt(line[1]);\n\n\n let nDivisors = [];\n\n for(let i=1; i*i<=n; i++) {\n if(n%i==0) {\n nDivisors.push(i);\n if( i*i != n ) {\n nDivisors.push(n/i);\n }\n }\n }\n\n var x = undefined;\n\n for(let xModK=1; xModKxCandidate) {\n x = xCandidate;\n }\n\n }\n }\n console.log(x);\n};\n\n\nconst readline = require('readline');\nconst rl = readline.createInterface(process.stdin, process.stdout, null);\n\nvar stdin = [];\nrl.on('line', function (line) {stdin.push(line);});\nrl.on('close', main);\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "4ab03255dc99da166e89cfb45f45bafa", "src_uid": "ed0ebc1e484fcaea875355b5b7944c57", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nconst rem = (s, m) => {\n const n = s.length;\n if (n <= 10) return parseInt(s) % m;\n\n const first = s.slice(0, n-10);\n const second = s.slice(-10);\n return (rem(first, m) * ((10**10) % m) + parseInt(second) % m) % m;\n}\n\nconst div = (s, m) => {\n const n = s.length;\n if (n <= 10) return parseInt(parseInt(s) / m);\n\n const rem = parseInt(s.slice(0, 10)) % m\n const head = (parseInt(s.slice(0, 10)) - rem) / m;\n return `${head}${div(`${rem}${s.slice(10)}`, m)}`;\n}\n\nconst sub = (a, b) => {\n const subact = (A, B) => {\n const lA = A.length, lB = B.length;\n if (lA <= 9 && lB <= 9) return [ { value: parseInt(A) - parseInt(B), size: lA } ];\n if (lA < lB) return [ { value: -parseInt(B.slice(0, -lA)), size: lB - lA }, ...subact(B.slice(-lA), A) ];\n if (lA > lB) return [ { value: parseInt(A.slice(0, -lB)), size: lA - lB }, ...subact(A.slice(-lB), B) ];\n\n return [ { value: parseInt(A.slice(0, 9)) - parseInt(B.slice(0, 9)), size: 9 }, ...subact(A.slice(9), B.slice(9)) ]\n }\n\n let x = subact(a, b);\n x = x.slice(x.findIndex(i => i.value));\n if (!x.length) return '0';\n\n let t = '';\n if (x[0] < 0) { t = '-'; x = x.map(i => -i); }\n\n for (let i = 1; i < x.length; i++) {\n if (x[i].value < 0) { x[i-1].value -= 1; x[i].value = 10**10 + x[i].value; }\n }\n return t + x.map(i => `${'0'.repeat(i.size)}${i.value}`.slice(-i.size)).join('').replace(/^0+/, '') || '0';\n}\n\n\nconst problem = (n, p, w, d) => {\n let Y = -1;\n const W = parseInt(w);\n while (++Y < W && rem(p, w)) p = sub(p, d);\n const z = sub(sub(n, div(p, w)), `${Y}`);\n if (Y === W) return -1; // || (p|z) < 0\n return `${div(p, w)} ${Y} ${z}`;\n}\n\nconst npwd = readline().split(' ');\nwrite(problem(npwd[0], npwd[1], npwd[2], npwd[3]));", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "2e61ed3e7ae8b7f6593c8bae1d505bbb", "src_uid": "503116e144d19eb953954d99c5526a7d", "difficulty": 2000.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nconst rem = (s, m) => {\n const n = s.length;\n if (n <= 9) return parseInt(s) % m;\n return (rem(s.slice(0, n-9), m) * ((10**9) % m) + parseInt(s.slice(-9)) % m) % m;\n}\n\nconst div = (s, m) => {\n const n = s.length;\n if (n <= 9) return parseInt(parseInt(s) / m);\n const rem = parseInt(s.slice(0, 9)) % m\n const head = (parseInt(s.slice(0, 9)) - rem) / m;\n return `${head}${div(`${rem}${s.slice(9)}`, m)}`;\n}\n\nconst sub = (a, b) => {\n const substract = (A, B) => {\n const lA = A.length, lB = B.length;\n if (lA <= 9 && lB <= 9) return [ { value: parseInt(A) - parseInt(B), size: lA } ];\n if (lA < lB) return [ { value: -parseInt(B.slice(0, -lA)), size: lB - lA } ].concat(substract(B.slice(-lA), A));\n if (lA > lB) return [ { value: parseInt(A.slice(0, -lB)), size: lA - lB } ].concat(substract(A.slice(-lB), B));\n\n return [ { value: parseInt(A.slice(0, 9)) - parseInt(B.slice(0, 9)), size: 9 } ].concat(substract(A.slice(9), B.slice(9)))\n }\n\n let x = substract(a, b);\n x = x.slice(x.findIndex(i => i.value));\n if (!x.length) return '0';\n\n let t = '';\n if (x[0] < 0) { t = '-'; x = x.map(i => -i); }\n\n for (let i = 1; i < x.length; i++) {\n if (x[i].value < 0) { x[i-1].value -= 1; x[i].value = 10**10 + x[i].value; }\n }\n return t + x.map(i => `${'0'.repeat(i.size)}${i.value}`.slice(-i.size)).join('').replace(/^0+/, '') || '0';\n}\n\n\nconst problem = (n, p, w, d) => {\n let Y = -1;\n const W = parseInt(w);\n while (++Y < W && rem(p, w)) p = sub(p, d);\n const z = sub(sub(n, div(p, w)), `${Y}`);\n if (Y === W) return -1; // || (p|z) < 0\n return `${div(p, w)} ${Y} ${z}`;\n}\n\nconst npwd = readline().split(' ');\nwrite(problem(npwd[0], npwd[1], npwd[2], npwd[3]));", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "e97e2859807d5423548540b1c284eaf0", "src_uid": "503116e144d19eb953954d99c5526a7d", "difficulty": 2000.0} {"lang": "JavaScript", "source_code": "var flowers = function(r, g, b){\n\tvar count = 0;\n\tvar colors = [r, g, b];\n\tfor (var i in colors) {\n\t\tif (colors[i] > 3){\n\t\t\tif (colos[i] % 3 == 0){\n\t\t\t\tcount += colors[i] / 3 - 1;\n\t\t\t\tcolors[i] = 3;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcount += Math.floor(colors[i] / 3);\n\t\t\t\tcolors[i] = colors[i] % 3;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( colors.filter(function(index) {\n\t\treturn index == 2\n\t}).length < 2) {\n\t\tfor (var i in colors){\n\t\t\tif (colors[i] == 3){\n\t\t\t\tcolors[i] -= 3;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\n\twhile (colors.filter(function(index) {\n\t\treturn index >= 1;\n\t}).length >= 3) {\n\t\tfor (var i in colors) {\n\t\t\tcolors[i] -= 1;\n\t\t}\n\t\tcount++;\n\t}\n\n\treturn count;\n};\n\nvar line = readline().split(' ');\nvar r = parseInt(line[0]);\nvar g = parseInt(line[1]);\nvar b = parseInt(line[2]);\n\nprint (flowers(r, g, b));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "557fe4ee8548b15532737acc299a2b83", "src_uid": "acddc9b0db312b363910a84bd4f14d8e", "difficulty": 1600.0} {"lang": "JavaScript", "source_code": "\nvar len = parseInt(readline());\nvar str = readline();\n\nif (isGood(str)) {\n print(\"1\");\n print(str);\n} else {\n var res = breakItDown(str, len);\n print(res.length)\n print(res.join(\" \"))\n}\n\n\nfunction breakItDown(str, len) {\n var left = str.substr(0, len / 2);\n var right = str.substr(len / 2);\n var slidingWindowIndex = 0;\n\n while (!isGood(left)) {\n slidingWindowIndex++;\n left += right.charAt(0);\n }\n\n right = right.substr(slidingWindowIndex);\n\n return [left, right];\n}\n\nfunction isGood(str) {\n return count(str, 1) != count(str, 0)\n}\n\nfunction count(str, num) {\n var _count = 0;\n for (var i = 0; i < str.length; i++)\n _count += str.charAt(i) == num ? 1 : 0;\n return _count\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "41db463c89312d64ceb40f9a245bf0b5", "src_uid": "4ebed264d40a449602a26ceef2e849d1", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "const input = readline().split(\" \").map(x => Number(x));\nconst n = input[0];\nvar sum = 0;\nfor (var i = 1; i <= n; i++) {\n var current = i;\n var remaining = i;\n while (remaining) {\n var next = Math.floor(remaining * 0.1);\n current = current * 10 + (remaining - next * 10);\n remaining = next;\n }\n sum += current;\n}\nprint(sum % input[1]);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "dd2e0ac7f1b631eb9a2a66352ef59996", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "var K, P;\nK = readline();\nP = readline();\n\nvar i = 1;\n\nvar sum = 0;\n\nwhile (i <= K) {\n var now = i.toString(10);\n var temp = now;\n temp += m_reverse(now);\n sum = (sum + parseInt(temp)) % P;\n i++;\n}\n\nprint(sum);\n\nfunction m_reverse(str) {\n var r_str = \"\";\n for (var i = str.length - 1; i >= 0; i--) {\n r_str += str[i];\n }\n\n return r_str;\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "16489eba5a61ca509db56ea15964d541", "src_uid": "00e90909a77ce9e22bb7cbf1285b0609", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "function main() {\n var knsp = readline()\n .split(' ')\n .map(l => Number(l));\n var k = knsp[0],\n n = knsp[1],\n s = knsp[2],\n p = knsp[3];\n\n var sheetsNeeded = k * Math.ceil(n / s);\n var packsNeeded = Math.ceil(sheetsNeeded / p);\n\n print(packsNeeded);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ed12b896eb6318b2a84ad78e14782e55", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var g = readline().split(\" \");\n\nvar k = Number(g[0]);\nvar n = Number(g[1]);\nvar s = Number(g[2]);\nvar p = Number(g[3]);\n\nprint(Math.ceil(k/p)*Math.ceil(n/s));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c58cfb5c252a6a470e4e5c1a43518249", "src_uid": "73f0c7cfc06a9b04e4766d6aa61fc780", "difficulty": 800.0} {"lang": "Node.js", "source_code": "\n\n const readline = require('readline');\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n rl.question('', (value) => {\n let s = value;\n let isPalindrome = true;\n let oneLetter = true;\n console.log(Math.floor(s.length/2));\n for(let idx = 0; idx < Math.floor(s.length/2) && isPalindrome; idx += 1){\n console.log('aa',idx);\n if(s.charAt(idx) != s.charAt(s.length-idx-1)){\n console.log('bb');\n isPalindrome = false;\n }\n if(s[idx] !== s[idx+1] && oneLetter){\n oneLetter = false;\n }\n }\n if(!isPalindrome){\n console.log(s.length);\n }else if(oneLetter) {\n console.log(0);\n }else {\n console.log(s.length-1);\n }\n rl.close();\n\n });\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f797e6625fe32a12a03f36656673d32b", "src_uid": "6c85175d334f811617e7030e0403f706", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var s = readline().trim()\nvar t = [];\nvar d = {}\nvar abc = 'abcdefghijklmnopqrstuvwxyz';\nfor (var i in s.split('')) {\n var c = s[i];\n if (!d[c]) {\n t.push(c);\n d[c] = true;\n }\n}\nt.sort()\n//print(t.join(''))\nvar len = t.length;\nvar abc2 = abc.slice(0, len)\nprint (t.join('') === abc2 ? 'YES' : 'NO')", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ab5f01ff1a13f8e845d2bd3754f6ed21", "src_uid": "c4551f66a781b174f95865fa254ca972", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var s = readline().trim()\nvar t = [];\nvar d = {}\nvar abc = 'abcdefghijklmnopqrstuvwxyz';\nfor (var i in s.split('')) {\n var c = s[i];\n if (!d[c]) {\n t.push(c);\n d[c] = true;\n }\n}\nt.sort()\nprint(t.join(''))\nvar len = t.length;\nvar abc2 = abc.slice(0, len)\nprint (t.join('') === abc2 ? 'YES' : 'NO')", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "709d64f7a1fc09adf146aeb1aa775434", "src_uid": "c4551f66a781b174f95865fa254ca972", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "function nextChar(c) {\n return String.fromCharCode(\n c.charCodeAt(0) + 1\n )\n}\n\nvar str = readline(),\n done = false\n\nfor (var i = 'a' ; str.length && i <= 'z' && !done; i = nextChar(i)) { //console.log(str, i)\n if (str[0] === i) str = str.split(i).join('')\n else done = true\n}\n\nprint(done ? 'NO' : 'YES')\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "149d0ad0bf81271dd827ef0dd61f76d9", "src_uid": "c4551f66a781b174f95865fa254ca972", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var a=[];\na.push('0 0 0 0 0'.split(' ').map(Number));\nfor(var i=0; i<3; i++){\n\ta.push( ('0 '+readline()+' 0').split(' ').map(Number));\n}\na.push('0 0 0 0 0'.split(' ').map(Number));\nvar ans=[];\nfor(var i=1; i<=3; i++){\n\tans[i-1]=[];\n\tfor(var j=1; j<=3; j++){\n\t\tans[i-1][j-1] = (a[i][j]+a[i+1][j]+a[i-1][j]+a[i][j+1]+a[i][j-1]+1)%2;\n\t}\n}\nprint(ans.map(function(v){return v.join('');}).join('\\n'));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3d53e0e60477d57d79561c33f9bc88dd", "src_uid": "b045abf40c75bb66a80fd6148ecc5bd6", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "print(parseFloat(readline()) * 9)", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "517b34d18f577875491612004eee72eb", "src_uid": "bf65a25185e9ea5b71e853723b838b04", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": "var input=readline();\nprint(27);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "990b81ae40abf2dc03ffffb57108be6d", "src_uid": "bf65a25185e9ea5b71e853723b838b04", "difficulty": 1700.0} {"lang": "Node.js", "source_code": "let i = '';\nprocess.stdin.on('data', (c) => {\n i += c;\n});\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n const lines = i.split(EOL);\n const b = parseInt(lines[0], 10);\n const g = parseInt(lines[1], 10);\n const n = parseInt(lines[2], 10);\n console.log(badges(b, g, n));\n});\n\n\nfunction badges(b, g, n) {\n if (n === b + g) return 1;\n const min = Math.min(b, g);\n const sub = Math.max(b, g) < n ? n - Math.max(b, g) : 0;\n return min >= n ? 1 + n - sub : 1 + min - sub;\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d0a8ac6d89839cfaf6b25560bac263d2", "src_uid": "9266a69e767df299569986151852e7b1", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "let i = '';\nprocess.stdin.on('data', (c) => {\n i += c;\n});\nprocess.stdin.on('end', () => {\n const { EOL } = require('os');\n const lines = i.split(EOL);\n const b = parseInt(lines[0], 10);\n const g = parseInt(lines[1], 10);\n const n = parseInt(lines[2], 10);\n console.log(badges(b, g, n));\n});\n\n\nfunction badges(b, g, n) {\n if (n === b + g) return 1;\n const min = Math.min(b, g);\n return min >= n ? 1 + n : 1 + min;\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3ab49592a72693feb9168f5b7d885e2b", "src_uid": "9266a69e767df299569986151852e7b1", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var line = readline();\nvar left = line.substring(0,line.indexOf('|'));\nvar right = line.substring(line.indexOf('|')+1,(line.length));\nvar rest = readline();\n\nprint(left);\nprint(right);\nprint(rest);\n\nvar diff = left.length - right.length;\n\nif(diff>0){\n if(rest.length>=diff){\n right = right+rest.substr(0,diff);\n \n rest = rest.substring(diff,rest.length);\n print('rest:'+ rest+rest.length); \n if((rest.length % 2)==0){\n left = left + rest.substring(0,rest.length/2);\n right = right + rest.substring((rest.length/2));\n print(left+'|'+right);\n }\n else{\n print('Impossible');\n }\n }\n else{\n print('Impossible');\n }\n}\nelse if(diff==0){\n if((rest.length % 2)==0){\n left = left + rest.substring(0,rest.length/2);\n right = right + rest.substring(rest.length/2);\n print(left+'|'+right);\n }\n else{\n print('Impossible');\n }\n}\nelse if(diff<0){\n diff = Math.abs(diff);\n if(rest.length>=diff){\n left = left+rest.substr(0,diff);\n rest = rest.substr(diff,rest.length); \n if((rest.length % 2)==0){\n left = left + rest.substring(0,rest.length/2);\n right = right + rest.substring(rest.length/2);\n print(left+'|'+right);\n }\n else{\n print('Impossible');\n }\n }\n else{\n print('Impossible');\n }\n\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "b65a7accf79d9bceab2f189343c96c4f", "src_uid": "917f173b8523ddd38925238e5d2089b9", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var a=readline().split(\"|\"),b=readline(),i=0;\nwhile(ia[1].length)]+=b[i++];\nprint(a[0].length-a[1].length?a.join(\"|\"):\"Impossible\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "90cda8844b28d82d44d98e4b1fb800b6", "src_uid": "917f173b8523ddd38925238e5d2089b9", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var values = readline().split(\"|\");\n\nvar a = values[0];\nvar b = values[1];\n\nif (a.length <= b.length) {\n a = a.concat(readline());\n} else {\n b = b.concat(readline());\n}\n\nif (a.length !== b.length) {\n print(\"Impossible\");\n} else {\n print([a, b].join(\"|\"));\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8491699a8fc007824615525b7188247e", "src_uid": "917f173b8523ddd38925238e5d2089b9", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var line = readline();\nvar left = line.substring(0,line.indexOf('|'));\nvar right = line.substring(line.indexOf('|')+1,(line.length));\nvar rest = readline();\n\nvar diff = left.length - right.length;\n\nif(diff>0){\n if(rest.length>=diff){\n right = right+rest.substr(0,diff);\n \n rest = rest.substring(diff,rest.length);\n if((rest.length % 2)==0){\n left = left + rest.substring(0,rest.length/2);\n right = right + rest.substring((rest.length/2));\n print(left+'|'+right);\n }\n else{\n print('Impossible');\n }\n }\n else{\n print('Impossible');\n }\n}\nelse if(diff==0){\n if((rest.length % 2)==0){\n left = left + rest.substring(0,rest.length/2);\n right = right + rest.substring(rest.length/2);\n print(left+'|'+right);\n }\n else{\n print('Impossible');\n }\n}\nelse if(diff<0){\n diff = Math.abs(diff);\n if(rest.length>=diff){\n left = left+rest.substr(0,diff);\n rest = rest.substr(diff,rest.length); \n if((rest.length % 2)==0){\n left = left + rest.substring(0,rest.length/2);\n right = right + rest.substring(rest.length/2);\n print(left+'|'+right);\n }\n else{\n print('Impossible');\n }\n }\n else{\n print('Impossible');\n }\n\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "26d75aedba2ad9bd5b0b8f5965c4a5fa", "src_uid": "917f173b8523ddd38925238e5d2089b9", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var r=readline,a=r().split(\"|\"),b=r(),i=0;\nfor(;ia[1].length)]+=b[i++];\nprint(a[0].length-a[1].length?\"Impossible\":a.join(\"|\"));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "05839fb0d9dca491d92a41f9f6c4ebd0", "src_uid": "917f173b8523ddd38925238e5d2089b9", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "\"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//-----------main fucntion-----------\n\nfunction main() {\n var input = readline().split(\" \").map(x => parseInt(x))\n var a = input[0], b = input[1]\n if (a > b) print(\"-1\")\n else print(a)\n\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "a7163ed669b2368bad95f1f434d636d4", "src_uid": "3041b1240e59341ad9ec9ac823e57dd7", "difficulty": 800.0} {"lang": "Node.js", "source_code": "var readline = require(\"readline\");\nvar rl = readline.createInterface(process.stdin, process.stdout);\nrl.on(\"line\", function(line) {\n console.log(solution(line))\n rl.close();\n}).on(\"close\",function(){\n process.exit(0);\n});\n\nfunction solution(input){\n const check = n => [...new Set(n)].join('') == n;\n var [l, r] = input.split(' ');\n r = +r;\n while (++l < r){\n if (check(l.toString()))\n return l;\n }\n return -1;\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "96e132a99e0818a0a1506dcfee72c582", "src_uid": "3041b1240e59341ad9ec9ac823e57dd7", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i 0 && arguments[0] !== undefined ? arguments[0] : [];\n var directed = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n _classCallCheck(this, Graph);\n\n this.directed = directed;\n this.nodes = nodes;\n this.edges = {};\n nodes.forEach(function (node) {\n _this.edges[node] = [];\n });\n }\n\n _createClass(Graph, [{\n key: 'addNode',\n value: function addNode(node) {\n // is it required ?\n if (this.edges[node]) {\n throw new Error('Graph.prototype.addNode: node is already exists');\n return;\n }\n\n this.nodes.push(node);\n this.edges[node] = [];\n }\n }, {\n key: 'addEdge',\n value: function addEdge(node1, node2) {\n var weight = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n this.edges[node1].push({ node: node2, weight: weight });\n\n if (!this.directed) {\n this.edges[node2].push({ node: node1, weight: weight });\n }\n }\n }]);\n\n return Graph;\n}();\n\nmodule.exports = Graph;\n\n},{\"../queue\":4,\"../stack\":5}],2:[function(require,module,exports){\n\"use strict\";\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Node = function () {\n function Node(value) {\n _classCallCheck(this, Node);\n\n this.value = value;\n this.nextNode = null;\n this.prevNode = null;\n }\n\n _createClass(Node, [{\n key: \"getValue\",\n value: function getValue() {\n return this.value;\n }\n }, {\n key: \"setValue\",\n value: function setValue(value) {\n this.value = value;\n }\n }, {\n key: \"setNext\",\n value: function setNext(nextNodeLink) {\n this.nextNode = nextNodeLink;\n }\n }, {\n key: \"setPrev\",\n value: function setPrev(prevNodeLink) {\n this.prevNode = prevNodeLink;\n }\n }, {\n key: \"getNext\",\n value: function getNext() {\n return this.nextNode;\n }\n }, {\n key: \"getPrev\",\n value: function getPrev() {\n return this.prevNode;\n }\n }]);\n\n return Node;\n}();\n\nmodule.exports = Node;\n\n},{}],3:[function(require,module,exports){\n'use strict';\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Node = require('../node');\n\nvar Queue = function () {\n function Queue() {\n _classCallCheck(this, Queue);\n\n this.firstItemLink = null;\n this.lastItemLink = null;\n }\n\n _createClass(Queue, [{\n key: 'enqueue',\n value: function enqueue(item, priority) {\n var node = new Node({\n item: item,\n priority: priority\n });\n\n if (this.isEmpty()) {\n this.lastItemLink = node;\n this.firstItemLink = node;\n } else {\n\n if (priority >= this.firstItemLink.getValue().priority) {\n // \u0412\u043f\u0435\u0440\u0435\u0434\n node.setNext(this.firstItemLink);\n this.firstItemLink = node;\n } else if (priority <= this.lastItemLink.getValue().priority) {\n // \u041d\u0430\u0437\u0430\u0434\n this.lastItemLink.setNext(node);\n this.lastItemLink = node;\n } else {\n // \u0412 \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443\n var currentNode = this.firstItemLink;\n while (currentNode) {\n var nextNode = currentNode.getNext();\n if (priority >= nextNode.getValue().priority) {\n currentNode.setNext(node);\n node.setNext(nextNode);\n currentNode = null;\n } else {\n currentNode = nextNode;\n }\n }\n }\n }\n }\n }, {\n key: 'dequeue',\n value: function dequeue() {\n if (this.isEmpty()) {\n return undefined;\n }\n\n if (this.lastItemLink === this.firstItemLink) {\n this.lastItemLink = null;\n }\n\n var firstItem = this.firstItemLink;\n\n this.firstItemLink = this.firstItemLink.getNext();\n\n return firstItem.getValue().item;\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return !this.firstItemLink;\n }\n }]);\n\n return Queue;\n}();\n\nmodule.exports = Queue;\n\n},{\"../node\":2}],4:[function(require,module,exports){\n'use strict';\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Node = require('../node');\n\nvar Queue = function () {\n function Queue() {\n _classCallCheck(this, Queue);\n\n this.firstItemLink = null;\n this.lastItemLink = null;\n }\n\n _createClass(Queue, [{\n key: 'enqueue',\n value: function enqueue(item) {\n var node = new Node(item);\n\n if (this.isEmpty()) {\n this.lastItemLink = node;\n this.firstItemLink = node;\n } else {\n this.lastItemLink.setNext(node);\n this.lastItemLink = node;\n }\n\n return node;\n }\n }, {\n key: 'dequeue',\n value: function dequeue() {\n if (this.isEmpty()) {\n return undefined;\n }\n\n if (this.lastItemLink === this.firstItemLink) {\n this.lastItemLink = null;\n }\n\n var firstItem = this.firstItemLink;\n\n this.firstItemLink = this.firstItemLink.getNext();\n\n return firstItem.getValue();\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return !this.firstItemLink;\n }\n }]);\n\n return Queue;\n}();\n\nmodule.exports = Queue;\n\n},{\"../node\":2}],5:[function(require,module,exports){\n'use strict';\n\nvar _createClass = function () { function 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); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Node = require('../node');\n\nvar Stack = function () {\n function Stack() {\n _classCallCheck(this, Stack);\n\n this.topItemLink = null;\n }\n\n _createClass(Stack, [{\n key: 'push',\n value: function push(item) {\n var node = new Node(item);\n\n if (this.isEmpty()) {\n this.topItemLink = node;\n } else {\n node.setPrev(this.topItemLink);\n this.topItemLink = node;\n }\n\n return node;\n }\n }, {\n key: 'pop',\n value: function pop() {\n if (this.isEmpty()) {\n return undefined;\n }\n\n var topItemLink = this.topItemLink;\n\n this.topItemLink = this.topItemLink.getPrev();\n\n return topItemLink.getValue();\n }\n }, {\n key: 'isEmpty',\n value: function isEmpty() {\n return !this.topItemLink;\n }\n }]);\n\n return Stack;\n}();\n\nmodule.exports = Stack;\n\n},{\"../node\":2}],6:[function(require,module,exports){\n'use strict';\n\nvar _slicedToArray = function () { function sliceIterator(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\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar Graph = require('../libs/graph');\nvar PriorityQueue = require('../libs/priority-queue');\n\nvar arr = readline().split(' ');\n\nvar _arr$map = arr.map(function (v) {\n return parseInt(v);\n}),\n _arr$map2 = _slicedToArray(_arr$map, 2),\n l = _arr$map2[0],\n r = _arr$map2[1];\n\nvar checker = function checker(num) {\n num = String(num);\n\n var data = {};\n var flag = true;\n for (var i = 0; i < num.length; i++) {\n if (data[num[i]]) {\n flag = false;\n break;\n }\n\n data[num[i]] = 1;\n }\n\n return flag;\n};\n\nvar ans = -1;\nfor (var i = l; i <= r; i++) {\n if (checker(i)) {\n ans = i;\n break;\n }\n}\n\nwrite(ans + '\\n');\n\n},{\"../libs/graph\":1,\"../libs/priority-queue\":3}]},{},[6]);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "bdc731dea4a2336fcb73568ce1ca5a10", "src_uid": "3041b1240e59341ad9ec9ac823e57dd7", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nconst lr = readline().split(' ').map(i => i.split('').map(Number));\n\nconst problem = (l, r) => {\n const test = x => (x => x >= +l.join('') && x <= +r.join('') && x)(parseInt(x));\n\n let res;\n if (l.length < r.length) {\n const Mid = Math.floor((l.length + r.length) / 2)\n if (res = test('98765'.slice(0, Mid))) return res;\n if (res = test('12345'.slice(0, Mid + 1))) return res;\n return -1;\n }\n\n const s = new Set([ 9,8,7,6,5,4,3,2,1,0 ]);\n const L = l.length;\n for(let i = 0; i < L; i++) {\n if (r[i] !== l[i]) {\n const a = l.slice(0, i).join('');\n for (let j = l[i]; j < r[i]; j++) {\n if (s.has(j) && (res = test(a + `${j}` + [ ...s ].filter(d => d !== j).slice(0, L - i - 1).join('')))) return res;\n }\n if (s.has(r[i]) && (res = test(a + `${r[i]}` + [ ...s ].filter(d => d !== r[i]).reverse().slice(0, L - i - 1).join('')))) return res;\n return -1;\n }\n if (!s.has(r[i])) return -1;\n s.delete(r[i]);\n }\n return l.join('')\n}\n\nwrite(problem(lr[0], lr[1]));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "16673125edd5c05aed8228aa520b4f6b", "src_uid": "3041b1240e59341ad9ec9ac823e57dd7", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "n = readline();\nstr = readline().split('');\n\nvar count = 0;\n\nfor (var i = 0; i < n; i++) {\n\tif ((str[i] == 'R' && str[i + 1] == 'U') || (str[i] == 'U' && str[i + 1] == 'R')) {\n\t\tcount++;\n\t\ti++;\n\t} else {\n\t\tcount++;\n\t};\n};\n\nprint(count);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c66b95d86a170aad09fee95a78072ab3", "src_uid": "986ae418ce82435badadb0bd5588f45b", "difficulty": 800.0} {"lang": "Node.js", "source_code": "process.stdin.setEncoding(\"ascii\");\n\nlet input = \"\";\n\nprocess.stdin.on(\"data\", data => { input += data; });\nprocess.stdin.on(\"end\", () => {\n const [[n, m], T] = input.trim().split(\"\\n\").map(x => x.trim().split(\" \").map(Number));\n const sum = [0, ...T];\n for (let i = 1; i < sum.length; i++)\n sum[i] += sum[i - 1];\n sum.shift();\n process.stdout.write(\"0 \");\n for (let i = 1; i < sum.length; i++) {\n const pred = T.slice(0, i);\n pred.sort((a, b) => b - a);\n let currentSum = sum[i];\n let count = 0;\n while (currentSum > m) {\n count++;\n currentSum -= pred.shift();\n }\n process.stdout.write(count + \" \");\n }\n});", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "09c95707266bdf7b547c5f0ecf65435e", "src_uid": "d3c1dc3ed7af2b51b4c49c9b5052c346", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "// function month(a, b) {\nvar a = readline();\nvar b = readline();\n var array = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];\n var c = array.indexOf(a) + 1;\n // c = c % 7;\n console.log(c);\n var d = array.indexOf(b) + 1;\n // console.log(c +' '+ d);\n if(d == c || d == (c + 2) % 7 || d == (c + 3) % 7 ) {\n console.log('YES');\n } else {\n console.log('NO');\n }\n// }month('monday', 'tuesday');", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d8b83017dd4d2e788943e899fed04ec3", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var day1 = readline();\nvar day2 = readline();\nvar days = [\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"];\nvar a = days.indexOf(day1) + 1;\nvar b = days.indexOf(day2) + 1;\nprint((b - a) !== 1 && (a === b || (a + 2) % 7 >= b || (a + 3) % 7 >= b) && \"YES\" || \"NO\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "06caaae66da669e4ebb319eb47a48bb2", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var day1 = readline();\nvar day2 = readline();\nvar days = [\"monday\", \"tuesday\", \"wednesday\", \"thursday\", \"friday\", \"saturday\", \"sunday\"];\nvar a = days.indexOf(day1);\nvar b = days.indexOf(day2);\nprint((b - a) !== 1 && (a===b ||(a + 2) % 7 >= b || (a + 3) % 7 >= b) && \"YES\" || \"NO\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c6aeccb1b5699cd8cf538bd2aad8fc80", "src_uid": "2a75f68a7374b90b80bb362c6ead9a35", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "const input = Number(readline());\nprint([15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7][input]);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8bfcad4c8a695bdec3bedb56678bab26", "src_uid": "879ac20ae5d3e7f1002afe907d9887df", "difficulty": null} {"lang": "JavaScript", "source_code": "var month_name = readline();\nvar result_month = parseInt(readline());\nvar obj = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\nprint(obj[obj.indexOf(month_name)+result_month+1])", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "fa93b97d99108764d73ccb33916004f4", "src_uid": "a307b402b20554ce177a73db07170691", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "function main(){\n\tvar numbers = readline().split(\" \").map(Number);\n\t\n\tvar num = numbers[0];\n\tvar kthdiv = numbers[1];\n\tvar divs = [];\n\n\tif(numbers[1] === 1)\n\t\treturn 1;\n\n\tif(numbers[0] === 1 && numbers[1] !== 1)\n return -1;\n\n\tdivs.push(1);\n\n\tvar numDiv = 1;\n\n\tfor(var i = 2; i <= Math.sqrt(num); i++)\n\t\tif(num % i === 0 && ++numDiv === kthdiv)\n\t\t\treturn i;\n\t\telse if(num % i === 0)\n\t\t\tdivs.push(i);\n\n\n\tfor(i = divs.length-1; i >= 0; i--)\n if(num / divs[i] !== divs[i])\n divs.push(num/divs[i]);\n \n\tif(kthdiv <= divs.length)\n\t\treturn divs[kthdiv-1];\n\n\treturn -1;\n}\n\nprint(main());", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "4e7a06de69c5dc40ee2a6fd71d6f7fdb", "src_uid": "6ba39b428a2d47b7d199879185797ffb", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "'use strict'\n/*\n//var a=4;\nvar a=parseInt(readline());\nvar max=a+1;\nvar max_1=a;\nfor(var i=1;i<=Math.sqrt(a);i++){\n if(a%i==0){\n if((i+a/i)1){\n a=a-1;\n for(var i=1;i<=Math.sqrt(a);i++){\n if(a%i==0){\n if((i+a/i)a){\n p=i;\n break;\n }else if(i*i==a){\n p=i;\n print(a);\n break;\n }\n}\nif(p*p!==a){\n for(var i=1;i<=p;i++){\n if(i*p>(p-1)*(p-1)){\n if(a>=p*(i-1)&&a<=p*i){\n print(p+i);\n break;\n }\n }\n }\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "09d9d5447e1137b3d4f781a4eb0152a1", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\nrl.on('line', (inputString) => {\n let numberOfSquares = parseInt(inputString);\n rl.close();\n console.log(findTheNumberOfLinesForLady(numberOfSquares));\n});\n\nfunction findTheNumberOfLinesForLady(forTheNumberOfSquaress) {\n let a = Math.sqrt(forTheNumberOfSquaress);\n let b = Math.trunc(a);\n if (a == b) return (a + a);\n if (b * (b + 1) >= forTheNumberOfSquaress) return b + b + 1;\n return b + b + 2;\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "9e8e26e10360d4bd9bd6c6e88803b376", "src_uid": "eb8212aec951f8f69b084446da73eaf7", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "const input = readline().split(\" \").map(x => Number(x));\nconst n = input[0];\nconst numbers = input.slice(1, 1 + n);\nprint(numbers.sort((a, b) => a > b ? 1 : a < b ? -1 : 0).join(\" \"));\nwhile (performance.now() < 1500) { }\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ed0e8f27e19ed231b7d005dbbf1b128d", "src_uid": "29e481abfa9ad1f18e6157c9e833f16e", "difficulty": 1900.0} {"lang": "JavaScript", "source_code": "setTimeout(function() { print(readline().split(' ').slice(1).map(function(x) { return parseInt(x); }).sort(function(a, b) { return a - b; })); }, 1000);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c6493f6a227a86d88b240047d2338102", "src_uid": "29e481abfa9ad1f18e6157c9e833f16e", "difficulty": 1900.0} {"lang": "JavaScript", "source_code": "function solve(){\n var a = readline();\n var last = 1;\n var res = 0;\n for(var i = 1; i < a.length; i++){\n if(a[i] != a[i-1]){\n if(last % 2 == 0) ++res;\n last = 1;\n } else {\n last++;\n }\n }\n if(last % 2 == 0) ++res;\n print(res);\n}\nsolve();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "867fcc4fa88bbedd4d141e942e5929d2", "src_uid": "8b26ca1ca2b28166c3d25dceb1f3d49f", "difficulty": null} {"lang": "JavaScript", "source_code": "var arr = readline().split('');\nvar res = 0;\nwhile(arr.length) {\n var curr = arr.shift();\n for(var i = 0; i < 4; i++) {\n if (arr[0] === curr) {\n arr.shift();\n } else {\n break;\n }\n }\n res++;\n}\nprint(res);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "bf02dd7326213dd27ce70ce06afb27e9", "src_uid": "5257f6b50f5a610a17c35a47b3a0da11", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "\n// 151A \u0413\u0430\u0437\u0438\u0440\u043e\u0432\u043a\u043e\u043f\u0438\u0442\u0438\u0435 \n\n// var n = parseInt(readline());\n\nvar input_line = readline().split(' ').map(Number);\n\nvar n = input_line[0];\nvar k = input_line[1];\nvar l = input_line[2];\nvar c = input_line[3];\nvar d = input_line[4];\nvar p = input_line[5];\nvar nl = input_line[6];\nvar np = input_line[7];\n\nvar gaz = k * l / nl / n;\nvar lame =c * d / n;\nvar sol = p / np / n;\n\nvar count = Math.floor(min(gaz, lame, sol));\n\nprint(count);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "4e89ab414aa6da8e08ebefecc51a76a5", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const input = [];\n\nconst RL = require('readline').createInterface({\n input : process.stdin,\n output : process.stdout\n});\n \nRL.on('line', line => input.push(line));\n\nRL.on('close', () => {\n const [n, k, l, c, d, p, nl, np] = input[0].split(' ').map(x => parseInt(x));\n let botl = parseInt((k * l) / nl);\n let lim = d; let s = parseInt(p / np);\n\n console.log( parseInt(Math.min(botl, lim, s) / n) );\n});", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0fcfbc059359c585ae241d994134d35b", "src_uid": "67410b7d36b9d2e6a97ca5c7cff317c1", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "print(function(x, t, a, b, da, db) {\n\tif (x === 0) return 'YES';\n\tfor (var i = 0; i < t; i++) {\n\t\tif (a - da * i === x) return 'YES';\n\t\tif (b - db * i === x) return 'YES';\n\t}\n\n\tfor (var i = 0; i < t; i++)\n\t\tfor (var j = 0; j < t; j++)\n\t\t\tif (a - da * i + b - db * j === x) \n\t\t\t\treturn 'YES';\n\n\treturn 'NO';\n} .apply(0, readline().split(' ').map(Number)));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "9b0810b32cce893bbf708a217583e078", "src_uid": "f98168cdd72369303b82b5a7ac45c3af", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var n = readline();\nvar two = \"8\"; var one = \"4 6 9 0\".split(\" \");\nvar res = \"\";\n\t\nif (n%2==0) {\n\tfor(var i=0; i 0 && g > 0) || (r > 1 && b > 0) || (g > 1 && b > 0) || (!r > 0 && !g > 0))\n res += \"B\";\n\tif ((r > 0 && b > 0) || (r > 1 && g > 0) || (b > 1 && g > 0) || (!r > 0 && !b > 0))\n res += \"G\";\n\tif ((b > 0 && g > 0) || (b > 1 && r > 0) || (g > 1 && r > 0) || (!b > 0 && !g > 0))\n res += \"R\";\n print(res);\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "46fcca38b073524159ab344782296dc0", "src_uid": "4cedd3b70d793bc8ed4a93fc5a827f8f", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "\n\n\nfunction main() {\n\n var n = readline();\n\n var arr = readline().split(' ');\n\n var sum = 0;\n var allZeros = true;\n\n //caculate the sum of array\n for(var i = 0; i < n; i++){\n sum += arr[i];\n }\n\n //test if all elements in array are zeros\n for(var j = 0; j < n; j++){\n if(arr[j] == 0){\n allZeros = false;\n }\n }\n\n if(sum != 0){\n print('YES');\n print('1');\n print('1'+ ' ' + n);\n } else if(allZeros){\n print('NO');\n } else {\n print('YES');\n var k = 0;\n while (arr[k] == 0){\n k++;\n }\n print('2');\n print((k + 1) + ' ' + n);\n\n }\n\n}\n\nmain();\n\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "645fda72dc6d7daf44d0cc8ebbee98c5", "src_uid": "3a9258070ff179daf33a4515def9897a", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "/**\n * Created by Meiling on 1/12/17.\n */\n\nfunction main() {\n\n var n = readline();\n\n var arr = readline().split(' ');\n\n var sum = 0;\n var allZeros = true;\n\n //caculate the sum of array\n for(var i = 0; i < n; i++){\n sum += arr[i];\n }\n\n //test if all elements in array are zeros\n for(var j = 0; j < n; j++){\n if(arr[j] == 0){\n allZeros = false;\n }\n }\n\n if(sum != 0){\n console.log('YES');\n console.log('1');\n console.log('1'+ ' ' + n);\n } else if(allZeros){\n console.log('NO');\n } else {\n console.log('YES');\n var k = 0;\n while (arr[k] == 0){\n k++;\n }\n console.log('2');\n console.log((k + 1) + ' ' + n);\n\n }\n\n}\n\nmain();\n\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d03eea4a9fcf73b1fa57f2c93a0465cf", "src_uid": "3a9258070ff179daf33a4515def9897a", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "\nfunction main() {\n var n = Number(readline());\n var s = readline().split(' ').map(Number);\n var sum = s.reduce((prev, cur) => prev + cur, 0);\n var allZeros = true;\n for(var k=0;k= n; i = 0 <= n ? ++_i : --_i) {\n for (j = _j = 1; 1 <= k ? _j <= k : _j >= k; j = 1 <= k ? ++_j : --_j) {\n if (i - j >= 0) {\n withoutConstraint[i] += withoutConstraint[i - j];\n if (j >= d) {\n withConstraint[i] += withoutConstraint[i - j];\n } else {\n withConstraint[i] += withConstraint[i - j];\n }\n withoutConstraint[i] %= 1000000007;\n withConstraint[i] %= 1000000007;\n }\n }\n }\n return withConstraint[n];\n };\n\n '#node.js 10.x\\n\\nreadline = require \\'readline\\'\\nreadline.createInterface(\\n input: process.stdin\\n output: process.stdout\\n terminal: false\\n).on \\'line\\', (str) ->\\n str = str.split \\' \\'\\n\\n n = Number str[0]\\n k = Number str[1]\\n d = Number str[2]\\n\\n console.log compute n, k, d';\n\n 'd8';\n\n str = readline().split(' ');\n\n n = Number(str[0]);\n\n k = Number(str[1]);\n\n d = Number(str[2]);\n\n print(compute(n, k, d));\n\n}).call(this);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c4cdc984eb4989ee8e4028889d1c012a", "src_uid": "894a58c9bba5eba11b843c5c5ca0025d", "difficulty": 1600.0} {"lang": "Node.js", "source_code": "'use strict';\n \nprocess.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n/**\n3 4\n##..\n##..\n...#\n\n\n**/\n\nfunction gcd(a, b) {\n if (!b) {\n return a;\n }\n\n return gcd(b, a % b);\n};\n\nfunction main() {\n let n = parseInt(readline());\n\n let string = 'codeforces';\n\n let s = new Array(n-1).fill('s').join(\"\");\n\n console.log(string + s);\n \n\n}\n\n// function solve() {\n// let [n, m] = readline().split(\" \").map(Number);\n// let a = readline().split(\"\");\n\n// let findIndex = a.findIndex(\"1\");\n\n// let even = false;\n// let zero = false;\n\n// if(findIndex === -1) {\n// zero = true;\n// } else if(findIndex % 2 === 0) {\n// even = true;\n// }\n\n// let total = 0;\n \n// if(even) {\n// for(let i=0;i {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => {\n return string.trim();\n });\n \n main(); \n});\n \nfunction readline() {\n return inputString[currentLine++];\n}\n/**\n6\n6 1\n100010\n6 2\n000000\n5 1\n10101\n3 1\n001\n2 2\n00\n1 1\n0\n\n\n**/\n\nfunction gcd(a, b) {\n if (!b) {\n return a;\n }\n\n return gcd(b, a % b);\n};\n\nfunction main() { \n let n = parseInt(readline());\n\n // for(let i=0;i count && i < n) {\n if(i === 1 && a[i-1] === '0' && a[i] === '0') {\n count++;\n a[i-1] = \"1\";\n continue;\n }\n\n if(a[i + 1] === n) {\n if(a[i] === \"0\" && a[i-1] === \"0\") {\n count++;\n }\n\n continue;\n }\n\n if(a[i] === \"0\" && a[i-1] === \"0\" && a[i+1] === \"0\") {\n count++;\n a[i] = \"1\";\n }\n\n i++;\n }\n\n console.log(count);\n}\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3107acf9d27c61232b14908a00281dc5", "src_uid": "8001a7570766cadcc538217e941b3031", "difficulty": 1500.0} {"lang": "Node.js", "source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n\nlet inputString = '';\nlet currentLine = 0;\n\nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n\nprocess.stdin.on('end', _ => {\n inputString = inputString.trim().split('\\n').map(string => string.trim());\n\n main();\n});\n\nfunction readLine() {\n return inputString[currentLine++];\n}\n\nconst s2i = s => parseInt(s, 10);\n\nfunction main() {\n const k = BigInt(readLine());\n let max = 1n;\n while (max ** 10n < k) max++;\n let nMax = 10n;\n let nMin = 0n;\n while (max ** (nMax - 1n) * (max - 1n) ** (nMin + 1n) >= k) {\n nMax--;\n nMin++;\n }\n\n let result = '';\n const codeforces = 'codeforces'\n for(let i = 0; i < 10; i++) {\n const reps = i < nMax ? max : max - 1n;\n for (let j = 0; j < reps; j++) {\n result += codeforces.charAt(i);\n }\n }\n\n console.log(result)\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0399a439673f88d02499e75d98518d2a", "src_uid": "8001a7570766cadcc538217e941b3031", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": ";(function () {\n\t\n\tvar n = +readline();\n\n\tif (n < 3) {\n\t\tprint(-1);\n\t\treturn;\n\t}\n\n\tvar str = '';\n\tfor (var i = 0; i < n; i++) {\n\t\tstr += (n-i);\n\t}\n\n\tprint(str);\n\n}).call(this);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "766ab06bf56d4829b12acfa0c7e3ce15", "src_uid": "fe8a0332119bd182a0a5b7758716317e", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "\nfunction tokenize(s) {\n\treturn s.split(/\\s+/);\n}\n\nfunction tokenize_integers(s) {\n\tvar tokens = tokenize(s);\n\tfor (var i = 0; i < tokens.length; i++) {\n\t\ttokens[i] = parseInt(tokens[i], 10);\n\t};\n\treturn tokens;\n}\nfunction nextArray() {\n\treturn tokenize_integers(readline());\n}\nfunction nextInt() {\n\treturn parseInt(readline());\n\t//\treturn tokenize_integers(readline())[0];\n}\nfunction main() {\n\tvar data = nextArray();\n\tvar c = data[0], d = data[1];\n\tdata = nextArray();\n\tvar n = data[0], m = data[1];\n\tvar k = nextInt();\n\tvar needWinners = Math.max(0, n * m - k);\n//\tprint(needWinners);\n\tvar ret = -1;\n\tfor(var x = 0; x <= 10000; x++) {\n\t\tvar y = needWinners - x * n ;\n\t\ty = Math.max(y, 0);\n\t\tvar tmp = c * x + y * d;\n//\t\tif(x < 10)print(tmp);\n\t\tif(ret == -1 || tmp < ret) {\n\t\t\tret = tmp;\n\t\t}\n\t}\n\tprint(ret);\n}\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "71d58c8588c0ebe2bf54236334bfaeab", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "function main() {\n\n var arr1 = readline().split(' ').map(Number);\n var c = arr1[0], d = arr1[1];\n var arr2 = readline().split(' ').map(Number);\n var n = arr2[0], m = arr2[1];\n var k = Number(readline());\n\n var winners = Math.max(0, n * m - k);\n\n var problems = -1;\n\n for (var x = 0; x <= 10000; x++) {\n var y = winners - x * n;\n y = Math.max(y, 0);\n var temp = c * x + y * d;\n\n if (problems == -1 || temp < problems) {\n problems = temp;\n }\n }\n print(problems);\n \n\n}\n\nmain();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8c987ac3639828c786f5b85b67916db1", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "if (!this.readline) print = console.log, readline = require('./readline');\n\nfunction readNums() {\n\treturn readline().split(' ').map(Number);\n}\n\n\nprint(function(cb, ca, na, nb, k) {\n\tnb -= ~~(k / na);\n\tk %= na;\n\n\tif (nb <= 0) {\n\t\treturn 0;\n\t}\n\treturn (Math.min(nb * cb, Math.min((na - k) * ca + (nb - 1) * cb, (na - k) * ca + (nb - 1) * na * ca)));\n}.apply(0, readNums().concat(readNums()).concat(readNums())));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8f79cbb91d596a0f2f91d85d1392d705", "src_uid": "c6ec932b852e0e8c30c822a226ef7bcb", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "print(function(a, c) {\n\n\ta = a.toString(3);\n\tc = c.toString(3);\n\tvar ans = [];\n\tfor (var i = a.length-1, j = c.length-1; i >= 0 || j >= 0; i--, j--)\n\t\tans.push((3 + (+c[j] || 0) - (+a[i] || 0)) % 3);\n\n\treturn parseInt(ans.reverse().join(''), 3);\n\n} .apply(0, readline().split(' ').map(Number)));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "16ae16ea0680b17a3943bab3cdd9fc6f", "src_uid": "5fb635d52ddccf6a4d5103805da02a88", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "function main(n,m) {\n\n var ans = 2;\n if(n > 1){\n for(var i = 1 ; i < n ; i++)ans *= 2;\n }\n ans = m%ans;\n print(ans);\n}\n\n//\nvar n = parseInt(readline());\nvar m = parseInt(readline());\n\nmain(n,m);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8140c4cc0ef965a5070e92b7808ad45b", "src_uid": "c649052b549126e600691931b512022f", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "'use strict';\n\nvar n = parseInt(readline());\nvar m = parseInt(readline());\nvar out = m % (Math.pow(2,n));\nprint(out);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d589976869019be18b6395adf56727c3", "src_uid": "c649052b549126e600691931b512022f", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var n = readline();\nvar m = readline();\n\nif(n>=27)\n print(m);\nelse\n print(m%(1< {\n lines.push(input);\n})\nrl.on('close', () => {\n// (function() {\n // const lines = require('fs').readFileSync('test.in', 'utf8').split('\\n')\n let l = 0;\n let t = 1//+lines[l++]\n for (let i = 0; i < t; i++) {\n const n = +lines[l++]\n console.log(solve(n))\n }\n// })()\n})\n\nfunction solve(n) {\n let ans = 6\n const base = 4\n // let count = 1\n let prev = 4\n for (let i = 2; i <= n; i++) {\n // base = mul(base, 4)\n\n // count = count * 2\n // ans = mul(ans, pow(base, count)\n\n prev = mul(prev, prev)\n ans = mul(ans, prev)\n }\n return ans\n}\nfunction add(a, b) {\n return (a + b) % (1e9 + 7)\n}\nfunction mul(a, b) {\n let r = 0\n let base = a\n while (b) {\n if (b & 1) {\n r = add(r, base)\n }\n b >>= 1\n base = add(base, base)\n }\n return r\n}\nfunction pow(a, b) {\n let r = 1\n let base = a\n while (b) {\n if (b & 1) {\n r = mul(r, base)\n }\n b >>= 1\n base = mul(base, base)\n }\n return r\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "611022f10fd68b565c0b5241ff82f6a2", "src_uid": "5144b9b281ea4087d8334d91c3c8bda4", "difficulty": 1300.0} {"lang": "Node.js", "source_code": "process.stdin.setEncoding('utf8');\n\nprocess.stdin.on('readable', () => {\n let input = process.stdin.read();\n input = input.trim();\n input = input.split('\\n');\n\n main(input);\n});\n\nfunction main(input) {\n let ratings = Array.from(new Set(input[1].split(' ')));\n let final = [];\n\n for (let i = 0; i < parseInt(input[0].split(' ')[1]); i++) {\n final.push(input.slice(2).indexOf(ratings[i]) + 1);\n }\n\n if (final.includes(0)) {\n console.log('NO');\n process.exit(0);\n }\n\n console.log(`YES\\n${final.join(' ')}`);\n process.exit(0);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "88208f8030fdf131f2e988f2714c1c52", "src_uid": "5de6574d57ab04ca195143e08d28d0ad", "difficulty": 800.0} {"lang": "Node.js", "source_code": "process.stdin.setEncoding('utf8');\n\nprocess.stdin.on('readable', () => {\n let input = process.stdin.read();\n input = input.trim();\n input = input.split('\\n');\n\n main(input);\n});\n\nfunction main(input) {\n let ratings = Array.from(new Set(input[1].split(' ')));\n let final = [];\n\n for (let i = 0; i < parseInt(input[0].split(' ')[1]); i++) {\n final.push(input[1].split(' ').indexOf(ratings[i]) + 1);\n }\n\n if (final.includes(0)) {\n console.log('NO');\n process.exit(0);\n }\n\n console.log(`YES\\n${final.join(' ')}`);\n process.exit(0);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "44224965c91e9a0f24a0486bc41412e9", "src_uid": "5de6574d57ab04ca195143e08d28d0ad", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "\n var tmp = readline().split(' ').map(x => parseInt(x));\n var n = tmp[0];\n var k = tmp[1];\n\n var a = readline().split(' ').map(x => parseInt(x));\n\n var e = [];\n for(var i = 0; i < n; i += 1) {\n e[a[i]] = 1;\n }\n var res = [];\n for(var i = 0; i <= 100; i += 1) {\n if(e[i] === 1) {\n res.push(a.indexOf(i) + 1);\n }\n }\n if(res.length < k) {\n print('NO');\n } else {\n print('YES');\n print(res.slice(0, k).join(' '));\n }", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "4da315c815e136313ce22016873e6093", "src_uid": "5de6574d57ab04ca195143e08d28d0ad", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "print(function(a, b) {\n\treturn +a+ +b.split('').reverse().join('');\n}.apply(0, readline().split(' ')));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "bd06b843714e7a0a3d9465cb5a317bdb", "src_uid": "69b219054cad0844fc4f15df463e09c0", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "function hasBlackItem(line) {\n var count = 0;\n for(var i = 0; i < line.length; i++) {\n if(line[i] === 'B') {\n count++;\n }\n }\n if(count < 8) {\n return count;\n }\n else {\n return 1;\n }\n}\nvar count = 0;\nvar lineres = 0;\nwhile((lineres = hasBlackItem(readline())), count += lineres, lineres > 1);\nwhile((lineres = readline())) {\n lineres = hasBlackItem(lineres);\n if(lineres === 1) {\n count++;\n }\n}\nprint(count);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "180efb4eaedfd5f96b089ed8d1351f14", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "const readline = require(\"readline\");\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n\nvar answer = 0;\nvar counter = 0;\nvar check = true;\n\nrl.on(\"line\", input => {\n \n let temp = input.match(/B/g);\n \n counter =(temp!=null)? temp.length : 0;\n\n if (counter == 8) {\n answer++;\n } \n else if (check && counter > 0) {\n answer += counter;\n check = false;\n }\n \n\n \n}).on(\"close\", () => {\n console.log(answer);\n });\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f57810f077578e23cc820370b0495be1", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nvar ans = 0,\n metColumn = false;\n\n\nrl.on('line', (s) => {\n\n if (s == 'BBBBBBBB') \n ans++;\n else if (!metColumn) {\n //console.log(\"inside else if metColumn= &s\",metColumn)\n let helper= s.match(/B/g);\n if(helper!=null) \n ans += helper.length;\n metColumn = true;\n }\n\n}).on('close', () => {\n console.log(ans);\n rl.close();\n\n\n});", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "5f4b4e6a50358e452c6a1fd8ac0b8a14", "src_uid": "8b6ae2190413b23f47e2958a7d4e7bc0", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var print = require('./print');\nvar readline = require('./readline');\n\nvar n = parseInt(readline());\n\nvar v = [[31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31],\n [31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,29,31,30,31,30,31,31,30,31,30,31],\n [31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,29,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31],\n [31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,29,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31],\n [31,28,31,30,31,30,31,31,30,31,30,31, 31,29,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31],\n [31,29,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31, 31,28,31,30,31,30,31,31,30,31,30,31]]\n\n\nvar args = readline().split(' ');\nvar highCount = 0;\nfor(var i=0;i {\n return arr.split(splitter).map(num => parseInt(num));\n },\n insterAt: (arr, idx, item) => {\n const newArray = [...arr];\n newArray.splice(idx, 0, item);\n return newArray;\n },\n sortAscending: (arr) => {\n return arr.sort((a, b) => a - b);\n },\n sortDescending(arr) {\n return arr.sort((a, b) => b - a);\n }\n}\n\nconst readline = require('readline').createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\n// multi line input\nreadline.on('line', line => {\n lines.push(line);\n});\n\nreadline.on('close', line => {\n let eggs = parseInt(lines[0]);\n let colorsSequence = ['R', 'O', 'Y', 'G', 'B', 'I', 'V'];\n let extraColors = eggs % 7;\n let cycles = Math.floor(eggs / 7);\n\n // Repeate complete cycles\n if (cycles > 1) for (let jj = 1; jj < cycles; colorsSequence.push(...colorsSequence), jj++);\n\n // Add extra colors in the right position\n for (let ii = 0; ii < extraColors; ii++) colorsSequence = helpers.insterAt(colorsSequence, ii + 4, colorsSequence[ii]);\n\n\n console.log(colorsSequence.join(''))\n\n\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "50f9ad9ece42d8d0776706e5bbe90fc8", "src_uid": "dc3817c71b1fa5606f316e5e94732296", "difficulty": 1200.0} {"lang": "Node.js", "source_code": "'use strict'\n\nconst {EOL} = require('os')\n\nlet ipt = ''\nprocess.stdin.on('data', s => ipt += s)\nprocess.stdin.on('end', () => {\n const n = +ipt.split(EOL).slice(0, -1)[0]\n let o = 'ROY'\n let r = (n - 3) / 4 | 0\n for (let i = 0; i < r; i++) o += 'GBIV'\n o += 'GBIV'.slice(0, (n - 3) % 4)\n console.log(o)\n})", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "62805967195af3e7ee6c31892b4d1555", "src_uid": "dc3817c71b1fa5606f316e5e94732296", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "const memo = {};\n\nfunction resolve(k, arr, n) {\n if (memo[arr.join('')] !== undefined) {\n return memo[arr.join('')];\n }\n if (parseInt(arr[0], 10) % 2 === 0 || parseInt(arr[k - 1], 10) % 2 === 0) {\n memo[arr.join('')] = false;\n return false;\n } else {\n if (k % 2 !== 0 && n % 2 !== 0) {\n memo[arr.join('')] = true;\n return true;\n } else {\n for (var i = 0; i < k; i += 2) {\n if (parseInt(arr[i], 10) % 2 !== 0) {\n if (resolve(arr.slice(i + 1).length, arr.slice(i + 1), n + 1)) {\n memo[arr.join('')] = true;\n return true;\n }\n }\n }\n\n for (var i = k - 1; i >= 0; i -= 2) {\n if (parseInt(arr[i], 10) % 2 !== 0) {\n if (resolve(arr.slice(0, i).length, arr.slice(0, i), n + 1)) {\n memo[arr.join('')] = true;\n return true;\n }\n }\n }\n memo[arr.join('')] = false;\n return false;\n }\n }\n}\n\nconst k = parseInt(readline(), 10);\nconst arr = readline().split(' ');\n\nconst result = resolve(k, arr, 1);\n\nprint(result ? 'Yes' : 'No' + '\\n');", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "40ae4d5603dafae0e811cf1702260f9c", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "function resolve(stack1, stack2) {\n var flag = true;\n while (stack1.length !== 0 || stack2.length !== 0) {\n var arr = stack1.pop();\n flag = true;\n if (!arr) {\n flag = false;\n arr = stack2.pop();\n }\n var k = arr.length;\n if (parseInt(arr[0], 10) % 2 !== 0 && parseInt(arr[k - 1], 10) % 2 !== 0) {\n if (k % 2 !== 0 && flag) {\n return true;\n } else {\n for (var i = 0; i < k; i += 2) {\n if (parseInt(arr[i], 10) % 2 !== 0) {\n if (flag) {\n stack2.push(arr.slice(i + 1));\n } else {\n stack1.push(arr.slice(i + 1));\n }\n }\n }\n }\n }\n }\n return false;\n}\n\nconst k = parseInt(readline(), 10);\nconst arr = readline().split(' ');\n\nconst result = resolve([arr], []);\n\nprint(result ? 'Yes' : 'No' + '\\n');\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "445cf627e0e434f7beb4982f2c0112e0", "src_uid": "2b8c2deb5d7e49e8e3ededabfd4427db", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "const input = Number(readline());\nprint([\"YES\", \"NO\", \"YES\", \"YES\", \"YES\", \"YES\", \"YES\", \"NO\", \"YES\", \"NO\", \"NO\", \"NO\", \"YES\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"YES\", \"NO\", \"YES\", \"YES\", \"YES\", \"YES\", \"YES\", \"NO\", \"YES\", \"NO\", \"YES\", \"NO\", \"YES\", \"YES\", \"YES\", \"YES\", \"YES\", \"NO\", \"YES\", \"NO\", \"YES\", \"NO\", \"YES\", \"YES\", \"YES\", \"YES\", \"YES\", \"NO\", \"YES\", \"NO\", \"YES\", \"NO\", \"YES\", \"YES\", \"YES\", \"YES\", \"YES\", \"NO\", \"YES\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"YES\", \"NO\", \"YES\", \"YES\", \"YES\", \"YES\", \"YES\", \"NO\", \"YES\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\", \"NO\"][input]);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3ec6bc5446363838d13aa819edae2842", "src_uid": "821529a4644b74483bcdf80fc318d1f8", "difficulty": null} {"lang": "JavaScript", "source_code": "function trim(s) {\n\treturn s.replace(/^\\s+|\\s+$/gm, '');\n}\n\nfunction tokenize(s) {\n\treturn trim(s).split(/\\s+/);\n}\n\nfunction tokenizeIntegers(s) {\n\tvar tokens = tokenize(s);\n\tfor (var i = 0; i < tokens.length; i += 1) {\n\t\ttokens[i] = parseInt(tokens[i], 10);\n\t};\n\treturn tokens;\n}\n\nfunction numDivisors(x) {\n\tvar count = 0;\n\tfor (var i = 1; i*i <= x; ++i) {\n\t\tif (x%i == 0) {\n\t\t\t++count;\n\t\t\tif (i*i != x) {\n\t\t\t\t++count;\n\t\t\t}\n\t\t}\n\t}\n\treturn count;\n}\n\nfunction main() {\n\tvar data = tokenizeIntegers(readline()),\n\t\ta = data[0], b = data[1], c = data[2],\n\t\tdivisors = {}, count = 0;\n\tfor (var i = 1; i <= a; ++i) {\n\t\tfor (var j = 1; j <= b; ++j) {\n\t\t\tfor (var k = 1; k <= c; ++k) {\n\t\t\t\tvar x = i*j*k;\n\t\t\t\tif (divisors[x] === undefined) {\n\t\t\t\t\tdivisors[x] = numDivisors(x);\n\t\t\t\t}\n\t\t\t\tcount = (count+divisors[x]) % 1073741824;\n\t\t\t}\n\t\t}\n\t}\n\tprint(count);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "013853fbd0e46b1dedbd82c19858a885", "src_uid": "4fdd4027dd9cd688fcc70e1076c9b401", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "'use strict'\n// \n// http://codeforces.com/contest/907/problem/B\n\nlet board = [];\n\nfor (let i = 0; i < 11; i += 1) {\n const line = readline().replace(/\\s/g, '').split('');;\n if (line.length > 0) {\n board.push(line);\n }\n}\n\nconst arr = readline().split(' ').map(x => parseInt(x));\nconst row = arr[0];\nconst col = arr[1];\n\nconst markMatrix = (v, h) => {\n let anywhere = true;\n\n for (let rowi = v * 3; rowi < (v+1) * 3; rowi += 1) {\n for (let coli = h * 3; coli < (h+1) * 3; coli += 1) {\n if (board[rowi][coli] === '.') {\n anywhere = false;\n board[rowi][coli] = '!'\n }\n }\n }\n\n if (anywhere) {\n board = board.map(row => row.map(char => char === '.' ? '!' : char));\n }\n}\n\nconst getMatrixPosition = (row, col) => {\n return [(row - 1) % 3, (col - 1) % 3];\n}\n\nconst pos = getMatrixPosition(row, col);\n\nmarkMatrix(pos[0], pos[1])\n\nlet result = [];\nboard.forEach((row, idx) => {\n let s = row.join('');\n s = s.slice(0, 3) + ' ' + s.slice(3, 6) + ' ' + s.slice(6, 9);\n if (idx !== 0 && idx % 3 === 0) {\n print('');\n }\n print(s);\n})\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "5f311ce8e64267851f51e830a5bc21a1", "src_uid": "8f0fad22f629332868c39969492264d3", "difficulty": 1400.0} {"lang": "Node.js", "source_code": "\"use strict\";\nvar input = '';\nvar inputResolve;\nvar inputPromise = new Promise(resolve => inputResolve = resolve);\nprocess.stdin.on('data', c => input += c);\nprocess.stdin.on('end', () => {\n inputResolve();\n});\n(async () => {\n // var time = Date.now();\n await inputPromise;\n var inputs = input.split(/\\r?\\n/);\n var [n, h] = inputs[0].split(' ').map(v => +v);\n var f = [];\n for (let i = 0; i <= n; i++) {\n f[i] = [];\n for (let j = 0; j <= n; j++)\n f[i][j] = BigInt(0);\n }\n f[0][0] = BigInt(1);\n f[1][1] = BigInt(1);\n for (let i = 2; i <= n; i++) {\n for (let j = 1; j <= i; j++) {\n for (let z = 1; z <= i; z++) {\n for (let j2 = 0; j2 <= j - 1; j2++) {\n if (j2 < j - 1)\n f[i][j] = f[i][j] + f[z - 1][j2] * f[i - z][j - 1];\n else\n f[i][j] = f[i][j] + f[z - 1][j - 1] * f[i - z].slice(0, j).sum();\n }\n }\n }\n }\n console.log(f[n].slice(h).sum().toString());\n})();\nObject.defineProperty(Object.prototype, '$k', {\n value: function () { return Object.keys(this); }\n});\nObject.defineProperty(Object.prototype, '$v', {\n value: function () { return Object.values(this); }\n});\nObject.defineProperty(Object.prototype, '$kv', {\n value: function () { return Object.entries(this); }\n});\nArray.prototype.sum = function (fn) { return this.reduce((p, v) => p + (fn ? fn(v) : v), BigInt(0)); };\nArray.prototype.uniq = function (fn) {\n var set = new Set();\n return this.filter(v => {\n var newValue = !set.has(fn ? fn(v) : v);\n set.add(fn ? fn(v) : v);\n return newValue;\n });\n};\nArray.prototype.toObj = function (fn) {\n return this.map(v => fn(v)).reduce((p, v) => {\n p[v[0]] = v[1];\n return p;\n }, {});\n};\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f30bd2e31fa5676745be43e7a4c46bc1", "src_uid": "faf12a603d0c27f8be6bf6b02531a931", "difficulty": 1900.0} {"lang": "JavaScript", "source_code": "var arr = readline().split(\" \");\nvar n = +arr[0];\nvar k = +arr[1];\n\nvar arr = readline().split(\" \").map(function(v,i) {return {v:+v,i:i};});\narr.sort(function(a,b) {return a.v-b.v;});\n\nvar res = [];\nfor(var i = 0; i < n; i++) {\n k-=arr[i].v;\n if(k>=0)\n res.push(arr[i].i);\n else\n break;\n}\n\nprint(i);\nprint(res.join(\" \"));\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ee9eb777a9400f72269f3258037feb8e", "src_uid": "dbb164a8dd190e63cceba95a31690a7c", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "readline();\nvar string = readline();\nvar loopCount = Math.floor(string.length / 2);\nvar copyMax = 0;\nfor (var i = 1; i <= loopCount; i++) {\n if (string.slice(0, i) === string.slice(i, i * 2)) {\n copyMax = i;\n }\n}\nif (copyMax) {\n print(string.length - copyMax + 1);\n} else {\n print(string.length);\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "19bf0548798fab4efdf8f04afe36e9ba", "src_uid": "ed8725e4717c82fa7cfa56178057bca3", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var nums = readline().split(' ').map(function(x) { return parseInt(x); });\nvar cel = ((nums[0] -nums[2]) + (nums[1] - nums[2]) + nums[2])\nprint(nums[3] > cel ? nums[3] - cel : -1 )", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "1eaaf280162df8741fca28232961fe46", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var distribution = readline().split(' ').map(Number);\nvar both = distribution[2];\n\nvar result = distribution[3] - distribution[0] - distribution[1] + both;\nif(result <= 0) {\n print(-1);\n} else {\n print(result);\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "14782450c2399b14f0f5871cbe6fe0b9", "src_uid": "959d56affbe2ff5dd999a7e8729f60ce", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var ints = function() {\n\treturn readline().split(' ').map(function(x) {\n\t\treturn parseInt(x)\n\t})\n}\n\nvar numbers = ints()\n\tk = numbers[0],\n\ta = numbers[1],\n\tb = numbers[2],\n\tinvalid = (a < k && b < k) || (a < k && b % k > 0) || (b < k && a % k > 0)\n\nprint(invalid ? -1 : Math.floor(a / k) + Math.floor(b / k))\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d5696fec048fa677fb5bcca24231ee56", "src_uid": "6e3b8193d1ca1a1d449dc7a4ad45b8f2", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var n = +readline(),\ninput = readline().split(\" \"), min1 = +input[0], max1 = +input[1],\ninput = readline().split(\" \"), min2 = +input[0], max2 = +input[1],\ninput = readline().split(\" \"), min3 = +input[0], max3 = +input[1];\nvar i, j, k;\n\ncycle:\nfor(i = max1; i >= min1; i--){\n\n\tif((n - i) < (min2 + min3)){\n\t\tcontinue;\n\t}\n\t\n\tj = (n-i > max2) ? max2 : n-i;\n\tfor( ; j >= min2; j--){\n\t\tif((n - i - j) < min3){\n\t\t\tcontinue;\n\t\t}\n\n\t\tk = n - i - j;\n\n\t\twrite(i + \" \" + j + \" \" + k);\n\n\t\tbreak cycle;\n\t}\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3a6dff49ef9b99d994178946bed2e389", "src_uid": "3cd092b6507079518cf206deab21cf97", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "(function () {\n var read = {\n number: function () {\n return +readline();\n },\n arr: function (divider) {\n return readline().split(divider ? divider : '');\n },\n arrNumber: function (divider) {\n return readline()\n .split(divider ? divider : '')\n .map(item => +item);\n }\n }\n\n var n = read.arr();\n\n var res = 10;\n for(var i = n.length - 1; i >0; i--) {\n res += 9 - n[i];\n }\n\n print(res);\n}());\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "270d4475bc32884500fd2923efc1a7ee", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "(function () {\n var read = {\n number: function () {\n return +readline();\n },\n arr: function (divider) {\n return readline().split(divider ? divider : '');\n },\n arrNumber: function (divider) {\n return readline()\n .split(divider ? divider : '')\n .map(item => +item);\n }\n }\n\n var n = read.arr();\n\n var res = n.length > 1 ? 10 : 9;\n for(var i = n.length - 1; i >0; i--) {\n \n res += 9 - n[i];\n }\n\n print(res);\n}());\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "b33a584f2bf1e9f95724345835c07bd1", "src_uid": "055fbbde4b9ffd4473e6e716da6da899", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "process.stdin.resume()\nprocess.stdin.setEncoding('utf-8')\n\nvar arr = ''\nprocess.stdin.on('data', (i) => {\n arr += i\n})\n\nprocess.stdin.on('end', () => {\n const n = parseInt(arr)\n const sq = Math.sqrt(n)\n let k = 0\n for(let i = 1; i <= sq; i++) {\n if(n % i == 0) {\n if(n / i == i) k ++\n else k +=2\n }\n }\n console.log(k)\n\n})", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "677f59841f30ac338f3072281212943b", "src_uid": "7fc9e7d7e25ab97d8ebc10ed8ae38fd1", "difficulty": 1200.0} {"lang": "Node.js", "source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n\u2191\u5165\u529b \u2193\u51fa\u529b');\n\tMain();\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\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException \u201aThere is no more input';}}\n\t};\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\tvar N = nextInt();\n\tvar max = 0;\n\tvar maxIndex = {\n\t\tx : 0,\n\t\ty : 0\n\t}\n\tfor(var i = 1; i < N; i++){\n\t\tvar x = i;\n\t\tvar y = N - i;\n\t\tif(x < y && max < (x / y) && gcd(x, y) == 1){\n\t\t\tmax = x / y;\n\t\t\tmaxIndex.x = x;\n\t\t\tmaxIndex.y = y;\n\t\t}\n\t}\n\tmyout(maxIndex.x + \" \" + maxIndex.y);\n}\nfunction gcd(m, n) {return n != 0 ? gcd(n, m % n) : m;}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2e19874715d80b188caf89b281f78c4f", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "difficulty": 800.0} {"lang": "Node.js", "source_code": "//Don't have to see. start------------------------------------------\nvar read = require('readline').createInterface({\n\tinput: process.stdin, output: process.stdout\n});\nvar obj; var inLine = [];\nread.on('line', function(input){inLine.push(input);});\nread.on('close', function(){\n\tobj = init(inLine);\n\tconsole.error('\\n\u2191\u5165\u529b \u2193\u51fa\u529b');\n\tMain();\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\treturn {\n\t\tlist : input, index : 0, max : input.length,\n\t\thasNext : function(){return (this.index < this.max);},\n\t\tnext : function(){if(this.hasNext()){return this.list[this.index++];}else{throw 'ArrayIndexOutOfBoundsException \u201aThere is no more input';}}\n\t};\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\tvar N = nextInt();\n\tmyout(\"1 \" + (N - 1));\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "549461641e3eeccf5d11def2d2367eb2", "src_uid": "0af3515ed98d9d01ce00546333e98e77", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function main()\n{\n var data = readline().split(' ');\n var k = data[0];\n var n = 4;\n var x = 0;\n var a = new Array (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);\n for ( var i = 0; i < n; i++)\n {\n data = readline().split(' ');\n var line = data[0]\n for ( var j = 0; j < line.length; j++)\n { \n if (line[j] == '.')\n continue;\n x = +(line[j]);\n a[x]++;\n if (a[x] > 2*k)\n {\n print('NO');\n return;\n }\n } \n }\n print('YES');\n}\nmain()\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c515255dba13230bb98f3a027a14b9ed", "src_uid": "5fdaf8ee7763cb5815f49c0c38398f16", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var input = readline().split(' '),\n balls_arr_text = readline(),\n balls_arr = balls_arr_text.split('');\n\nvar balls = Number(input[0]),\n friends = Number(input[1]);\n\nvar friends_arr = [];\n\nvar result = true;\n\nballs_arr.sort();\n\nfor(var i = 0; i a.indexOf(v) === i);\n\nvar result = true;\n\nfor(var i=0; i max) {\n\t\t\tprint(0);\n\t\t\treturn;\n\t\t}\n\t\tif (low >= min && high >= min && high <= max) {\n\t\t\tprint(threshold+1);\n\t\t\treturn;\n\t\t}\n\t\tlow += classes[threshold];\n\t\thigh -= classes[threshold];\n\t}\n\tprint(0);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "def23dd6622beb2d3cd6917016138a04", "src_uid": "e595a1d0c0e4bbcc99454d3148b4557b", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "\nconst readline = require('readline');\n\nfunction trimZeros(num){\n\n if(!(typeof num == 'number'))\n num = parseInt(num);\n \n //make a string of the number\n num = num + \"\";\n\n //trim leading zeros\n num = parseInt(num);\n num = num + \"\";\n\n //trim the last zeros\n num = num.split(\"\").reverse().join(\"\");\n num = parseInt(num);\n\n return num;\n}\n\nfunction odd(num){\n return ( +num % 2 == 1);\n}\n\nfunction even(num){\n return (!odd(num));\n}\n\nfunction quasiPalindromic(num){\n\n num = trimZeros(num);\n num = num + \"\";\n \n let searchScope;\n if(odd(num)) searchScope = (num.length - 1) / 2;\n else searchScope = num.length / 2;\n\n for(let i = 0; i < searchScope; i++){\n if(!(num[i] == num[num.length-i-1]))\n return \"NO\";\n }\n\n return \"YES\"\n}\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n});\n\nrl.question('Enter a number to check if it\\'s a quasiPalindromic:\\n', (inputNumber) => {\n\n console.log(quasiPalindromic(inputNumber));\n\n rl.close();\n});", "lang_cluster": "Javascript", "compilation_error": true, "code_uid": "44fa6cd78a7643e84b928e0ee719b076", "src_uid": "d82278932881e3aa997086c909f29051", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var s = readline();\n\nvar a = s.replace(/0*$/g, ''); \nvar b = a.replace(/[^A-Za-z0-9]/g, '').split('').reverse().join(''); \n\nprint(a == b ? 'YES' : 'NO');\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "84014c4701f9d469a466f9b952f2fd6a", "src_uid": "d82278932881e3aa997086c909f29051", "difficulty": 900.0} {"lang": "JavaScript", "source_code": "var input = readline().split(' ')\n\nvar n = Number(input[0])\nvar k = Number(input[1])\n\nvar chaos = 0\n\nfor (var i = 0; i < n - 1 && i < k; i++) {\n var add = 2 * n - 4 * i - 3\n chaos += add > 0 ? add : 0\n}\n\nprint(chaos)", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3155760e1f5c718872f89470718b0365", "src_uid": "ea36ca0a3c336424d5b7e1b4c56947b0", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "'use strict'\n\nlet lll = readline().split(' ').map(v => parseInt(v))\nlet a = lll[0]\nlet b = lll[1]\n\nlet min = String(a).split('').reduce((r, v) => Math.max(r, v), 0)\nmin = String(b).split('').reduce((r, v) => Math.max(r, v), min)\nmin++\n\nlet max = 0\nfor (let i = min; i < 14; i++) {\n let da = to10(a, i)\n let db = to10(b, i)\n let ds = da + db\n let bs = from10(ds, i)\n max = Math.max(max, String(bs).length)\n}\n\nprint(max)\n\nfunction to10 (x, b) {\n return String(x).split('').reduce((r, v, i) => r + v * Math.pow(b, i), 0)\n}\n\nfunction from10 (x, b) {\n let res = ''\n let n = 0\n while (Math.pow(b, ++n) <= x) {}\n while (n--) {\n let a = x / Math.pow(b, n) | 0\n res += a\n x -= a * Math.pow(b, n)\n }\n return res\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "815d657af4578a3c0d9aee08f7e5a173", "src_uid": "8ccfb9b1fef6a992177cc49bd56fab7b", "difficulty": 1500.0} {"lang": "Node.js", "source_code": "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}\n\n// utils\nconst MOD = 1e9 + 7;\nconst mod = (n) => ((n % MOD) + MOD) % MOD;\nconst add = (a, b) => mod(mod(a) + mod(b));\nconst sub = (a, b) => mod(mod(a) - mod(b));\nfunction mul() {\n for (var a = arguments, r = a[0], i = a.length; --i; )\n r = ((((r >> 16) * a[i]) % MOD) * 65536 + (r & 65535) * a[i]) % MOD;\n return r;\n}\nfunction inv(b) {\n for (var a = MOD, u = 0, v = 1, t; b; v = t)\n (t = (a / b) | 0), (a -= t * b), (u -= t * v), (t = a), (a = b), (b = t), (t = u), (u = v);\n u %= MOD;\n return u < 0 ? u + MOD : u;\n}\nfunction pow(base, n) {\n if (n === 0) return 1;\n let p = pow(base, Math.floor(n / 2));\n let res = mul(mod(p), mod(p));\n if (n % 2 === 1) res = mul(mod(res), base);\n return res;\n}\nfunction highestOneBit(i) {\n i |= i >> 1;\n i |= i >> 2;\n i |= i >> 4;\n i |= i >> 8;\n i |= i >> 16;\n return i - (i >>> 1);\n}\n\nfunction main() {\n const arr = [];\n const permutations = [];\n function permutation(arr, len, store = \"\") {\n if (store.length === len) {\n permutations.push(store);\n return;\n }\n for (let i = 0; i < arr.length; i++) {\n const newArr = [...arr];\n const newChar = newArr.splice(i, 1);\n permutation(newArr, len, store.concat(newChar));\n }\n }\n\n permutation([1, 2, 3, 4, 5], 5);\n\n for (let i = 0; i < 5; i++) {\n const line = readLine()\n .split(\" \")\n .map((n) => parseInt(n));\n arr.push(line);\n }\n\n let max = -Infinity;\n for (let value of permutations) {\n max = Math.max(max, calculate(value));\n }\n\n console.log(max);\n\n function calculate(str) {\n const [one, two, three, four, five] = [+str[0] - 1, +str[1] - 1, +str[2] - 1, +str[3] - 1, +str[4] - 1];\n return (\n arr[one][two] +\n arr[two][three] +\n arr[three][four] +\n arr[three][four] +\n arr[four][five] +\n arr[four][five] +\n arr[two][one] +\n arr[three][two] +\n arr[four][three] +\n arr[four][three] +\n arr[five][four] +\n arr[five][four]\n );\n }\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "bb6f302fa5b5e81338c7ac6354f6b676", "src_uid": "be6d4df20e9a48d183dd8f34531df246", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var c = {};\n\nfunction T(i, n) {\n if (i > n / 2) i = n - i;\n if (i === 0) return 1;\n if (c[i + '+' + n]) return c[i + '+' + n];\n if (i == 1) {\n return n;\n }\n var ans = 0;\n for (var j = 1; j < n; j++) {\n ans += T(i - 1, j);\n }\n return c[i + '+' + n] = ans;\n}\n\n\nprint(function(n, m, t) {\n var a = [];\n for (var i = 1; i <= m; i++) {\n\n var j = t - i;\n\n if (j <= n && j >= 4) {\n a.push([T(i, m), T(j, n)]);\n }\n }\n\n var b = [];\n var x = 0;\n a.forEach(function(v){\n \tif(v[0]>1e8||v[1]>1e8){\n \t\tvar xx=v[1].toString();\n \t\tvar j=xx.length-1;\n \t\tfor(var i=1; i=0||j>=0){\n \t\tvar k= +(a[i]||0) + +(b[j]||0) + c;\n \t\tc=~~(k/10);\n \t\tsum.push(k%10);\n \t\ti--;\n \t\tj--;\n \t}\n \tif(c>0){\n\t \tsum.push(c)\t\n \t}\n \treturn sum.reverse().join('');\n });\n}.apply(0, readline().split(' ').map(Number)));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0af53ef2cf10fdad3ed285e16bea91da", "src_uid": "489e69c7a2fba5fac34e89d7388ed4b8", "difficulty": 1400.0} {"lang": "Node.js", "source_code": "\nprocess.stdin.resume()\nprocess.stdin.setEncoding('utf-8')\n\nlet input = ''\nlet ptr = 0\nprocess.stdin.on('data', (i) => {\n input += i\n})\n\n\nprocess.stdin.on('end', () => {\n input = input.split('\\n').map(a => a.replace(/(\\r\\n|\\n|\\r)/gm, ''))\n main()\n})\n\nfunction wr(...x) {\n console.log(...x)\n}\n\nfunction sort(a, inc = true) {\n if(inc) a.sort((a, b) => a - b)\n else a.sort((a, b) => b - a)\n}\n\nfunction readInt() {\n return parseInt(input[ptr++])\n}\n\nfunction readString() {\n return input[ptr++]\n}\n\nfunction readStrings() {\n return input[ptr++].split(' ')\n}\n\nfunction readInts() {\n return input[ptr++].split(' ').map(a => parseInt(a))\n}\n\nfunction main() {\n const [u, v] = readInts()\n if(u > v || u % 2 !== v % 2)\n wr(-1)\n else if(u === 0 && v === 0) wr(0)\n else if(u === v && u !== 0) {\n wr(1)\n wr(u)\n }\n else {\n let x = (v - u) / 2\n if((x & u) === 0) {\n wr(2)\n wr(u + x, x)\n }\n else {\n wr(3)\n wr(u, x, x)\n }\n }\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0982f57463acbcee46a7e89d13489b10", "src_uid": "490f23ced6c43f9e12f1bcbecbb14904", "difficulty": 1700.0} {"lang": "Node.js", "source_code": "if (process.env.ANT)\n{\n global.print = this.print ||\n function(){console.log([...arguments].join(' '))} ||\n require('lol-io').print;\n global.debug = function(){console.log('debug:', [...arguments].join(' '))}\n global.write = this.write || require('lol-io').write\n global.readline = this.readline || require('lol-io').readline\n main();\n}\nelse\n{\n const rl = require('readline').createInterface({ input: process.stdin,\n output: process.stdout });\n global.print = console.log\n global.debug = ()=>{};\n global.write = (...args) => {\n process.stdout.write(args.join(' '));\n }\n const lines = []\n rl.on('line', line =>{\n lines.push(line);\n });\n rl.on('close', main)\n let rli = 0;\n global.readline = ()=>lines[rli++];\n}\n\n///////////// CODE\n\nfunction main(){\n let D = [];\n\n let s = readline();\n let t = readline();\n\n function test(i, m)\n {\n debug('test ', i, m)\n let is = 0, it = 0;\n if (is==i)\n is += m;\n while (it item.split(' '));\n var durationA = Number(lines[0][1]);\n var durationB = Number(lines[1][1]);\n var repeatB = Number(lines[1][0]);\n\n // first bus run at 5:00.\n var firstBusTime = 5 * 60;\n // start time in minutes.\n var startTime = lines[2][0].split(':').map(Number);\n // after 00\n if (startTime[0] < 5) {\n startTime[0] *= 24;\n }\n startTime = startTime[0] * 60 + startTime[1];\n\n var count = 0;\n var firstBBusTime = firstBusTime;\n while((firstBBusTime + durationB) < startTime) {\n firstBBusTime += repeatB;\n }\n\n while(firstBBusTime < (startTime + durationA)) {\n firstBBusTime += repeatB;\n count++;\n }\n\n print(count);\n}\n\nmain();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0898790f54e9c54eb990602dff93689a", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "difficulty": 1600.0} {"lang": "JavaScript", "source_code": "function getInput() {\n var line = readline();\n var lines = [line];\n while (line = readline()) {\n lines.push(line);\n }\n return lines;\n}\n\nfunction main() {\n var lines = getInput().map(item => item.split(' '));\n var durationA = Number(lines[0][1]);\n var durationB = Number(lines[1][1]);\n var repeatB = Number(lines[1][0]);\n\n // first bus run at 5:00.\n var firstBusTime = 5 * 60;\n // start time in minutes.\n var startTime = lines[2][0].split(':').map(Number);\n startTime = startTime[0] * 60 + startTime[1];\n\n var x1 = startTime;\n var y1 = x1 + durationA;\n\n var count = 0;\n for (var x2 = firstBusTime; x2 < 24 * 60; x2 += repeatB) {\n var y2 = x2 + durationB;\n var x = Math.max(x1, x2);\n var y = Math.min(y1, y2);\n\n if (x < y) {\n count++;\n }\n }\n\n print(count);\n}\n\nmain()", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2df986a99884b2fd97391eaef4999d1c", "src_uid": "1c4cf1c3cb464a483511a8a61f8685a7", "difficulty": 1600.0} {"lang": "JavaScript", "source_code": "var nk = readline().split(\" \").map(function(x) { return parseInt(x); });\nvar o = readline().split(\" \").map(function(x) { return parseInt(x); });\n\nvar n = nk[0];\nvar k = nk[1];\n\nvar s = 0;\nfor (var i=0; i {\n let str = '';\n let i = 1;\n\n while (str.length < k) {\n str += i;\n i += 1;\n }\n\n return str[k - 1];\n};\n\nreadline.on('line', (line) => {\n const k = Number(line);\n\n console.log(getNumber(k));\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "da76954c5a1b6e8018b6319e834d0d95", "src_uid": "1503d761dd4e129fb7c423da390544ff", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "\nfunction gcd(a, b){\n\tif(!b){\n\t\treturn a;\n\t}\n\treturn gcd(b, a%b);\n}\nfunction e_gcd(a, b){\n\tif(a===0)\n\t\treturn [0, 1];\n\telse{\n\t\txy=e_gcd(b%a, a);\n\t\treturn [xy[1]-Math.floor(b/a)*xy[0], xy[0]];\n\t}\n}\nvar n=readline();\nvar a=parseInt(readline());\nvar b=parseInt(readline());\nif(n%gcd(a, b)!==0){\n\tprint(\"NO\");\n}\nelse{\n\txy=e_gcd(a, b);\n\tx=xy[0];\n\ty=xy[1];\n\tx=x*n/gcd(a, b);\n\ty=y*n/gcd(a, b);\n\tif(x<0 && y>=0){\n\t\tvar k=Math.ceil(Math.abs(x)*gcd(a, b)/b);\n\t\tx=x+k*b/gcd(a, b);\n\t\ty=y-k*a/gcd(a, b);\n\t}\n\telse{\n\t\tif(x>=0 && y<0){\n\t\t\tb = [a, a = b][0];\n\t\t\ty = [x, x = y][0];\n\t\t\tvar k=Math.ceil(Math.abs(x)*gcd(a, b)/b);\n\t\t\tx=x+k*b/gcd(a, b);\n\t\t\ty=y-k*a/gcd(a, b);\n\t\t\ty = [x, x = y][0];\n\t\t}\t\n\t} \n\tif(x>=0 && y>=0){\n\t\tprint(\"YES\");\n\t\tprint(x, y);\n\t}\n\telse{\n\t\t// print(\"NO\");\n\t\tconsole.log(\"NO\");\n\t}\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "3fea47405100c6da5d0633092f0f5bb9", "src_uid": "b031daf3b980e03218167f40f39e7b01", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var l = [];\nvar s = [];\nvar r = [];\nvar p = [];\n\nfor(var i = 0; i < 4; i++) {\n\tvar numbers = readline().split(\" \").map(function(x) { return parseInt(x); });\n\tl.push(numbers[0]);\n\ts.push(numbers[1]);\n\tr.push(numbers[2]);\n\tp.push(numbers[3]);\t\n}\n\nvar result = false;\n\nfor(var i = 0; i < 4; i++) {\n\tif(p[i] == 1) {\n\t\tif(l[i] == 1 || s[i] == 1 || r[i] == 1)\t{\n\t\t\tresult = true;\n\t\t}\n\t}\n}\n\nif(!result) {\n\tif(p[0] == 1) {\n\t\tif(l[1] == 1 || s[2] == 1 || r[3] == 1)\n\t\t\tresult = true\n\t}\n\n\tif(p[1] == 1) {\n\t\tif(l[2] == 1 || s[3] == 1 || r[0] == 1)\n\t\t\tresult = true\n\t}\n\n\tif(p[2] == 1) {\n\t\tif(l[3] == 1 || s[0] == 1 || r[1] == 1)\n\t\t\tresult = true\n\t}\n\n\tif(p[3] == 1) {\n\t\tif(l[0] == 1 || s[1] == 1 || r[2] == 1)\n\t\t\tresult = true\n\t}\n}\n\nif(result)\n\tprint(\"YES\");\nelse\n\tprint(\"NO\");", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2bd910352b99ffc1def404d79411cd41", "src_uid": "44fdf71d56bef949ec83f00d17c29127", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "const n = Number(readline());\n\nprint(Math.floor((n - 1) / 2));\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "eaa4d17f35cca8ec90c85c9d75617ef6", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var n = +readline();\n\n var i = 1;\n var j = n;\n var sum = 0;\n while (i < j) {\n sum += (i + j) % (n + 1);\n i++;\n if (i < j) {\n sum += (i + j) % (n + 1);\n j--;\n }\n }\n print(sum);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "92184835d57a773b4ff1baddd2811b0e", "src_uid": "dfe9446431325c73e88b58ba204d0e47", "difficulty": 1000.0} {"lang": "Node.js", "source_code": "process.stdin.resume();\nprocess.stdin.setEncoding('utf-8');\n \nlet inputString = '';\nlet currentLine = 0;\n \nprocess.stdin.on('data', inputStdin => {\n inputString += inputStdin;\n});\n \nprocess.stdin.on('end', _ => {\n inputString = inputString.split(/\\n/);\n main(); \n});\n \nfunction readLine() {\n return inputString[currentLine++];\n}\n\nfunction main() {\n const n = BigInt(readLine())\n let plus = 1n\n let minus = 1n\n const div = 1000000007n\n for (let i = 0n; i < n - 1n; i++) {\n plus *= (n - i)\n plus %= div\n minus *= 2n\n minus %= div\n }\n console.log((plus >= minus ? plus - minus : plus - minus + div).toString())\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "5ff6f68572ca192941b40c5a476f0ff7", "src_uid": "3dc1ee09016a25421ae371fa8005fce1", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "var len = parseInt(readline());\n\tvar str = readline();\n\tvar ans = 0, sum = 0;\n\tvar s='', s1=[];\n\tvar a=[];\n\tif(str.indexOf('B') < 0){\n\t\tprint(0);\n\t}\n\telse if(str.indexOf('W') < 0){\n\t\tans = len;\n\t\tprint(1);\n\t\tprint(ans);\n\t}\n\telse{\n\t\tvar r = \"W\";\n\t\ts = str.replace(new RegExp(r, 'gm'),' ');\n\t\tvar r1 = /\\s+/g;\n\t\ts = s.replace(r1,' ');\n\t\ts1 = s.split(\" \");\n\t\tvar k = 0;\n\t\tfor(var i = 0; i < s1.length; i++){\n\t\t\tif(s1[i] !== \"\"){\n\t\t\t\ta[k++] = s1[i].length;\n\t\t\t}\n\t\t}\n\t\tprint(k);\n\t\tfor(var j = 0; j < k; j++){\n\t\t\tprint(a[j]+' ');\n\t\t}\n\t}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "c5c679b567a7ea0f50723f0900714294", "src_uid": "e4b3a2707ba080b93a152f4e6e983973", "difficulty": 800.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n return;\n }\n\n let n = +d;\n let ans = 0;\n\n if (n <= 7) {\n ans++;\n console.log(ans);\n return;\n }\n\n if (n % 5 === 1) {\n ans += 3;\n n -= 6;\n ans += ans / 5;\n console.log(ans);\n }\n else {\n ans += Math.floor(n / 5);\n\n if (n % 5 !== 0) {\n ans++;\n }\n\n console.log(ans);\n }\n\n c++;\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e0cf66115f1dd83fb928c1a7af2f1e70", "src_uid": "a661b6ce166fe4b2bbfd0ace56a7dc2c", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function trim(s) {\n\treturn s.replace(/^\\s+|\\s+$/gm, '');\n}\n\nfunction tokenize(s) {\n\treturn trim(s).split(/\\s+/);\n}\n\nfunction tokenizeIntegers(s) {\n\tvar tokens = tokenize(s);\n\tfor (var i = 0; i < tokens.length; i += 1) {\n\t\ttokens[i] = parseInt(tokens[i]);\n\t};\n\treturn tokens;\n}\n\nfunction main() {\n\tvar n = parseInt(readline());\n\tvar boxes = tokenizeIntegers(readline());\n\tboxes.sort(function(a, b) {\n\t\treturn b-a;\n\t});\n\t\n\tfor (var size = 1; size < n; ++size) {\n\t\tvar piles = [];\n\t\tfor (i = 0; i < size; ++i) {\n\t\t\tpiles.push([]);\n\t\t}\n\t\tvar feasible = true;\n\t\tfor (i = 0; feasible && i < n; ++i) {\n\t\t\tvar ix = i%size;\n\t\t\tvar pile = piles[ix], height = pile.length;\n\t\t\tvar okay = true;\n\t\t\tfor (var j = 0; feasible && j < height; ++j) {\n\t\t\t\tif (pile[j] == height-1-j) {\n\t\t\t\t\tfeasible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpile.push(boxes[i]);\n\t\t}\n\t\tif (feasible) {\n\t\t\tprint(size);\n\t\t\treturn;\n\t\t}\n\t}\n\tprint(n);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "a330b68af1e6434667b38c2d20d224a6", "src_uid": "7c710ae68f27f140e7e03564492f7214", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "(function() {\nvar INPUT = ``;\nvar OUTPUT = ``;\n \nvar main = function() {\"use strict\";\n // TODO\n var input = rdArN();\n var n = input[0];\n var k = input[1];\n var A = rdArN();\n \n var M = {0: []};\n for (var i = 0; i < n; ++i) {\n var a = A[i];\n var pr = 0;\n while (a > 0) {\n if (!M[a]) {\n M[a] = [];\n }\n M[a].push(pr);\n \n a = (a >> 1);\n ++pr;\n }\n M[0].push(pr);\n }\n //prOb(M)\n //return;\n var res = Infinity;\n for (var key in M) {\n //print(key)\n var ar = M[key];\n //print(ar.length, k)\n if (ar.length >= k) {\n var fullPrice = 0;\n ar.sortLt();\n for (var i = 0; i < k; ++i) {\n fullPrice += ar[i];\n }\n res = Math.min(res, fullPrice);\n }\n }\n print(res);\n};\n \nif(INPUT){INPUT=INPUT.split('\\n').reverse();\nreadline=()=>INPUT.pop();\nwrite=(...s)=>{OUTPUT+=[...s].join(' ')};\nprint=(...s)=>{write(...s);OUTPUT+='\\n'};}\nconst\nrdS=readline,\nrdN=()=>+rdS(),\nrdArS=()=>rdS().split(' '),\nrdArN=()=>rdArS().map(v=>+v),\nwr=write,\npr=print,\nprAr=(a)=>pr(...a),\nprOb=(o)=>pr(JSON.stringify(o,null,4)),\ncrAr=function(length,...fillArgs){return new Array(length).fill(...fillArgs);},\ngetPrimes=function(n){var sieve=crAr(n+1,true),primes=[],i,j;for(i=2,j=4;j1;){if(primes[last]%p===0){primes[last]/=p;factors.push(p);}else{p=primes[++i];}}return factors;},\ndefineProperty=(o,pN,v)=>Object.defineProperty(o,pN,{value:v,writable:true,enumerable:false,configurable:true});\ndefineProperty(Array.prototype,'sortLt',function(){return this.sort((a,b)=>a-b);});\ndefineProperty(Array.prototype,'sortGt',function(){return this.sort((a,b)=>b-a);});\n \nmain();\nreturn OUTPUT;\n})();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "28c51dc4cd55affd680a69c46915d060", "src_uid": "ed1a2ae733121af6486568e528fe2d84", "difficulty": 1500.0} {"lang": "JavaScript", "source_code": "var dots = [];\nfor (var i = 0; i < 3; i++) {\n dots.push(readline().split(' ').map(Number));\n}\nif (dots[0][0] == dots[1][0] && dots[1][0] == dots[2][0] || \n dots[0][1] == dots[1][1] && dots[1][1] == dots[2][1]) {\n print(1);\n } else if (\n (\n dots[0][0] == dots[1][0] && \n (\n dots[2,1] >= Math.max(dots[1][1], dots[0][1]) || \n dots[2,1] <= Math.min(dots[1][1], dots[0][1])\n )\n ) ||\n (\n dots[0][1] == dots[1][1] &&\n (\n dots[2][0] >= Math.max(dots[0][0], dots[1][0]) ||\n dots[2][0] <= Math.min(dots[0][0], dots[1][0]) \n )\n ) || \n (\n dots[2][0] == dots[1][0] && \n (\n dots[0,1] >= Math.max(dots[1][1], dots[2][1]) || \n dots[0,1] <= Math.min(dots[1][1], dots[2][1])\n )\n ) ||\n (\n dots[2][1] == dots[1][1] &&\n (\n dots[0][0] >= Math.max(dots[2][0], dots[1][0]) ||\n dots[0][0] <= Math.min(dots[2][0], dots[1][0]) \n )\n ) ||\n (\n dots[0][0] == dots[2][0] && \n (\n dots[1,1] >= Math.max(dots[2][1], dots[0][1]) || \n dots[1,1] <= Math.min(dots[2][1], dots[0][1])\n )\n ) ||\n (\n dots[0][1] == dots[2][1] &&\n (\n dots[1][0] >= Math.max(dots[0][0], dots[1][0]) ||\n dots[1][0] <= Math.min(dots[0][0], dots[1][0]) \n )\n )\n ) {\n print(2);\n } else {\n print(3);\n }", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f2f9f341e879f153cdbf84166d990942", "src_uid": "36fe960550e59b046202b5811343590d", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": ";(function () {\n\tfor (var r = 0 ; r < 8; r++) {\n\t\tvar l = readline();\n\t\tl += l;\n\n\t\tvar t2 = 0, t3 = 0;\n\t\tfor (var i = 0; i < 15; i++) if (l[i] === l[i + 1]) t2++;\n\t\tfor (var i = 0; i < 14; i++) if (l[i] === l[i + 1] && l[i] === l[i + 2]) t3++;\n\n\t\tif (t3 || t2 > 1)\n\t\t{\n\t\t\tprint('NO');\n\t\t\treturn;\n\t\t}\n\t}\n\n\tprint('YES');\n}).call(this);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "788604baee9e6d9765a376b120f7fa94", "src_uid": "ca65e023be092b2ce25599f52acc1a67", "difficulty": 1000.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n terminal: false\n});\nlet c = 0;\nconst arr = [];\n\nrl.on('line', (d) => {\n if (c === 0) {\n c++;\n return;\n }\n\n arr.push(d.split(' ').map(Number));\n\n c++;\n});\n\nrl.on('close', () => {\n let ans = 0;\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr.length; j++) {\n ans += arr[i][j];\n }\n }\n\n if (arr.length > 3) {\n ans -= arr[0][1];\n ans -= arr[0][arr.length - 2];\n ans -= arr[arr.length - 1][1];\n ans -= arr[arr.length - 1][arr.length - 2];\n ans -= arr[1][0];\n ans -= arr[1][arr.length - 1];\n ans -= arr[arr.length - 2][0];\n ans -= arr[arr.length - 2][arr.length - 1];\n }\n\n console.log(ans);\n});\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "497137de5f71ce94c265f57d4131b06e", "src_uid": "5ebfad36e56d30c58945c5800139b880", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "'use strict';\n\n/*let input = `5\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1\n1 1 1 1 1`.split('\\n');\nfunction print(output) {\n\tconsole.log(output);\n}\nfunction readline() {\n\treturn input.shift();\n}*/\n\n//code\n\nvar n = Number(readline());\nvar matrix = [];\nfor (var i = 0; i < n; i++) {\n\tmatrix.push(readline().split(' ').map(Number));\n}\nvar sum = 0;\n//main diag\nfor (var i = 0; i < n; i++) {\n\tsum += matrix[i][i];\n}\n//sec diag\nfor (var i = 0; i < n; i++) {\n\tsum += matrix[i][n - i - 1];\n}\n//mid row\nfor (var i = 0; i < n; i++) {\n\tsum += matrix[(n - 1) / 2][i];\n}\n//mid col\nfor (var i = 0; i < n; i++) {\n\tsum += matrix[i][(n - 1) / 2];\n}\n//sub\nsum -= matrix[(n - 1) / 2][(n - 1) / 2] * 3;\nprint(sum);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0eb273ca8fefbd4bd207c27a475c456c", "src_uid": "5ebfad36e56d30c58945c5800139b880", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "readline();\nvar g = readline().split(\" \").join().split(\"\");\nvar arr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\nvar count = 0;\nfor(i=0;i {\n var count = numCapitals(curr);\n if (count > max) {\n return count;\n }\n return max;\n }, -1);\n\n print(max);\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "671fbdc43695e0a72708fa20202162b5", "src_uid": "d3929a9acf1633475ab16f5dfbead13c", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "(function() {\n var s = readline();\n \n if (s.length < 26) {\n print(-1);\n return 0;\n }\n \n const alph = 'abcdefghijklmnopqrstuvwxyz';\n \n var sIdx = 0;\n var resultString = '';\n \n for (var i = 0; i < alph.length; i++) {\n if (sIdx >= s.length) {\n print(-1);\n return 0;\n }\n \n var aLetter = alph[i];\n var searchNeeded = true;\n \n while (searchNeeded && sIdx < s.length) {\n var sLetter = s[sIdx];\n \n if (sLetter <= aLetter) {\n resultString += aLetter;\n searchNeeded = false;\n } else {\n resultString += sLetter;\n }\n \n sIdx++;\n }\n }\n \n for (var i = sIdx; i < s.length; i++) {\n resultString += s[i];\n }\n \n print(resultString);\n return 0;\n})();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "23ad8083135cae1957702cb56a83a300", "src_uid": "f8ad543d499bcc0da0121a71a26db854", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "var s=[\"1001010111001010\"];\nvar n = readline().split(' ');\nprint(s[n-1]);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2f9e027c9ce8a63115cb88ede4014288", "src_uid": "6f9767b63a01424f939d85b597cf42f3", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": "var s=[\"1001010111001010\"];\nvar n = readline().split(' ');\nprint(s[parseInt(n-1)]);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "8c3eaa7e01453a33d7906300d5bf357b", "src_uid": "6f9767b63a01424f939d85b597cf42f3", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": "var s=[1,0,0,1,0,1,0,1,1,1,0,0,1,0,1,0];\nvar n = readline().split('\\n');\nprint(s[parseInt(n-1)]);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "6be4abe58b77833f4290b71919e856aa", "src_uid": "6f9767b63a01424f939d85b597cf42f3", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": "var booksNumber = readline();\nvar booksNumberLength = booksNumber.toString().length;\nvar booksDistinctNumber = 0;\n\nfunction getDistinctNumber(booksNumber,booksNumberLength) {\n for (var index =booksNumberLength; index>0; index--) {\n booksDistinctNumber+=(booksNumber-(Math.pow(10,index-1)-1))*index;\n booksNumber=Math.pow(10,index-1)-1;\n\n }\n print(booksDistinctNumber);\n}\n\ngetDistinctNumber(booksNumber,booksNumberLength);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2a7686cad9c73a2a4bf00062668f0265", "src_uid": "4e652ccb40632bf4b9dd95b9f8ae1ec9", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "/**\n * Created by Utilisateur on 25/03/2016.\n */\n\nvar h = readline().split(' '),\n h0 = h1 = parseInt(h[0]),\n h2 = parseInt(h[1]),\n ab = readline().split(' '),\n a = parseInt(ab[0]),\n b = parseInt(ab[1]),\n t = 14,\n d = 0\n\nif (a= 10 && t < 22) h1 += a\n else h1 -= b\n if (++t >= 24) {\n t = 0\n d++\n }\n }\n}\n\nprint(d)\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "bdcadd9bfb10455bee1fd6303d2366a8", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "/**\n * Created by Utilisateur on 25/03/2016.\n */\n\nvar h = readline().split(' '),\n h0 = h1 = parseInt(h[0]),\n h2 = parseInt(h[1]),\n ab = readline().split(' '),\n a = parseInt(ab[0]),\n b = parseInt(ab[1]),\n t = 14,\n d = 0\n\nwhile(h1 < h2) {\n if (t >= 10 && t < 10) h1 += a\n else h1 += b\n if (++t >= 24) {\n t = 0\n d++\n if (h1 <= h0) {\n d = -1\n break\n }\n }\n}\n\nprint(d)\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "ebdf1c580c1da6f26f2c66bf9ae47e3e", "src_uid": "2c39638f07c3d789ba4c323a205487d7", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "(function () {\n var line = readline(),\n n = parseInt(line[0]),\n m = parseInt(line[0]),\n array = readline().split(\" \"),\n buses = 1,\n i = 0,\n m1 = m;\n while (i < n) {\n m1 -= array[i];\n i++;\n if (m1 < 0) {\n i--;\n buses++;\n m1 = m;\n }\n }\n print(buses);\n})();", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "a44865e817f05237e31b746a7ab3d19d", "src_uid": "5c73d6e3770dff034d210cdd572ccf0f", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var values = readline().split('').map((elements)=>{\n\treturn parseInt(elements)\n})\nvar circleDistance = 2*values[0]\nvar path = Math.ceil(Math.sqrt(\n\t(Math.pow(values[1] - values[3],2) + Math.pow(values[2] - values[4]),2)\n\t)/circleDistance)\nprint(path)\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "324ec5b6febb0ab7788dc7b4af7eb86a", "src_uid": "698da80c7d24252b57cca4e4f0ca7031", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var n;\n var dp = new Array(120).fill(new Array(3).fill(-1));\n\n function solve (arr, ind, last){\n if(ind == n){\n return 0;\n }\n if(dp[ind][last] != -1)\n return dp[ind][last];\n var mn = 100000;\n mn = Math.min(mn, solve(arr, ind+1, 0)+1);\n if((arr[ind] == 1 || arr[ind] == 3) && last != 1){\n mn = Math.min(mn, solve(arr, ind+1, 1));\n }\n if((arr[ind] == 2 || arr[ind] == 3) && last != 2){\n mn = Math.min(mn, solve(arr, ind+1, 2));\n }\n dp[ind][last] = mn;\n return mn;\n }\n\n n = readline();\n var arr = readline().split(' ').map(Number);\n print(solve(arr, 0, 0));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "98ff769c0bbb2f555e1cd783b5d960e3", "src_uid": "08f1ba79ced688958695a7cfcfdda035", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var number = readline();\nfunction isNiceDigit(curNumber) {\n var res = 0;\n while (curNumber > 0)\n {\n res += curNumber % 10\n curNumber = Math.floor(curNumber/10)\n }\n if (res == 10) return true;\n return false;\n} \n\nvar i, enumerator;\n\nfor (i = 0, enumerator = 0; enumerator < parseInt(number,10); i++) {\n if (isNiceDigit(i)) enumerator++;\n}\n\nwrite(--i);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "b8063777fe7d108a35858c7a9c331506", "src_uid": "0a98a6a15e553ce11cb468d3330fc86a", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "function sa(n ,moves){\n var positionX = 0;\n var positionY = 0;\n for(var i=0;i 0){\n return \"NO\"\n }\n if(positionY < -20000){\n return \"NO\"\n }\n if(positionY == 0){\n if(move[1] != \"South\"){\n return \"NO\"\n }\n }\n if(positionY == -20000){\n if(move[1] != \"North\"){\n return \"NO\"\n }\n }\n if(move[1] == \"South\"){\n positionY -= val\n } else if(move[1] == \"East\"){\n positionX -= val\n }else if(move[1] == \"North\"){\n positionY += val\n } else if(move[1] == \"West\"){\n positionX += val\n }\n }\nif(positionY > 0){\n return \"NO\"\n }\n if(positionY < -20000){\n return \"NO\"\n }\n if(positionY == 0){\n return \"YES\";\n }\n\n return \"NO\"\n}\n\n\nvar n = Number(readline());\nvar moves = [];\nfor(var i=0;i= 12){time[0] -= 12;}\nprint((time[0]*30+time[1]*0.5).toFixed(9) + \" \" + (time[1]*6).toFixed(9));", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "6dc932b2e28d4c7c28fd48065ba9f367", "src_uid": "175dc0bdb5c9513feb49be6644d0d150", "difficulty": 1200.0} {"lang": "JavaScript", "source_code": "var n = Number(readline());\nvar k = 1, sum = 0;\nwhile (sum < n - 1) {\n sum += k++;\n}\nprint(n - sum);", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "0869ee840c9d126730c7a428cea9b87d", "src_uid": "1db5631847085815461c617854b08ee5", "difficulty": 1000.0} {"lang": "JavaScript", "source_code": "var strN = readline(),\n\t\t\tnumN = parseInt(strN);\n\n\t\tif(strN.indexOf('8') >= 0)\t{\n\t\t\tprint(10);\n\t\t} else\t{\n\t\t\tfor(var i = 1; i<=10; i++)\t{\n\t\t\t\tvar temp = numN + i;\n\t\t\t\t\n\t\t\t\tif(temp.toString().indexOf('8') >= 0)\t{\n\t\t\t\t\tprint(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "2501e491ac75f3c0400ca1a94d4a80e1", "src_uid": "4e57740be015963c190e0bfe1ab74cb9", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "var x ;\n var n ,k,losers,dipl ,cert ,sum , count ;\n\nnextLine();\nfunction nextLine(){\nvar x = readline()\nif(x){\n Arr = x.split(\" \").map(function(x) { return parseInt(x); })\n n= Arr[0]\n k = Arr[1]\n dipl = Math.floor((.5*n/(1+k)));\n cert=k*dipl ; \n var losers = n - cert - dipl ;\n sum = 0 ;\n console.log(dipl,cert,losers)\n print(dipl+' '+cert+' '+ losers)\n\n }\n}\n\n\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "cafde3e5e7741b4e4bd12a7f2b5b4991", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "var x ;\n var n ,k,losers,dipl ,cert ,sum , count ;\n\nnextLine();\nfunction nextLine(){\nvar x = readline()\nif(x){\n Arr = x.split(\" \").map(function(x) { return parseInt(x); })\n n= Arr[0]\n k = Arr[1]\n dipl = Math.floor((.5*n/(1+k)));\n cert=k*dipl ; \n var losers = n - cert - dipl ;\n sum = 0 ;\n print(dipl+' '+cert+' '+ losers)\n nextLine()\n }\n}\n\n\n// function readline(){\n// return '18 2'\n// }\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e109f2023a7f0d81d8d2901d588eca18", "src_uid": "405a70c3b3f1561a9546910ab3fb5c80", "difficulty": 800.0} {"lang": "Node.js", "source_code": "//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\u2191\u5165\u529b \u2193\u51fa\u529b');\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 \u201aThere 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 x = one[0];\n var y = one[1];\n var z = one[2];\n one = nextIntArray();\n var a = one[0];\n var c = one[1];\n var b = one[2];\n if(a < x){\n myout(\"NO\");\n return;\n }\n a -= x;\n if(a + c < y){\n myout(\"NO\");\n return;\n }\n var ac = a + c;\n ac -= y;\n if(ac + b < z){\n myout(\"NO\");\n return;\n }else{\n myout(\"YES\");\n return;\n }\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "73393384e875cb8ed48a684a8820ae0c", "src_uid": "d54201591f7284da5e9ce18984439f4e", "difficulty": 800.0} {"lang": "JavaScript", "source_code": "function fail(s){\n\tvar n = s.length;\n\tfor (var i = 1; i < n; ++i) {\n\t\tvar j = F[i - 1];\n\t\twhile (j > 0 && s[i] != s[j])\n\t\t\tj = F[j - 1];\n\t\tif (s[i] == s[j]) ++j;\n\t\tF[i] = j;\n\t}\n}\nfunction init(){\n\tdp = new Array(105);\n\tfor(var i = 0; i < 105; i++) {\n\t\tdp[i] = new Array(105);\n\t\tfor (var j = 0; j < 105; j++) {\n\t\t\tdp[i][j] = new Array(105);\n\t\t\tfor (var k = 0; k < 105; k++) \n\t\t\t\tdp[i][j][k] = {x: -1, y: \"\"};\n\t\t}\n\t}\n\tF = new Array(105);\n\tfor(var i = 0; i < 105; i++) F[i] = 0;\n}\nfunction clone(o){\n\treturn JSON.parse(JSON.stringify(o));\n}\nfunction lcs(i, j, k){\n\tif(i >= n || j >= m) return {x: 0, y: \"\"};\n\tif(dp[i][j][k].x != -1) return clone(dp[i][j][k]);\n\t//console.log(i + \" \"+ j + \" \" +k);\n\tvar skipLeft = clone(lcs(i + 1, j, k)) , skipRight = clone(lcs(i, j + 1, k)), equal = {x:-1, y:\"\"};\n\tif(s[i] == t[j]){\n\t\tvar tempK = k;\n\t\t//console.log(i + \" \" + j + \" \"+ k + \" HENA1\");\n\t\tif(s[i] == v[k]){\n\t\t\t//console.log(\"HENA\");\n\t\t\ttempK++;\n\t\t}\n\t\telse if(k > 0){\n\t\t\t//console.log(\"YALLAA \" + tempK + \" \" + F[tempK - 1]);\n\t\t\ttempK = F[tempK - 1];\n\t\t\twhile(tempK > 0 && v[tempK] != s[i]) tempK = F[tempK - 1];\n\t\t\tif(v[tempK] == s[i]) tempK++;\n\t\t}\n\t\tif(tempK != vv){\n\t\t\tequal = clone(lcs(i + 1, j + 1, tempK));\n\t\t\tequal.x++;\n\t\t\t//console.log(s[i] + \" \" + equal.y);\n\t\t\tequal.y = s[i] + equal.y;\n\t\t\t//console.log(equal.y);\n\t\t}\n\t\t//else console.log(\"HeeeeeeeeEEH\");\n\t}\n\tvar sols = [skipLeft, skipRight, equal]; sols.sort(function(a, b){return parseInt(b.x) - parseInt(a . x);});\n\tvar sol = sols[0];\n\t//return sol;\n\treturn (dp[i][j][k] = clone(sol));\t\n}\nvar s = readline();\nvar t = readline();\nvar v = readline();\nvar n = s.length, m = t.length, vv = v.length, dp, F;\ninit();fail(v);\nvar soli = lcs(0, 0, 0);\nif(soli.x == 0){\n\tprint(\"0\");\n}\nelse print(soli.y);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "d1918fb5a9b85044c767c3851330d874", "src_uid": "391c2abbe862139733fcb997ba1629b8", "difficulty": 2000.0} {"lang": "JavaScript", "source_code": "\nvar n = parseInt(readline());\nvar res = 1;\nfor (var i = 1; i <= n; i++) res *= i;\nres /= n;\nres /= (n / 2);\nprint(res);\n\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "14a8f038875a1ceb0181f5c923df5ab8", "src_uid": "ad0985c56a207f76afa2ecd642f56728", "difficulty": 1300.0} {"lang": "JavaScript", "source_code": "var arr = [];\nfor (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n if (!arr[i]) {\n arr[i] = [];\n }\n arr[i][j] = readline();\n }\n}\n\nvar testPosition = function(x, y) {\n if (x + 1 == 4 || y + 1 == 4) {\n return false;\n }\n if (arr[x][y] == arr[x][y + 1] && arr[x][y] == arr[x + 1][y] && arr[x][y] == arr[x + 1][y + 1]) {\n return true;\n }\n return false;\n};\n\nvar testSquare = function() {\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n if (testPosition(i, j)) {\n return true;\n }\n }\n }\n};\n\nvar change = function(x, y) {\n if (x + 1 == 4 || y + 1 == 4) {\n return false;\n }\n var colors = {\n firstColor: {\n color: '',\n found: 0\n },\n secondColor: {\n color: '',\n found: 0\n }\n };\n colors.firstColor = arr[x][y];\n for (var ix = x; ix <= x + 1; ix++) {\n for (var jy = y; jy <= y + 1; jy++) {\n if (colors.firstColor === arr[ix][jy]) {\n colors.firstColor.found += 1;\n } else {\n if (colors.secondColor.color !== '')\n colors.secondColor.color = arr[ix][jy];\n colors.secondColor.found += 1;\n }\n }\n }\n if (colors.secondColor.found === 1 || colors.firstColor.found === 1) {\n return true;\n }\n return false;\n};\n\nvar testChange = function() {\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n if (change(i, j)) {\n return true;\n }\n }\n }\n};\n\n\nfor (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n write(arr[i][j]);\n }\n print()\n}\n\nif (testSquare()) {\n\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n write(arr[i][j]);\n }\n print()\n }\n print('YES1');\n} else {\n\n if (testChange()) {\n\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n write(arr[i][j]);\n }\n print()\n }\n print('YES2');\n } else {\n print('NO');\n }\n}\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "579a1c6760f81e0c00da697439f36de5", "src_uid": "01b145e798bbdf0ca2ecc383676d79f3", "difficulty": 1100.0} {"lang": "Node.js", "source_code": "'use strict'\r\nObject.defineProperty(exports, '__esModule', { value: !0 })\r\nvar os = require('os')\r\nconst stdin = process.stdin,\r\n stdout = process.stdout,\r\n integerRegex = /-?\\d+/g,\r\n decimalRegex = /-?\\d+(?:\\.\\d+)?/g\r\nclass InputAndOutput {\r\n lineIndex = 0\r\n lines = []\r\n dried() {\r\n return this.lineIndex >= this.lines.length\r\n }\r\n readLine() {\r\n const e = this.lines[this.lineIndex]\r\n return (this.lineIndex += 1), e\r\n }\r\n readIntegersOfLine() {\r\n const e = this.readLine().match(integerRegex)\r\n return null == e ? [] : e.map(e => Number(e))\r\n }\r\n readNumsOfLine() {\r\n const e = this.readLine().match(decimalRegex)\r\n return null == e ? [] : e.map(e => Number(e))\r\n }\r\n print(e) {\r\n stdout.write(e)\r\n }\r\n async init() {\r\n const e = await this.readLines()\r\n this.lines = e\r\n }\r\n readLines() {\r\n const e = []\r\n return new Promise(n => {\r\n stdin.on('data', n => e.push(n)),\r\n stdin.on('end', function () {\r\n const t = e.join('').split(os.EOL)\r\n n(t)\r\n })\r\n })\r\n }\r\n}\r\nasync function __main__(e) {\r\n const n = new InputAndOutput()\r\n await n.init(), e(n)\r\n}\r\nconst MOD = BigInt(1000000007),\r\n MAX_N = 200010,\r\n f = new Array(MAX_N)\r\nfunction solve(e, n) {\r\n if (0 === n) return 1n\r\n const t = f[e - 1]\r\n let s = fastPower((t + MOD) % MOD, BigInt(n), MOD)\r\n if (0 == (1 & e)) return s\r\n let i = 1n\r\n for (let e = 1; e <= n; ++e) (s += i * f[n - e]), (i = (i * t) % MOD)\r\n return s\r\n}\r\nfunction fastPower(e, n, t) {\r\n let s = 1n\r\n for (let i = n, r = e; i > 0; i /= 2n, r = (r * r) % t)\r\n i % 2n === 1n && (s = (s * r) % t)\r\n return s\r\n}\r\n__main__(function (e) {\r\n f[0] = 1n\r\n for (let e = 1; e < MAX_N; ++e) f[e] = (2n * f[e - 1]) % MOD\r\n const n = Number(e.readLine())\r\n for (let t = 1; t <= n; ++t) {\r\n const [n, t] = e.readIntegersOfLine(),\r\n s = ((solve(n, t) % MOD) + MOD) % MOD\r\n e.print(s + '\\n')\r\n }\r\n})\r\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "b20176d58f0d01f2c5c35f6342516e12", "src_uid": "02f5fe43ea60939dd4a53299b5fa0881", "difficulty": 1700.0} {"lang": "Node.js", "source_code": "const readline = require('readline');\n\nconst rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n})\n\n \nfunction main() {\n comparison(stdin[0],stdin[1]) \n}\n \nvar stdin = [];\nrl.on('line', function (line) {stdin.push(line);});\nrl.on('close', main);\n/*\nconst main = async () => {\n await question1()\n rl.close()\n}\n\nmain()\n*/\n\nfunction comparison(n, m) {\n var firstStr = String(n);\n if(String(n).length == 1 || String(m).length == 1){\n return n == m ? console.log(\"OK\") : console.log(\"WRONG_ANSWER\")\n } \n var result = '';\n var count = 0\n while( firstStr ) {\n var min = 999;\n for(var i = 0; i < firstStr.length; i++) {\n if(Number(firstStr[i] < min)) {\n \tif(count == 0 && Number(firstStr[i]) == 0){ \n } else {\n \tmin = firstStr[i]\n }\n }\n \t}\n var index = firstStr.indexOf(min);\n result += firstStr.slice(index, index+1)\n firstStr = firstStr.slice(0, index) + firstStr.slice(index+1, firstStr.length)\n count ++\n } \n if(result == m) {\n \tconsole.log(\"OK\")\n } else {\n \tconsole.log(\"WRONG_ANSWER\")\n }\n}", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f1939b867aa55915fb5907a3d73e77eb", "src_uid": "d1e381b72a6c09a0723cfe72c0917372", "difficulty": 1100.0} {"lang": "JavaScript", "source_code": "function ProblemSolver() {\n this.HAS_TEST_CASES = false;\n this.INPUT_FILE_NAME = \"test.in\";\n this.OUTPUT_FILE_NAME = \"out.txt\";\n this.DO_OUTPUT_TO_FILE = false;\n\n this.solveCase = function() {\n var res , i , j , l1 , l2 , a , fl , zz ;\n res = 0;\n l1 = this.s.length ;\n l2 = this.t.length ;\n j = 0 ;\n for( i = 0 ; i < l1 && j < l2 ; i++ ) {\n if( this.s[ i ] == this.t[ j ] ) {\n j++ ;\n }\n }\n if( j == l2 ) {\n res = 1 ;\n }\n for( i = 0 ; i < l1 ; i++ ) {\n a = this.s.charCodeAt( i ) - \"a\".charCodeAt( 0 ) ;\n this.arr[ a ]++ ;\n }\n for( i = 0 ; i < l2 ; i++ ) {\n a = this.t.charCodeAt( i ) - \"a\".charCodeAt( 0 ) ;\n this.brr[ a ]++ ;\n }\n fl = 1 ;\n zz = 0 ;\n for( i = 0 ; i < 26 ; i++ ) {\n if( this.arr[ i ] < this.brr[ i ] ) {\n fl = 0 ;\n break ;\n }\n if( this.arr[ i ] != this.brr[ i ] ) {\n zz = 1 ;\n }\n }\n if( zz == 1 && fl == 1 && res == 0 ) {\n res = 3 ;\n }\n else if( fl == 1 && res == 0 ) {\n res = 2 ;\n }\n if( res == 0 ) {\n print( \"need tree\" );\n }\n else if( res == 1 ) {\n print( \"automaton\" );\n }\n else if( res == 2 ) {\n print( \"array\" );\n }\n else {\n print( \"both\" );\n }\n };\n\n this.init = function() {\n this.lim1 = 100010;\n this.lim2 = 110;\n this.cc = 1;\n this.ind = 1;\n this.n = 0;\n this.cn = 0;\n this.declareAndFillArrays();\n };\n\n this.getInput = function( irObj ) {\n var hasMoreInput , i;\n hasMoreInput = true;\n try {\n this.s = irObj.nextString();\n this.t = irObj.nextString();\n }\n catch( ex ) {\n hasMoreInput = false;\n }\n return hasMoreInput;\n };\n\n this.clearArraysPerCase = function() {\n var i;\n this.arr = new Array();\n this.brr = new Array();\n this.adj_list = new Array();\n for( i = 0 ; i < this.lim1 ; i++ ) {\n this.arr.push( 0 );\n this.brr.push( 0 );\n this.adj_list.push( new Array() );\n }\n };\n\n this.clearPerCase = function() {\n this.cn = 0;\n this.cc++;\n this.clearArraysPerCase() ;\n };\n\n this.declareAndFillArrays = function() {\n var i , j;\n this.srr = new Array();\n this.vis = new Array();\n this.arr = new Array();\n this.brr = new Array();\n this.memo = new Array();\n this.done = new Array();\n this.adj_list = new Array();\n for( i = 0 ; i < this.lim1 ; i++ ) {\n this.srr.push( \"\" );\n this.vis.push( 0 );\n this.arr.push( 0 );\n this.brr.push( 0 );\n this.adj_list.push( new Array() );\n }\n for( i = 0 ; i < this.lim2 ; i++ ) {\n this.memo.push( new Array() );\n this.done.push( new Array() );\n for( j = 0 ; j < this.lim2 ; j++ ) {\n this.memo[ i ].push( -1 );\n this.done[ i ].push( 0 );\n }\n }\n };\n\n this.init();\n}\n\nfunction InputReader() {\n this.allLines = new Array();\n this.currrentLineNumber = 0;\n this.currrentCharacterIndex = 0;\n\n this.readAllLines = function() {\n var singleLine;\n while( true ) {\n try {\n singleLine = readline();\n if( singleLine == null ) {\n break;\n }\n }\n catch( ex ) {\n break;\n }\n this.allLines.push( singleLine );\n }\n };\n\n this.parseRawData = function( data ) {\n var len , i , currentString;\n len = data.length;\n currentString = \"\";\n for( i = 0 ; i < len ; i++ ) {\n if( data[ i ] == '\\r' ) {\n }\n else if( data[ i ] == '\\n' ) {\n this.allLines.push( currentString );\n currentString = \"\";\n }\n else {\n currentString += data[ i ];\n }\n }\n if( currentString != \"\" ) {\n this.allLines.push( currentString );\n }\n };\n\n this.readAllLinesFromFile = function( inputFileName ) {\n var currentDirectory , fsObj , inputFilePath , rawData;\n fsObj = require( 'fs' );\n currentDirectory = __dirname;\n inputFilePath = currentDirectory + \"\\\\\" + inputFileName;\n rawData = fsObj.readFileSync( inputFilePath , \"utf8\" );\n this.parseRawData( rawData );\n };\n\n this.next = function( flag ) {\n var len , i , startIdx , res , endIdx;\n len = this.allLines[ this.currrentLineNumber ].length;\n if( flag == 0 ) {\n res = \"\";\n for( i = this.currrentCharacterIndex ; i < len ; i++ ) {\n res += this.allLines[ this.currrentLineNumber ][ i ];\n }\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n return res;\n }\n while( true ) {\n if( this.currrentLineNumber >= this.allLines.length ) {\n throw new Error( \"No more tokens available!\" );\n }\n startIdx = -1;\n for( i = this.currrentCharacterIndex ; i < len ; i++ ) {\n if( this.allLines[ this.currrentLineNumber ][ i ] != ' ' ) {\n startIdx = i;\n break;\n }\n }\n if( startIdx == -1 ) {\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n continue;\n }\n res = \"\";\n endIdx = -1;\n for( i = startIdx ; i < len ; i++ ) {\n if( this.allLines[ this.currrentLineNumber ][ i ] == ' ' ) {\n endIdx = i;\n break;\n }\n res += this.allLines[ this.currrentLineNumber ][ i ];\n }\n if( endIdx == -1 ) {\n this.currrentLineNumber++;\n this.currrentCharacterIndex = 0;\n }\n else {\n this.currrentCharacterIndex = endIdx;\n }\n return res;\n }\n };\n\n this.nextInt = function() {\n return parseInt( this.next( 1 ) );\n };\n\n this.nextDouble = function() {\n return parseFloat( this.next( 1 ) );\n };\n\n this.nextString = function() {\n return this.next( 1 );\n };\n\n this.nextLine = function() {\n this.next( 0 );\n };\n}\n\nfunction FileOutputHandler() {\n this.resultantStringArray = new Array();\n\n this.addNewLine = function( newString ) {\n this.resultantStringArray.push( newString );\n };\n\n this.clearPercase = function() {\n this.resultantStringArray = new Array();\n };\n\n this.flushOutOutputToFile = function( outputFileName ) {\n var i , sz , res , currentDirectory , fsObj , outputFilePath;\n res = \"\";\n sz = this.resultantStringArray.length;\n for( i = 0 ; i < sz ; i++ ) {\n if( i != 0 ) {\n res += \"\\n\";\n }\n res += this.resultantStringArray[ i ];\n }\n fsObj = require( 'fs' );\n currentDirectory = __dirname;\n outputFilePath = currentDirectory + \"\\\\\" + outputFileName;\n fsObj.writeFileSync( outputFilePath , res );\n this.clearPercase();\n };\n}\n\nfunction CodeExecutioner() {\n this.irObj = new InputReader();\n this.psObj = new ProblemSolver();\n this.fohObj = new FileOutputHandler();\n\n this.runCode = function() {\n var testCases , i , hasMoreTestCases , isLocal , localContext ;\n try {\n if( __dirname != null ) {\n isLocal = true;\n }\n }\n catch( ex ) {\n isLocal = false;\n }\n if( isLocal == true ) {\n print = console.log;\n if( this.psObj.DO_OUTPUT_TO_FILE == true ) {\n localContext = this.fohObj;\n print = function() {\n localContext.addNewLine.apply( localContext , arguments );\n }\n }\n this.irObj.readAllLinesFromFile( this.psObj.INPUT_FILE_NAME );\n }\n else {\n this.irObj.readAllLines();\n }\n if( this.psObj.HAS_TEST_CASES == true ) {\n testCases = this.irObj.nextInt();\n for( i = 0 ; i < testCases ; i++ ) {\n this.psObj.clearPerCase();\n this.psObj.getInput( this.irObj );\n this.psObj.solveCase();\n }\n }\n else {\n while( true ) {\n this.psObj.clearPerCase();\n hasMoreTestCases = this.psObj.getInput( this.irObj );\n if( hasMoreTestCases == false ) {\n break;\n }\n this.psObj.solveCase();\n }\n }\n if( this.psObj.DO_OUTPUT_TO_FILE == true ) {\n this.fohObj.flushOutOutputToFile( this.psObj.OUTPUT_FILE_NAME );\n }\n };\n\n this.runCode();\n}\n\nnew CodeExecutioner();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "225048b264ba1a7778d096c04b202451", "src_uid": "edb9d51e009a59a340d7d589bb335c14", "difficulty": 1400.0} {"lang": "JavaScript", "source_code": "var x ;\n var Arr , c ,v0 ,v1 ,a ,l ,sum , count ;\n\nnextLine();\nfunction nextLine(){\nvar x = readLine()\nif(x){\nArr = x.split(\" \").map(function(x) { return parseInt(x); })\nc= Arr[0]\nv0 = Arr[1]\nv1 = Arr[2]\na =Arr[3]\nl = Arr[4]\nsum = 0 ;\ncount=0 ; \nsum = 0 ;\ncount = 0;\n\nsummer();\n}\n}\n\n\nfunction summer (){\nsum += (v0+count*a bar * baz) {\n baz = foo;\n quz = bar;\n }\n}\nprint(baz / quz);\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "f239052ebc30dad4e77538bd1975a740", "src_uid": "32fc378a310ca15598377f7b638eaf26", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": "function trim(s) {\n\treturn s.replace(/^\\s+|\\s+$/gm, '');\n}\n\nfunction tokenize(s) {\n\treturn trim(s).split(/\\s+/);\n}\n\nfunction tokenizeIntegers(s) {\n\tvar tokens = tokenize(s);\n\tfor (var i = 0; i < tokens.length; i += 1) {\n\t\ttokens[i] = parseInt(tokens[i]);\n\t};\n\treturn tokens;\n}\n\nfunction main() {\n\tvar points = [], pointCounts = {};\n\n\tfunction point2key(x, y) {\n\t\treturn [x, y].join(',');\n\t}\n\n\tfunction key2point(s) {\n\t\tvar xy = s.split(',');\n\t\treturn { x: xy[0], y: xy[1] };\n\t}\n\n\tfunction addPoint(x, y) {\n\t\tvar key = point2key(x, y);\n\t\tif (pointCounts[key] === undefined) {\n\t\t\tpoints.push(key);\n\t\t\tpointCounts[key] = 1;\n\t\t}\n\t\telse {\n\t\t\tpointCounts[key] += 1;\n\t\t}\n\t}\n\n\tfor (var i = 0; i < 4; i += 1) {\n\t\tvar integers = tokenizeIntegers(readline());\n\t\taddPoint(integers[0], integers[1]);\n\t\taddPoint(integers[2], integers[3]);\n\t}\n\n\tfor (var i = 0; i < points.length; i += 1) {\n\t\tif (pointCounts[points[i]] != 2) {\n\t\t\tprint(\"NO\");\n\t\t\treturn;\n\t\t}\n\t\tpoints[i] = key2point(points[i]);\n\t}\n\n\tvar invert = new Array(4);\n\tvar okay = false;\n\n\tfunction go(count) {\n\t\tif (count == 4) {\n\t\t\tvar a = points[invert[0]], b = points[invert[1]],\n\t\t\t\tc = points[invert[2]], d = points[invert[3]];\n\t\t\tif (a.x == b.x && a.y != b.y && c.x == d.x && c.y != d.y &&\n\t\t\t\t\ta.y == d.y && a.x != d.x && b.y == c.y && b.x != c.x) {\n\t\t\t\tokay = true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (var i = 0; i < 4; i += 1) {\n\t\t\t\tif (invert[i] === undefined) {\n\t\t\t\t\tinvert[i] = count;\n\t\t\t\t\tgo(count+1);\n\t\t\t\t\tinvert[i] = undefined;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tgo(0);\n\tprint(okay ? \"YES\" : \"NO\");\n}\n\nmain();\n", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "e5b098925a4160276b0203deba6630af", "src_uid": "ad105c08f63e9761fe90f69630628027", "difficulty": 1700.0} {"lang": "JavaScript", "source_code": "var temp = readline().split(\" \").map(Number);\nvar i = 0;\nvar check = false;\nwhile(temp[0]*i<=temp[2]){\n if((temp[2]-temp[0]*i)%temp[1]==0){\n check=true;\n }\n i++;\n}\nprint(check ==true?\"Yes\":\"No\")", "lang_cluster": "Javascript", "compilation_error": false, "code_uid": "b94c0bd31c97f3e134526705c0668fd7", "src_uid": "e66ecb0021a34042885442b336f3d911", "difficulty": 1100.0}