messages listlengths 1 1 | ground_truth stringlengths 88 726k | dataset stringclasses 1
value |
|---|---|---|
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNandu is stuck in a maze consisting of N rooms. Each room with room number x has a door leading into room number 2x (if 2x β€ N) and another door leading into room number 2x+1 (if 2x+1 β€ N). All these doors are 2-way doors... | [{"type": "stdin_stdout", "input": "55 6\n0001100110100100011011001111011111100010010110100100001\n37 46\n48 24\n43 45\n41 33\n2 34\n11 5", "output": "No\nYes\nNo\nNo\nNo\nNo\n"}, {"type": "stdin_stdout", "input": "55 6\n0001100110100100011011001111011111100010010110100100001\n37 46\n48 24\n43 45\n37 33\n2 34\n11 5", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nShantam is very rich , even richer than Richie Rich. He is extremely talented in almost everything except one , mathematics. So one day, he pays a visit to a temple (to pray for his upcoming mathematics exams) and decide... | [{"type": "stdin_stdout", "input": "2\n1 3\n1 1 -1 1 2 1\n7 2\n2 3 2 -1 1 5\n\nSAMPLE", "output": "1 1000000\n2 13\n"}, {"type": "stdin_stdout", "input": "2\n1 3\n1 1 -1 1 2 1\n7 1\n2 3 2 -1 1 5\n\nSAMPLE", "output": "1 1000000\n2 2\n"}, {"type": "stdin_stdout", "input": "2\n1 3\n1 1 -1 1 2 1\n7 1\n2 5 4 -1 1 5\n\nELPM... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nXenny was a teacher and his class consisted of N boys and N girls. He took all his students to the playground and asked them to stand in a straight line. The boys and the girls formed a perfect line, but Xenny seemed unha... | [{"type": "stdin_stdout", "input": "3\n8\nBGBBGGBGBGGBBBGG\n5\nGGGGGBBBBB\n7\nGGBBBGBGBGGBGB", "output": "3\n2\n3\n"}, {"type": "stdin_stdout", "input": "3\n8\nBGBBGGBBBGGBGBGG\n5\nGGGGGBBBBB\n7\nGGBBBGBGBGGBGB", "output": "4\n2\n3\n"}, {"type": "stdin_stdout", "input": "3\n8\nBGBBGGBGBGGBBBGG\n5\nGGGGGBBBBB\n7\nGBGBBG... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWe have N voting papers. The i-th vote (1 \\leq i \\leq N) has the string S_i written on it.\n\nPrint all strings that are written on the most number of votes, in lexicographical order.\n\nConstraints\n\n* 1 \\leq N \\leq... | [{"type": "stdin_stdout", "input": "8\nfubfalo\nbuefalo\nbuffamo\nolaffub\nouafflb\nomaffub\nbuffalo\nbuofalf", "output": "buefalo\nbuffalo\nbuffamo\nbuofalf\nfubfalo\nolaffub\nomaffub\nouafflb\n"}, {"type": "stdin_stdout", "input": "8\nfubfalo\nbuefola\nbuffamo\nolaffub\nouafflb\nomaffub\nbuffalo\nbuofalf", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTakahashi has a tower which is divided into N layers. Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower. He defines the beauty of the t... | [{"type": "stdin_stdout", "input": "121980 33447 90629 11295524182", "output": "643972230\n"}, {"type": "stdin_stdout", "input": "111605 33447 77758 2284871002", "output": "762328834\n"}, {"type": "stdin_stdout", "input": "111605 33447 14069 2284871002", "output": "815838636\n"}, {"type": "stdin_stdout", "input": "4247... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTic-tac-toe is a game in which you win when you put β and Γ alternately in the 3 Γ 3 squares and line up β or Γ in one of the vertical, horizontal, and diagonal lines (Fig.). 1 to Fig. 3)\n\n<image> | <image> | <image>\n-... | [{"type": "stdin_stdout", "input": "ooosxssxs\nxooswsosx\nooxxxooxo", "output": "o\nd\nd\n"}, {"type": "stdin_stdout", "input": "oopsxssxs\nxooswsosx\noxooxxxoo", "output": "d\nd\nd\n"}, {"type": "stdin_stdout", "input": "oopsxrsxs\nxsoswsoox\nooooxxxox", "output": "d\nd\no\n"}, {"type": "stdin_stdout", "input": "xprmn... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nArtist Shinagawa was asked to exhibit n works. Therefore, I decided to exhibit the six sides of the cube colored with paint as a work. The work uses all six colors, Red, Yellow, Blue, Magenta, Green, and Cyan, and each si... | [{"type": "stdin_stdout", "input": "3\nCyan Yellow Red Magenta Green Blue\nCyan Yellow Red Magenta Green Blue\nRed Yellow Magenta Blue Green Cyan\n4\nRed Mahenta Blue Green Yellow Cyan\nRed Yellow Magenta Blue Green Cyan\nMagenta Green Red Cyan Yellow Blue\nCyan Green Yellow Blue Magenta Red\n0", "output": "1\n1\n"}, {... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice and Brown are brothers in a family and each receives pocket money in celebration of the coming year. They are very close and share the total amount of the money fifty-fifty. The pocket money each receives is a multi... | [{"type": "stdin_stdout", "input": "1001 20263", "output": "10632\n"}, {"type": "stdin_stdout", "input": "1011 20263", "output": "10637\n"}, {"type": "stdin_stdout", "input": "0010 12073", "output": "6041\n"}, {"type": "stdin_stdout", "input": "0000 12073", "output": "6036\n"}, {"type": "stdin_stdout", "input": "0001 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the Kingdom of IOI, the wind always blows from sea to land. There are $N + 1$ spots numbered from $0$ to $N$. The wind from Spot $0$ to Spot $N$ in order. Mr. JOI has a house at Spot $N$. The altitude of Spot $0$ is $A... | [{"type": "stdin_stdout", "input": "3 5 2 2\n0\n4\n2\n10\n2 0 1\n1 1 -3\n2 1 5\n1 2 -1\n1 2 5", "output": "-20\n-20\n-20\n-20\n-20\n"}, {"type": "stdin_stdout", "input": "3 5 2 2\n0\n4\n2\n11\n2 0 1\n1 1 -3\n2 1 7\n1 2 -1\n1 2 5", "output": "-22\n-22\n-22\n-22\n-22\n"}, {"type": "stdin_stdout", "input": "3 5 1 2\n0\n4\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA fraction whose numerator is 1 and whose denominator is a positive integer is called a unit fraction. A representation of a positive rational number p/q as the sum of finitely many unit fractions is called a partition of... | [{"type": "stdin_stdout", "input": "2 3 120 3\n2 3 300 3\n2 3 299 3\n2 3 12 3\n2 3 12000 7\n54 1343 12000 7\n2 3 300 1\n2 1 200 5\n2 4 54 2\n0 0 0 0", "output": "4\n7\n6\n2\n42\n0\n0\n9\n3\n"}, {"type": "stdin_stdout", "input": "2 3 120 3\n2 3 300 3\n2 3 299 3\n2 3 12 3\n2 3 12000 7\n54 795 12000 7\n2 4 300 1\n2 1 200 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nReordering the Documents\n\nSusan is good at arranging her dining table for convenience, but not her office desk.\n\nSusan has just finished the paperwork on a set of documents, which are still piled on her desk. They hav... | [{"type": "stdin_stdout", "input": "2 1\n0 1 -1 1 -1 -1", "output": "2\n"}, {"type": "stdin_stdout", "input": "6 3\n0 10 7 2 -1 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 6\n0 10 7 2 -1 2", "output": "0\n"}, {"type": "stdin_stdout", "input": "6 6\n0 10 7 3 -1 2", "output": "0\n"}, {"type": "stdin_stdout... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExpression Mining\n\nConsider an arithmetic expression built by combining single-digit positive integers with addition symbols `+`, multiplication symbols `*`, and parentheses `(` `)`, defined by the following grammar rul... | [{"type": "stdin_stdout", "input": "3\n(3+2)*3+1\n1\n1*1*1+1+1*1\n1307\n1*(2*3*4)+5+((5+7*8))*(9)\n0", "output": "2\n10\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*4+3\n1\n1*1*1+1*1*1\n1108\n1*(2*3*4)+5+((6+7*8))*(9)\n0", "output": "3\n12\n0\n"}, {"type": "stdin_stdout", "input": "3\n(1+2)*3+3\n1\n1*1*1+1+1*1\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTraining is indispensable for achieving good results at ICPC. Rabbit wants to win at ICPC, so he decided to practice today as well.\n\nToday's training is to increase creativity by drawing pictures. Let's draw a pattern w... | [{"type": "stdin_stdout", "input": "2\n1 3\n1 1\nRRRR\nRRGR\nRBRR\nRRRR", "output": "10\n"}, {"type": "stdin_stdout", "input": "2\n2 0\n1 1\nRRRR\nRRGR\nRBRR\nRRRR", "output": "16\n"}, {"type": "stdin_stdout", "input": "2\n2 0\n2 1\nRRRR\nRRGR\nRBRR\nRRRR", "output": "10\n"}, {"type": "stdin_stdout", "input": "2\n2 -1\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the International City of Pipe Construction, it is planned to repair the water pipe at a certain point in the water pipe network. The network consists of water pipe segments, stop valves and source point. A water pipe ... | [{"type": "stdin_stdout", "input": "4 1\n0 4 2 4\n0 2 1 2\n0 -1 2 0\n-1 0 1 0\n3 0 2 4\n0 -1\n1 1\n2 2\n1 4\n2 1", "output": "5.2360679775\n"}, {"type": "stdin_stdout", "input": "4 1\n0 4 2 8\n0 2 1 2\n0 -1 2 0\n-1 0 1 0\n3 0 2 4\n0 -1\n1 1\n2 2\n1 4\n2 1", "output": "9.7082039325\n"}, {"type": "stdin_stdout", "input":... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the Jambo Amusement Garden (JAG), you sell colorful drinks consisting of multiple color layers. This colorful drink can be made by pouring multiple colored liquids of different density from the bottom in order.\n\nYou ... | [{"type": "stdin_stdout", "input": "4\nred 3444\nred 3018\nred 3098\nred 3319\n4\nred\nred\nred\nred", "output": "Yes"}, {"type": "stdin_stdout", "input": "4\nred 3444\nred 3018\nred 3098\nred 3319\n4\nred\nred\nrec\nred", "output": "No\n"}, {"type": "stdin_stdout", "input": "4\nred 3444\nder 3018\nred 3098\nred 3319\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPriority queue is a container of elements which the element with the highest priority should be extracted first.\n\nFor $n$ priority queues $Q_i$ ($i = 0, 1, ..., n-1$) of integers, perform a sequence of the following ope... | [{"type": "stdin_stdout", "input": "2 10\n0 0 3\n0 0 17\n0 0 2\n1 0\n1 0\n1 0\n0 0 4\n1 0\n0 0 8\n1 0", "output": "17\n17\n17\n17\n17\n"}, {"type": "stdin_stdout", "input": "3 10\n0 0 3\n0 0 16\n0 0 0\n1 0\n2 1\n1 1\n0 0 4\n1 0\n0 1 10\n1 1", "output": "16\n16\n10\n"}, {"type": "stdin_stdout", "input": "2 10\n0 1 3\n0 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn Summer Informatics School, if a student doesn't behave well, teachers make a hole in his badge. And today one of the teachers caught a group of n students doing yet another trick. \n\nLet's assume that all these studen... | [{"type": "stdin_stdout", "input": "100\n73 81 39 85 48 49 37 20 66 41 79 32 54 71 31 50 48 29 10 85 81 20 20 20 48 54 70 40 71 31 49 77 50 33 12 87 19 12 54 39 87 10 20 39 81 18 70 53 86 7 33 37 62 9 77 54 50 30 70 81 66 12 41 12 20 23 87 73 91 75 94 49 18 71 81 32 79 85 30 94 48 10 41 62 73 90 40 70 90 91 33 100 79 9... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZibi is a competitive programming coach. There are n competitors who want to be prepared well. The training contests are quite unusual β there are two people in a team, two problems, and each competitor will code exactly ... | [{"type": "stdin_stdout", "input": "40 39\n0 -2\n-2 3\n3 3\n3 -2\n-1 1\n2 0\n-3 2\n-2 1\n0 -3\n-1 -3\n1 -1\n-3 -1\n2 2\n0 2\n1 -3\n-2 -1\n1 2\n-1 -2\n-1 0\n3 2\n1 3\n-3 1\n-2 -3\n-3 -1\n3 0\n-1 3\n3 1\n-2 2\n0 3\n3 -1\n2 -3\n1 1\n-1 -1\n0 1\n-3 0\n1 0\n-3 3\n-3 -3\n2 2\n-1 2\n1 29\n29 2\n29 3\n29 4\n5 29\n29 6\n7 29\n8... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou have got a shelf and want to put some books on it.\n\nYou are given q queries of three types:\n\n 1. L id β put a book having index id on the shelf to the left from the leftmost existing book; \n 2. R id β put a boo... | [{"type": "stdin_stdout", "input": "10\nL 100\nR 100000\nR 123\nL 101\n? 123\nL 10\nR 115\n? 100\nR 110\n? 115\n", "output": "0\n2\n1\n"}, {"type": "stdin_stdout", "input": "10\nL 100\nR 101000\nR 123\nL 101\n? 123\nL 10\nR 115\n? 100\nR 110\n? 115\n", "output": "0\n2\n1\n"}, {"type": "stdin_stdout", "input": "10\nL 10... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given two segments [l_1; r_1] and [l_2; r_2] on the x-axis. It is guaranteed that l_1 < r_1 and l_2 < r_2. Segments may intersect, overlap or even coincide with each other.\n\n<image> The example of two segments o... | [{"type": "stdin_stdout", "input": "5\n1 2 1 2\n2 6 3 4\n2 4 1 3\n1 2 1 3\n1 4 5 14\n", "output": "1 2\n2 3\n2 1\n1 3\n1 5\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 2\n1 6 3 4\n2 4 1 3\n1 2 1 3\n1 4 5 14\n", "output": "1 2\n1 3\n2 1\n1 3\n1 5\n"}, {"type": "stdin_stdout", "input": "5\n1 2 1 2\n1 6 5 4\n2 4 1 3\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecall that string a is a subsequence of a string b if a can be obtained from b by deletion of several (possibly zero or all) characters. For example, for the string a=\"wowwo\", the following strings are subsequences: \"... | [{"type": "stdin_stdout", "input": "ovvvvovovvvvovoovovovovvvvvvvoovoovvovvoooooovo\n", "output": "463\n"}, {"type": "stdin_stdout", "input": "vvovooovovvovoovoovvvvovovvvov\n", "output": "100\n"}, {"type": "stdin_stdout", "input": "vovvvovovvvvoovoovovvovooovovv\n", "output": "100\n"}, {"type": "stdin_stdout", "input"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe only difference between easy and hard versions is the number of elements in the array.\n\nYou are given an array a consisting of n integers. In one move you can choose any a_i and divide it by 2 rounding down (in othe... | [{"type": "stdin_stdout", "input": "50 50\n199987 199984 199987 199977 199996 199923 199984 199995 199991 200000 199998 199990 199983 199981 199973 199989 199981 199993 199959 199994 199973 199962 199998 199970 199999 199981 199996 199996 199985 199980 199959 199990 199982 199987 199992 199997 199985 199976 199947 1999... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAlice is playing a game with her good friend, Marisa.\n\nThere are n boxes arranged in a line, numbered with integers from 1 to n from left to right. Marisa will hide a doll in one of the boxes. Then Alice will have m cha... | [{"type": "stdin_stdout", "input": "8000 100\n7990 4432 5901 5019 423 1200 7760 5752 7422 4337 4802 2570 7354 4912 2185 2344 6538 2783 1473 5311 3987 4739 7159 1677 3438 502 2800 1318 5223 4518 4448 6451 3455 5012 1588 814 4971 5847 3849 6248 6420 3607 2610 6852 1045 3730 757 6905 5248 3738 2382 7251 1305 7380 2476 734... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKarlsson has recently discovered a huge stock of berry jam jars in the basement of the house. More specifically, there were 2n jars of strawberry and blueberry jam.\n\nAll the 2n jars are arranged in a row. The stairs to ... | [{"type": "stdin_stdout", "input": "4\n6\n1 1 1 1 2 1 2 1 2 1 1 1\n2\n2 2 1 2\n3\n1 1 1 1 1 1\n2\n2 1 2 1\n", "output": "12\n2\n6\n0\n"}, {"type": "stdin_stdout", "input": "4\n6\n2 2 2 1 2 2 2 1 2 2 1 2\n2\n2 2 1 2\n3\n1 1 1 1 2 1\n2\n2 1 1 1\n", "output": "10\n2\n4\n2\n"}, {"type": "stdin_stdout", "input": "4\n6\n1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe map of Bertown can be represented as a set of n intersections, numbered from 1 to n and connected by m one-way roads. It is possible to move along the roads from any intersection to any other intersection. The length ... | [{"type": "stdin_stdout", "input": "20 50\n20 3\n5 16\n1 3\n10 11\n10 15\n15 9\n20 9\n14 6\n16 5\n13 4\n11 5\n3 20\n13 17\n11 8\n11 6\n12 14\n16 18\n17 13\n18 7\n3 1\n8 10\n17 15\n7 2\n9 13\n5 11\n6 1\n2 16\n8 18\n10 8\n4 13\n9 15\n14 12\n1 6\n9 20\n7 18\n6 14\n7 6\n18 16\n2 7\n3 11\n15 17\n3 12\n14 10\n4 14\n19 4\n11 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIf the girl doesn't go to Denis, then Denis will go to the girl. Using this rule, the young man left home, bought flowers and went to Nastya. \n\nOn the way from Denis's house to the girl's house is a road of n lines. Thi... | [{"type": "stdin_stdout", "input": "30 8\n0 1 13 12 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 9 12 23 24 26 30\n40 7\n", "output": "30\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 9 12 23 24 26 30\n27 7\n", "output": "41\n"}, {"type": "stdin_stdout", "input": "30 8\n0 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe last contest held on Johnny's favorite competitive programming platform has been received rather positively. However, Johnny's rating has dropped again! He thinks that the presented tasks are lovely, but don't show th... | [{"type": "stdin_stdout", "input": "3\n576460752303423484\n576460752303423484\n576460752303423485\n", "output": "1152921504606846911\n1152921504606846911\n1152921504606846912\n"}, {"type": "stdin_stdout", "input": "3\n576460752303423484\n576460752303423484\n361364603326849558\n", "output": "1152921504606846911\n1152921... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMr. Chanek The Ninja is one day tasked with a mission to handle mad snakes that are attacking a site. Now, Mr. Chanek already arrived at the hills where the destination is right below these hills. The mission area can be ... | [{"type": "stdin_stdout", "input": "20 17 998\n1000 1000 295133\n1 1000 322998\n31 1 412809\n1 457 347941\n1000 579 600207\n1 708 315587\n1 159 302269\n1000 447 1582128\n247 1 591835\n933 1 16036\n140 1 305582\n1 1 147502\n1000 1 631288\n216 1000 145614\n402 1000 875933\n594 1000 874200\n1000 963 839096\n1 865 156116\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a rectangular grid with n rows and m columns. The cell located on the i-th row from the top and the j-th column from the left has a value a_{ij} written in it.\n\nYou can perform the following operation any ... | [{"type": "stdin_stdout", "input": "2\n2 2\n-1 1\n1 1\n3 4\n-1 -1 -2 -10\n0 -2 -5 -6\n-1 -3 -4 -5\n", "output": "2\n40\n"}, {"type": "stdin_stdout", "input": "2\n2 2\n-1 1\n1 1\n3 4\n-1 -1 -2 -3\n-1 -2 -3 -4\n-2 -1 -8 -5\n", "output": "2\n33\n"}, {"type": "stdin_stdout", "input": "2\n2 2\n-1 1\n1 1\n3 4\n-1 -1 -2 -3\n-... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFor the New Year, Polycarp decided to send postcards to all his n friends. He wants to make postcards with his own hands. For this purpose, he has a sheet of paper of size w Γ h, which can be cut into pieces.\n\nPolycarp ... | [{"type": "stdin_stdout", "input": "16\n8192 8192 67108864\n8192 8192 67108865\n8192 8192 70000000\n8192 8192 67108863\n1 1 1\n13 13 1\n1000 1000 100\n100 15 16\n157 185 95\n1992 1895 12\n1888 4984 164\n1564 8917 15\n150 15 2\n1500 10 40\n1 10000 1000\n1 10000 10000\n", "output": "YES\nNO\nNO\nYES\nYES\nYES\nNO\nNO\nNO... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGaurang has grown up in a mystical universe. He is faced by n consecutive 2D planes. He shoots a particle of decay age k at the planes.\n\nA particle can pass through a plane directly, however, every plane produces an ide... | [{"type": "stdin_stdout", "input": "37\n30 16\n22 37\n37 43\n25 31\n12 12\n15 30\n42 11\n29 28\n26 32\n12 32\n18 12\n11 48\n24 25\n15 40\n40 38\n17 12\n22 27\n35 32\n11 29\n35 24\n42 35\n21 14\n25 11\n16 14\n28 31\n49 45\n48 24\n28 20\n21 19\n43 49\n42 24\n14 21\n23 19\n19 16\n32 35\n28 10\n14 22\n", "output": "5006921... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLet's call a positive integer n ordinary if in the decimal notation all its digits are the same. For example, 1, 2 and 99 are ordinary numbers, but 719 and 2021 are not ordinary numbers.\n\nFor a given number n, find the ... | [{"type": "stdin_stdout", "input": "6\n1\n2\n3\n4\n5\n100\n", "output": "\n1\n2\n3\n4\n5\n18\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n3\n8\n10\n100\n", "output": "2\n2\n3\n8\n9\n18\n"}, {"type": "stdin_stdout", "input": "6\n2\n2\n3\n4\n10\n100\n", "output": "2\n2\n3\n4\n9\n18\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a directed graph G which can contain loops (edges from a vertex to itself). Multi-edges are absent in G which means that for all ordered pairs (u, v) exists at most one edge from u to v. Vertices are numbere... | [{"type": "stdin_stdout", "input": "1\n\n000110 0\n", "output": "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"}, {"type": "stdin_stdout", "inpu... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe problem describes the properties of a command line. The description somehow resembles the one you usually see in real operating systems. However, there are differences in the behavior. Please make sure you've read the... | [{"type": "stdin_stdout", "input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\n"}, {"type": "stdin_stdout", "input": "\"RUn.exe O\" \"\" \" 2ne, \" two! . \" \"\n", "output": "<RUn.exe O>\n<>\n< 2ne, >\n<two!>\n<.>\n< >\n"}, {"type": "stdin_stdout", "i... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLittle boy Petya loves stairs very much. But he is bored from simple going up and down them β he loves jumping over several stairs at a time. As he stands on some stair, he can either jump to the next one or jump over one... | [{"type": "stdin_stdout", "input": "500 50\n72 474 467 241 442 437 336 234 410 120 438 164 405 177 142 114 27 20 445 235 46 176 88 488 242 391 28 414 145 92 206 334 152 343 367 254 100 243 155 348 148 450 461 483 97 34 471 69 416 362\n", "output": "NO\n"}, {"type": "stdin_stdout", "input": "50 40\n14 27 19 30 31 20 28 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOur bear's forest has a checkered field. The checkered field is an n Γ n table, the rows are numbered from 1 to n from top to bottom, the columns are numbered from 1 to n from left to right. Let's denote a cell of the fie... | [{"type": "stdin_stdout", "input": "1000000000 1000000000 1000000000 100 -100 1000000000000000000\n", "output": "969796608 969796608\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000 1000000001 100 -100 1000000000000000000\n", "output": "599261184 599261185\n"}, {"type": "stdin_stdout", "input": "546978166 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFedya studies in a gymnasium. Fedya's maths hometask is to calculate the following expression:\n\n(1n + 2n + 3n + 4n) mod 5\n\nfor given value of n. Fedya managed to complete the task. Can you? Note that given number n ca... | [{"type": "stdin_stdout", "input": "124356983594583453458888889\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1134974\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1236642\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1068905\n", "output": "0\n"}, {"type": "stdin_stdout", "input": "1528... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVanya has a table consisting of 100 rows, each row contains 100 cells. The rows are numbered by integers from 1 to 100 from bottom to top, the columns are numbered from 1 to 100 from left to right. \n\nIn this table, Vany... | [{"type": "stdin_stdout", "input": "5\n4 11 20 20\n6 11 20 16\n5 1 33 15\n11 3 18 21\n3 2 14 21\n", "output": "1087\n"}, {"type": "stdin_stdout", "input": "5\n4 11 20 22\n6 11 20 16\n5 1 34 15\n11 3 18 21\n3 1 14 11\n", "output": "1028\n"}, {"type": "stdin_stdout", "input": "5\n4 11 20 38\n6 11 20 16\n5 2 19 15\n11 3 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are a lover of bacteria. You want to raise some bacteria in a box. \n\nInitially, the box is empty. Each morning, you can put any number of bacteria into the box. And each night, every bacterium in the box will split ... | [{"type": "stdin_stdout", "input": "1000000000\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "1000100000\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "1034416188\n", "output": "18\n"}, {"type": "stdin_stdout", "input": "1000100100\n", "output": "13\n"}, {"type": "stdin_stdout", "input": "34300081... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nEveryone knows that long ago on the territory of present-day Berland there lived Bindian tribes. Their capital was surrounded by n hills, forming a circle. On each hill there was a watchman, who watched the neighbourhood ... | [{"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 8097\n", "output": "45\n"}, {"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 8097 4894\n", "output": "38\n"}, {"type": "stdin_stdout", "input": "10\n8097 8097 8097 14160 8097 8097 8097 8097 9062 4894\n",... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Polycarp started to develop a text editor that works only with correct bracket sequences (abbreviated as CBS). \n\nNote that a bracket sequence is correct if it is possible to get a correct mathematical expressio... | [{"type": "stdin_stdout", "input": "92 51 18\n(()(((()())(()())())())(()())()()()())((()()())(())(())(()((())()())())(())())((())()())()()\nLRLRLLLLRRRLLRRLDLRLRRLRDLDLDLDDRRLRRRLLRDRLDDRLRRD\n", "output": "(()()()()())((()()())(())(())(()((())()())())(())())((())()())()()\n"}, {"type": "stdin_stdout", "input": "86 11 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBarney lives in country USC (United States of Charzeh). USC has n cities numbered from 1 through n and n - 1 roads between them. Cities and roads of USC form a rooted tree (Barney's not sure why it is rooted). Root of the... | [{"type": "stdin_stdout", "input": "85\n1 1 2 2 4 6 1 3 6 3 3 11 9 14 12 5 8 11 16 19 12 17 2 19 1 24 6 2 6 6 24 3 20 1 1 1 17 8 4 25 31 32 39 12 35 23 31 26 46 9 37 7 5 23 41 41 39 9 11 54 36 54 28 15 25 58 56 18 23 70 68 18 3 48 57 70 15 65 22 35 25 13 49 34\n", "output": "1.00000000 28.50000000 27.00000000 38.000000... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHarry Water, Ronaldo, Her-my-oh-knee and their friends have started a new school year at their MDCS School of Speechcraft and Misery. At the time, they are very happy to have seen each other after a long time. The sun is ... | [{"type": "stdin_stdout", "input": "2\n10\n10\n", "output": "200\n"}, {"type": "stdin_stdout", "input": "2\n19\n10\n", "output": "380\n"}, {"type": "stdin_stdout", "input": "2\n4\n18\n", "output": "144\n"}, {"type": "stdin_stdout", "input": "2\n6\n18\n", "output": "216\n"}, {"type": "stdin_stdout", "input": "2\n6\n23\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDasha logged into the system and began to solve problems. One of them is as follows:\n\nGiven two sequences a and b of length n each you need to write a sequence c of length n, the i-th element of which is calculated as f... | [{"type": "stdin_stdout", "input": "30 100 200\n102 108 122 116 107 145 195 145 119 110 187 196 140 174 104 190 193 181 118 127 157 111 139 175 173 191 181 105 142 166\n30 26 20 23 27 15 2 14 21 25 6 1 17 10 29 5 3 7 22 19 13 24 18 9 11 4 8 28 16 12\n", "output": "100 100 100 100 100 101 100 100 100 100 100 100 100 100... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are developing a new feature for the website which sells airline tickets: being able to sort tickets by price! You have already extracted the tickets' prices, so there's just the last step to be done...\n\nYou are giv... | [{"type": "stdin_stdout", "input": "10 54 100 27 1 33 27 80 49 27 6\n", "output": "1 6 27 27 27 33 49 54 80 100 "}, {"type": "stdin_stdout", "input": "10 54 100 28 1 33 27 80 49 27 6\n", "output": "1 6 27 27 28 33 49 54 80 100\n"}, {"type": "stdin_stdout", "input": "10 54 100 27 1 33 27 80 49 21 6\n", "output": "1 6 21... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a multiset of n integers. You should select exactly k of them in a such way that the difference between any two of them is divisible by m, or tell that it is impossible.\n\nNumbers can be repeated in the ori... | [{"type": "stdin_stdout", "input": "108 29 72\n738 192 711 235 288 288 679 36 785 233 706 71 216 144 216 1419 338 583 495 648 144 432 72 720 541 288 158 328 154 393 10 533 867 176 707 216 314 397 440 142 326 458 568 701 745 144 61 634 520 720 744 144 409 127 526 476 101 469 72 432 738 432 235 641 695 276 144 144 231 55... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe whole world got obsessed with robots,and to keep pace with the progress, great Berland's programmer Draude decided to build his own robot. He was working hard at the robot. He taught it to walk the shortest path from ... | [{"type": "stdin_stdout", "input": "RLRRRRRDRRDRRRRDLRRRRRRRDLRLDDLRRRRLDLDRDRRRRDRDRDRDLRRURRLRRRRDRRRRRRRRLDDRLRRDRRRRRRRDRDRLDRDDDRDR\n", "output": "BUG\n"}, {"type": "stdin_stdout", "input": "DDDDDDDDDDDDDDDDDDDDDDDDDLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRRRRRRRRRRRRRRRRRRRUUUUUUUUUUUUUUUUUUUUUUUU\n", "output": "BUG\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nImp likes his plush toy a lot.\n\n<image>\n\nRecently, he found a machine that can clone plush toys. Imp knows that if he applies the machine to an original toy, he additionally gets one more original toy and one copy, an... | [{"type": "stdin_stdout", "input": "1000000000 999999999\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000000000 1000000000\n", "output": "No\n"}, {"type": "stdin_stdout", "input": "1079372212 582938127\n", "output": "Yes\n"}, {"type": "stdin_stdout", "input": "1000001000 1000000000\n", "output": "No\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOne day Igor K. stopped programming and took up math. One late autumn evening he was sitting at a table reading a book and thinking about something. \n\nThe following statement caught his attention: \"Among any six people... | [{"type": "stdin_stdout", "input": "10\n1 2\n1 3\n1 4\n1 5\n2 3\n2 4\n2 5\n3 4\n3 5\n4 5\n", "output": "WIN\n"}, {"type": "stdin_stdout", "input": "9\n3 5\n3 2\n1 5\n4 3\n5 4\n1 4\n1 3\n4 2\n5 2\n", "output": "WIN\n"}, {"type": "stdin_stdout", "input": "9\n3 5\n2 5\n5 1\n4 5\n1 3\n3 2\n1 4\n4 3\n4 2\n", "output": "WIN\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLimak is an old brown bear.\nHe often goes bowling with his friends.\n\nFor rolling a ball one gets a score - a non-negative integer number of points.\nScore for the i-th roll is multiplied by i and scores are summed up.\... | [{"type": "stdin_stdout", "input": "15\n163004418 141715548 168024392 150391828 194860227 992288235 933539839 120817690 26026774 465544095 363334937 708292303 29566466 171450602 452807812", "output": "987375170\n"}, {"type": "stdin_stdout", "input": "15\n163004418 74928250 168024392 150391828 194860227 992288235 933539... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMa5termind and Subway are bored of their normal life.They want to do something interesting so that they can enjoy their last sem of college life.As usual Ma5termind comes up with a simple and interesting game.\n\nMa5termi... | [{"type": "stdin_stdout", "input": "a2b3c2a1\n4\n11\n18\n1\n13\n\nMLFP@S", "output": "-1\n-1\na\n-1\n"}, {"type": "stdin_stdout", "input": "b2b3c2a1\n4\n2\n11\n2\n10\n\nPAMSLE", "output": "b\n-1\nb\n-1\n"}, {"type": "stdin_stdout", "input": "a2b3c2a1\n4\n11\n18\n1\n8\n\nMLFP@S", "output": "-1\n-1\na\nc\n"}, {"type": "s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a mysterious temple in Mysteryland. The door of the temple is always closed.It can only be opened by a unique procedure.There are two boxes and N items outside the temple.Sherlock holmes visits the temple many ti... | [{"type": "stdin_stdout", "input": "3\n5\n4 3 4 10 1\n4\n1 2 3 4\n2\n2 2\n\nSAMPKE", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5\n4 3 4 10 1\n4\n1 0 3 4\n2\n2 2\n\nSAMPKE", "output": "YES\nYES\nYES\n"}, {"type": "stdin_stdout", "input": "3\n5\n3 5 8 5 1\n4\n1 3 2 4\n2\n1 1\n\nSAMPLE", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs predicted by the great Gods, Little Arjit has got nothing to do this summer. (Are you surprised?) But, he's not one of those people to lose hope... not so easily. He decided to work hard this summer on the two things h... | [{"type": "stdin_stdout", "input": "2\n12\n17\n\nT@MONE", "output": "208012\n129644790\n"}, {"type": "stdin_stdout", "input": "2\n8\n21\n\nMPEALS", "output": "1430\n24466267020\n"}, {"type": "stdin_stdout", "input": "2\n24\n3\n\nELAMPS", "output": "1289904147324\n5\n"}, {"type": "stdin_stdout", "input": "2\n8\n17\n\nEN... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nFennec is fighting with N monsters.\n\nThe health of the i-th monster is H_i.\n\nFennec can do the following two actions:\n\n* Attack: Fennec chooses one monster. That monster's health will decrease by 1.\n* Special Move:... | [{"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1010000000", "output": "3010000000\n"}, {"type": "stdin_stdout", "input": "3 0\n1000000000 1000000000 1110000000", "output": "3110000000\n"}, {"type": "stdin_stdout", "input": "3 0\n1100000000 1000000000 1110000000", "output": "3210000000\n"}, {"type": "std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou will be given a string S of length 3 representing the weather forecast for three days in the past.\n\nThe i-th character (1 \\leq i \\leq 3) of S represents the forecast for the i-th day. `S`, `C`, and `R` stand for s... | [{"type": "stdin_stdout", "input": "CSS\nBSR", "output": "1\n"}, {"type": "stdin_stdout", "input": "SRR\nSSR", "output": "2\n"}, {"type": "stdin_stdout", "input": "SSR\nRTS", "output": "0\n"}, {"type": "stdin_stdout", "input": "STR\nSTR", "output": "3\n"}, {"type": "stdin_stdout", "input": "RSR\nSSS", "output": "1\n"},... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNote the unusual memory limit.\n\nFor a rectangular grid where each square is painted white or black, we define its complexity as follows:\n\n* If all the squares are black or all the squares are white, the complexity is ... | [{"type": "stdin_stdout", "input": "10 12\n####..$\n....#.\n.#....\n....#.\n.####.#\n....\"#", "output": "5\n"}, {"type": "stdin_stdout", "input": "14 14\n.###$.$\n.#...-\n/...#.\n...-#.\n.####.#\n....##", "output": "5\n"}, {"type": "stdin_stdout", "input": "14 14\n.###$.$\n.#...-\n/...#.\n...-#.\n#.####.\n....##", "ou... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn your garden, there is a long and narrow flowerbed that stretches infinitely to the east. You have decided to plant N kinds of flowers in this empty flowerbed. For convenience, we will call these N kinds of flowers Flow... | [{"type": "stdin_stdout", "input": "1 1000000000\n1000000000000000000 1000000000", "output": "1999999999000000000"}, {"type": "stdin_stdout", "input": "3 17\n22 15\n10 10\n17 10", "output": "70\n"}, {"type": "stdin_stdout", "input": "3 17\n22 19\n10 10\n17 10", "output": "77\n"}, {"type": "stdin_stdout", "input": "3 27... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere is a set consisting of N distinct integers. The i-th smallest element in this set is S_i. We want to divide this set into two sets, X and Y, such that:\n\n* The absolute difference of any two distinct elements in X ... | [{"type": "stdin_stdout", "input": "8 2 9\n3\n4\n5\n13\n15\n22\n26\n32", "output": "13"}, {"type": "stdin_stdout", "input": "8 2 9\n3\n0\n5\n7\n15\n22\n26\n32", "output": "16"}, {"type": "stdin_stdout", "input": "8 2 9\n3\n0\n5\n7\n11\n22\n26\n32", "output": "10"}, {"type": "stdin_stdout", "input": "8 2 9\n3\n4\n5\n7\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSigma and Sugim are playing a game.\n\nThe game is played on a graph with N vertices numbered 1 through N. The graph has N-1 red edges and N-1 blue edges, and the N-1 edges in each color forms a tree. The red edges are re... | [{"type": "stdin_stdout", "input": "5 1 2\n1 2\n1 3\n1 4\n4 6\n2 1\n1 3\n1 5\n5 4", "output": "-1\n"}, {"type": "stdin_stdout", "input": "5 1 2\n1 2\n1 3\n1 4\n6 5\n2 1\n1 3\n1 5\n5 4", "output": "6\n"}, {"type": "stdin_stdout", "input": "5 1 2\n1 2\n1 3\n1 4\n4 5\n2 1\n1 3\n1 5\n5 4", "output": "6"}, {"type": "stdin_s... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe huge maze The Squares has been newly completed in the famous theme park. Evacuation drills must be conducted under the guidance of the fire department, but the time required for the drills cannot be predicted due to t... | [{"type": "stdin_stdout", "input": "10 3\n##########\n#E.......X\n##########\n4 4\n####\n#N.#\n#..X\n####\n5 5\n#####\n#N..#\n###.X\n#S..#\n#####\n6 6\n######\n#..#X#\n#.EE.#\n####N#\n#....#\n######\n8 8\n##X#####\n#....E.#\n#####.##\n#.#...##\n#.W.#..#\n#-#.N#.X\n#X##.#.#\n########\n0 0", "output": "8\nNA\n9\n16\n23\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nDr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram... | [{"type": "stdin_stdout", "input": "3 45\n110\n1\n100\n3 31\n100\n100\n34\n10 10\n0\n2\n3\n8\n5\n16\n21\n1\n56\n16\n0 0", "output": "0.51\n0.343333333333\n1.37666666667\n"}, {"type": "stdin_stdout", "input": "3 45\n110\n1\n100\n3 31\n100\n100\n34\n10 13\n0\n2\n3\n8\n5\n16\n21\n1\n56\n32\n0 0", "output": "0.51\n0.343333... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThis is the story of 20XX. The number of air passengers increased as a result of the stable energy supply by the renewable power network and the invention of liquefied synthetic fuel. However, the threat of terrorism by a... | [{"type": "stdin_stdout", "input": "6\n1 1\n.\n3 3\n...\n.W.\n...\n10 10\n..........\n.DDDDCCC..\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA..CCC..\n..CBBBBAAA\nAAABBBB...\n..BBBBB...\n..........\n10 10\n..........\n.DDDDDD...\n.DDDDCCC..\n.DDDDCCC..\nADDDDCCC..\nAAA.-CCC..\nAAABBBBC..\nAAABBBB...\n..BBBBB...\n..........\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are recording a result of a secret experiment, which consists of a large set of N-dimensional vectors. Since the result may become very large, you are thinking of compressing it. Fortunately you already have a good co... | [{"type": "stdin_stdout", "input": "16 4\n2.9498357179035515 3.940737376487606 2.8105250026221755 0.5153809858809549\n0.8717542191150367 2.4349144722266685 0.6044093106720025 1.0790706578914466\n1.8516458934245779 0.5815158140795751 2.050694060753176 1.2838449227433606", "output": "50.234435262\n"}, {"type": "stdin_std... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSunuke-kun's dictionary contains the words s1, ..., sn, which consist of n lowercase letters. This satisfies s1 <... <sn when compared in lexicographical order. Unfortunately, some characters are faint and unreadable. Unr... | [{"type": "stdin_stdout", "input": "2\n?rum??mer\nc??a??mp", "output": "715167440\n"}, {"type": "stdin_stdout", "input": "2\n?sum??mer\nc??a??mp", "output": "703286064"}, {"type": "stdin_stdout", "input": "2\n?rum??mer\nc@?a??mp", "output": "0\n"}, {"type": "stdin_stdout", "input": "2\n?rum??mer\ncA?a??mp", "output": "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nExample\n\nInput\n\n4\nDurett 7\nGayles 3\nFacenda 6\nDaughtery 0\n1\n+ Mccourtney 2\n\n\nOutput\n\nMccourtney is not working now.\nDurett is working hard now.\n\nThe input will be given via stdin and the output should be... | [{"type": "stdin_stdout", "input": "4\nDurett 10\nGayles 4\nF`cenda 10\nyrethguaD 0\n1\n+ Mccourtney 1", "output": "Mccourtney is not working now.\nF`cenda is working hard now.\n"}, {"type": "stdin_stdout", "input": "4\nDurett 10\nGaxles 4\nFacenda 10\nyrethguaD 0\n1\n+ yentruoccM 2", "output": "yentruoccM is not worki... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\n<image>\n\n\nAs shown in the figure above, cut a convex polygon g by a line p1p2 and print the area of the cut polygon which is on the left-hand side of the line.\n\ng is represented by a sequence of points p1, p2,..., pn... | [{"type": "stdin_stdout", "input": "4\n-2 1\n9 2\n3 5\n0 1\n2\n1 1 1 9\n-1 15 -1 0", "output": "0.257575758\n15.545454545\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n9 1\n2 5\n0 3\n2\n1 1 1 9\n0 15 -1 0", "output": "3.500000000\n20.994871795\n"}, {"type": "stdin_stdout", "input": "4\n-1 1\n9 1\n2 5\n0 3\n2\n1 1 1 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nTug of war is a sport that directly puts two teams against each other in a test of strength.\n\nDuring school days, both Chef Shifu and Chef Po were champions of tug of war.\nOn behalf of restaurant's anniversary, Chef Sh... | [{"type": "stdin_stdout", "input": "3\n-1 2\n0 -2\n-1 4", "output": "100000000000006\n0\n100000000000006\n"}, {"type": "stdin_stdout", "input": "3\n-1 1\n0 -2\n-14 4", "output": "100000000000006\n0\n23645636961410\n"}, {"type": "stdin_stdout", "input": "3\n-2 1\n0 -6\n-3 6", "output": "100000000000006\n0\n3173970899639... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA star is a figure of the following type: an asterisk character '*' in the center of the figure and four rays (to the left, right, top, bottom) of the same positive length. The size of a star is the length of its rays. Th... | [{"type": "stdin_stdout", "input": "100 3\n.*.\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n***\n**... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn order to make the \"Sea Battle\" game more interesting, Boris decided to add a new ship type to it. The ship consists of two rectangles. The first rectangle has a width of w_1 and a height of h_1, while the second rect... | [{"type": "stdin_stdout", "input": "100000000 100000000 100000000 100000000\n", "output": "600000004\n"}, {"type": "stdin_stdout", "input": "100000000 100000000 99999999 100000000\n", "output": "600000004\n"}, {"type": "stdin_stdout", "input": "100000000 100001000 99999999 100000000\n", "output": "600002004\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nNazar, a student of the scientific lyceum of the Kingdom of Kremland, is known for his outstanding mathematical abilities. Today a math teacher gave him a very difficult task.\n\nConsider two infinite sets of numbers. The... | [{"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "975735772\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000010000000\n", "output": "636734266\n"}, {"type": "stdin_stdout", "input": "100879890062904086 919413561635743169\n", "output": "824441806\n"}, {"type... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya loves lucky numbers. Everybody knows that lucky numbers are positive integers whose decimal representation contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.\n\... | [{"type": "stdin_stdout", "input": "00000000000000000000000000000000000000000000000000\n", "output": "-1\n"}, {"type": "stdin_stdout", "input": "110996812575168252737244204200508745829735318381381\n", "output": "7\n"}, {"type": "stdin_stdout", "input": "122094830270541438292052920866473330280784608392695\n", "output": ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nRecently Polycarp noticed that some of the buttons of his keyboard are malfunctioning. For simplicity, we assume that Polycarp's keyboard contains 26 buttons (one for each letter of the Latin alphabet). Each button is eit... | [{"type": "stdin_stdout", "input": "1\nammsdsdadasdsadssadassadsadasdsadsadr\n", "output": "adrs\n"}, {"type": "stdin_stdout", "input": "1\nammsdsdaeasdsadssadassadsadasdsadsads\n", "output": "ades\n"}, {"type": "stdin_stdout", "input": "1\nmlsjmksjfksjfkrjjksfnfksjfsksjdf\n", "output": "dfjklmnrs\n"}, {"type": "stdin_... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVasya had three strings a, b and s, which consist of lowercase English letters. The lengths of strings a and b are equal to n, the length of the string s is equal to m. \n\nVasya decided to choose a substring of the strin... | [{"type": "stdin_stdout", "input": "100 200\nboyjrjoeozwqgxexhcuioymcmnkvctbmnmsycolzhooftwndexqtwbttuwwfttaxymqsjiihgsdjasaxycgoznjiorzfiwabmhsg\nazrxzoqaombkfdlqocjgufzhtogekkfqqtkndjydeiulljvowvtvyszrlnvumwbflyyhlqrnthiqmguskrhzfktwcxdzidbyoqtn\nboyjrjoeozwqgxexhcuioymcmnkvctbmnmsycolzhooftwndexqtwbttuwwfttaxymqsjii... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nKaavi, the mysterious fortune teller, deeply believes that one's fate is inevitable and unavoidable. Of course, she makes her living by predicting others' future. While doing divination, Kaavi believes that magic spells c... | [{"type": "stdin_stdout", "input": "babbaaababbbbabbaaaababbbaabababbaabbaababbaaabaabbabaabbaababababbaabaaabaaaaababbaabaaaaabaabbabaaababbbb\nbbaabbbbabbbbaaaaaababbbabaaabbbbabababbbaabbbbbabaababbaabaaabaabbababababaaaaabaabbabaaabaaaaaaaaaaaaabbb\n", "output": "284471294"}, {"type": "stdin_stdout", "input": "bbbb... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nOh, no!\n\nThe coronavirus has caught you, and now you're sitting in a dark cellar, with tied legs (but not hands). You have a delicious cookie, a laptop in front of you, and your ideal development environment is open. Th... | [{"type": "stdin_stdout", "input": "3\n8707 7998 1614\n999941093851 131953876 8707\n", "output": "SMALL\n15155\nPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a directed graph of n vertices and m edges. Vertices are numbered from 1 to n. There is a token in vertex 1.\n\nThe following actions are allowed: \n\n * Token movement. To move the token from vertex u to v... | [{"type": "stdin_stdout", "input": "50 49\n1 3\n6 46\n47 25\n11 49\n47 10\n26 10\n12 38\n45 38\n24 39\n34 22\n36 3\n21 16\n43 44\n45 23\n2 31\n26 13\n28 42\n43 30\n12 27\n32 44\n24 25\n28 20\n15 19\n6 48\n41 7\n15 17\n8 9\n2 48\n33 5\n33 23\n4 19\n40 31\n11 9\n40 39\n35 27\n14 37\n32 50\n41 20\n21 13\n14 42\n18 30\n35 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nMonocarp wants to draw four line segments on a sheet of paper. He wants the i-th segment to have its length equal to a_i (1 β€ i β€ 4). These segments can intersect with each other, and each segment should be either horizon... | [{"type": "stdin_stdout", "input": "4\n1 1 5 4\n4 16 10 4\n2 1 4 1\n100 21 54 111\n", "output": "4\n40\n2\n2100\n"}, {"type": "stdin_stdout", "input": "4\n0 5 2 4\n6 14 10 3\n2 0 5 1\n101 40 47 111\n", "output": "0\n30\n0\n4040\n"}, {"type": "stdin_stdout", "input": "4\n1 1 5 8\n4 16 10 4\n2 1 4 1\n100 21 54 111\n", "o... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given three integers a, b, k.\n\nFind two binary integers x and y (x β₯ y) such that \n\n 1. both x and y consist of a zeroes and b ones; \n 2. x - y (also written in binary form) has exactly k ones. \n\nYou are ... | [{"type": "stdin_stdout", "input": "6565 1488 2427\n", "output": "Yes\n111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThere are n computers in a row, all originally off, and Phoenix wants to turn all of them on. He will manually turn on computers one at a time. At any point, if computer i-1 and computer i+1 are both on, computer i (2 β€ i... | [{"type": "stdin_stdout", "input": "400 234567899\n", "output": "\n20914007\n"}, {"type": "stdin_stdout", "input": "350 999999733\n", "output": "255248393\n"}, {"type": "stdin_stdout", "input": "398 999999733\n", "output": "875462745\n"}, {"type": "stdin_stdout", "input": "399 999999733\n", "output": "530105147\n"}, {"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nYou are given a sequence A, where its elements are either in the form + x or -, where x is an integer.\n\nFor such a sequence S where its elements are either in the form + x or -, define f(S) as follows:\n\n * iterate th... | [{"type": "stdin_stdout", "input": "15\n+ 2101039\n-\n+ 4567886\n+ 113371486\n-\n+ 578943\n-\n-\n+ 62356680\n-\n+ 711111\n-\n+ 797735011\n-\n-\n", "output": "431927902\n"}, {"type": "stdin_stdout", "input": "15\n+ 2168539\n-\n+ 4567886\n+ 113371486\n-\n+ 578943\n-\n-\n+ 62356680\n-\n+ 711111\n-\n+ 797735011\n-\n-\n", "... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nThe main server of Gomble company received a log of one top-secret process, the name of which can't be revealed. The log was written in the following format: Β«[date:time]: messageΒ», where for each Β«[date:time]Β» value exis... | [{"type": "stdin_stdout", "input": "14\n[12:07 p.m.]: mamaa\n[12:36 a.m.]: amaamppa\n[01:31 a.m.]: pmpp\n[05:47 a.m.]: paapappapaaampm\n[12:07 a.m.]: ppamammm\n[01:03 a.m.]: aapapmpampamamaaa\n[07:55 a.m.]: mpappmmapmpa\n[02:49 a.m.]: papmppppmpamppa\n[03:12 a.m.]: aaaaaaamam\n[04:40 a.m.]: paap\n[01:13 a.m.]: ap\n[03:... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSo, the Berland is at war with its eternal enemy Flatland again, and Vasya, an accountant, was assigned to fulfil his duty to the nation. \n\nRight now the situation in Berland is dismal β their both cities are surrounded... | [{"type": "stdin_stdout", "input": "1003 -5005 3399\n-10705 -1729 4365\n", "output": "2196.845285084989\n"}, {"type": "stdin_stdout", "input": "-9577 9051 5276\n-4315 -1295 3517\n", "output": "1407.1273140166404\n"}, {"type": "stdin_stdout", "input": "-9445 -9860 5513\n6291 -855 9034\n", "output": "1791.7043689042112\n... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nGerald has been selling state secrets at leisure. All the secrets cost the same: n marks. The state which secrets Gerald is selling, has no paper money, only coins. But there are coins of all positive integer denomination... | [{"type": "stdin_stdout", "input": "243\n", "output": " 1\n"}, {"type": "stdin_stdout", "input": "108\n", "output": " 2\n"}, {"type": "stdin_stdout", "input": "81\n", "output": " ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nHooray! Berl II, the king of Berland is making a knight tournament. The king has already sent the message to all knights in the kingdom and they in turn agreed to participate in this grand event.\n\nAs for you, you're jus... | [{"type": "stdin_stdout", "input": "11 8\n3 5 5\n8 9 9\n4 6 6\n8 10 10\n5 7 7\n2 7 2\n10 11 11\n1 11 1\n", "output": "0 1 5 5 6 7 2 9 10 11 1 \n"}, {"type": "stdin_stdout", "input": "11 7\n7 8 8\n5 6 5\n1 3 3\n7 9 9\n5 10 10\n10 11 11\n1 11 4\n", "output": "3 3 4 0 10 5 8 9 10 11 4 \n"}, {"type": "stdin_stdout", "input... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nVanya loves playing. He even has a special set of cards to play with. Each card has a single integer. The number on the card can be positive, negative and can even be equal to zero. The only limit is, the number on each c... | [{"type": "stdin_stdout", "input": "123 222\n44 -190 -188 -185 -55 17 190 176 157 176 -24 -113 -54 -61 -53 53 -77 68 -12 -114 -217 163 -122 37 -37 20 -108 17 -140 -210 218 19 -89 54 18 197 111 -150 -36 -131 -172 36 67 16 -202 72 169 -137 -34 -122 137 -72 196 -17 -104 180 -102 96 -69 -184 21 -15 217 -61 175 -221 62 173 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nSummer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n lines and m columns. Let number a[i][j] represents the calories burned... | [{"type": "stdin_stdout", "input": "4 5\n87882 40786 3691 85313 46694\n28884 16067 3242 97367 78518\n4250 35501 9780 14435 19004\n64673 65438 56977 64495 27280\n", "output": "747898\n"}, {"type": "stdin_stdout", "input": "4 5\n2274 40786 3691 98933 46694\n28884 16067 3242 97367 73338\n8377 57682 9780 14435 19004\n64673... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPetya and Gena love playing table tennis. A single match is played according to the following rules: a match consists of multiple sets, each set consists of multiple serves. Each serve is won by one of the players, this p... | [{"type": "stdin_stdout", "input": "186\n2 1 2 1 1 1 1 1 2 1 1 2 2 2 1 1 2 2 1 1 1 2 1 1 2 2 1 1 1 2 2 1 1 1 1 1 2 1 1 1 2 1 2 1 1 2 1 1 1 2 2 2 2 2 2 2 1 2 1 2 1 1 2 1 2 2 1 1 1 1 1 2 2 1 2 2 1 2 2 1 1 1 2 2 1 1 2 2 1 2 2 1 2 2 2 2 2 1 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 1 2 1 1 2 2 1 2 2 1 1 1 1 1 2 2 1 1 2 2 1 2 2 2 1 2... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhile Mike was walking in the subway, all the stuff in his back-bag dropped on the ground. There were several fax messages among them. He concatenated these strings in some order and now he has string s.\n\n<image>\n\nHe ... | [{"type": "stdin_stdout", "input": "uqurdorwgtukbijpzhrpqoazllayzteqmeqhbgwvrgsiegiaaujtnxlzmihqyefraxpgywiauawpexgpazhqblryvremznotyklfiernvusugwlupadltrsbfvezbdbbyeetmwlkblwnidxchmwtzmrwdvlddwzbeswwpkizbqaghtrvalqickozbwfsqbcfjlbgttptlsqitjufjhsnjndvihtcdgsgntlqnzzeqcrmuxmrixmzreysejvrudqurnorhrlseammogstjseshstzxxtf... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nLimak is an old brown bear. He often plays poker with his friends. Today they went to a casino. There are n players (including Limak himself) and right now all of them have bids on the table. i-th of them has bid with siz... | [{"type": "stdin_stdout", "input": "50\n840868705 387420489 387420489 795385082 634350497 206851546 536870912 536870912 414927754 306894916 387420489 536870912 387420489 149011306 373106005 536870912 700746206 387420489 777952883 847215247 176645254 576664386 387420489 230876513 536870912 536870912 536870912 387420489 ... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAfter making bad dives into swimming pools, Wilbur wants to build a swimming pool in the shape of a rectangle in his backyard. He has set up coordinate axes, and he wants the sides of the rectangle to be parallel to them.... | [{"type": "stdin_stdout", "input": "4\n-474 -894\n-474 -833\n-446 -894\n-446 -833\n", "output": "1708\n"}, {"type": "stdin_stdout", "input": "4\n-796 -330\n-796 758\n171 -330\n171 758\n", "output": "1052096\n"}, {"type": "stdin_stdout", "input": "4\n-414 -891\n-414 896\n346 -891\n346 896\n", "output": "1358120\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA flowerbed has many flowers and two fountains.\n\nYou can adjust the water pressure and set any values r1(r1 β₯ 0) and r2(r2 β₯ 0), giving the distances at which the water is spread from the first and second fountain respe... | [{"type": "stdin_stdout", "input": "10 -49 10 104 36\n30 114\n82 -379\n-49 25\n142 -38\n-5 138\n20 20\n5 -1\n45 -28\n-288 -6\n-2 45\n", "output": "168482\n"}, {"type": "stdin_stdout", "input": "10 -49 10 180 36\n30 114\n82 -379\n-49 25\n142 -38\n-5 138\n20 20\n5 -1\n45 -28\n-288 -6\n-2 45\n", "output": "168482\n"}, {"t... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nA sportsman starts from point xstart = 0 and runs to point with coordinate xfinish = m (on a straight line). Also, the sportsman can jump β to jump, he should first take a run of length of not less than s meters (in this ... | [{"type": "stdin_stdout", "input": "100 1000 1 5\n204 233 384 776 450 649 473 717 55 90 208 951 499 551 916 18 539 103 420 521 730 779 360 546 746 953 484 82 110 789 161 950 71 806 928 652 510 287 997 967 329 786 643 431 321 663 279 291 799 986 848 680 131 225 918 801 567 369 687 209 602 401 952 930 442 853 606 338 129... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIt is well known that the planet suffers from the energy crisis. Little Petya doesn't like that and wants to save the world. For this purpose he needs every accumulator to contain the same amount of energy. Initially ever... | [{"type": "stdin_stdout", "input": "104 54\n683 252 125 813 874 835 651 424 826 139 397 323 143 153 326 941 536 435 317 854 353 222 851 591 420 415 190 872 178 311 612 635 174 505 153 81 559 815 805 414 378 62 75 929 208 942 254 670 329 671 127 494 504 618 292 699 203 959 218 788 285 602 83 104 41 562 272 806 4 582 780... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nZS the Coder has recently found an interesting concept called the Birthday Paradox. It states that given a random set of 23 people, there is around 50% chance that some two of them share the same birthday. ZS the Coder fi... | [{"type": "stdin_stdout", "input": "1000000000000000010 1000000000000000000\n", "output": "954414 954414\n"}, {"type": "stdin_stdout", "input": "1000000000000000000 1000000000000000000\n", "output": "906300 906300"}, {"type": "stdin_stdout", "input": "1002926547994558173 397746475431992189\n", "output": "145788 145788\... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nBob recently read about bitwise operations used in computers: AND, OR and XOR. He have studied their properties and invented a new game.\n\nInitially, Bob chooses integer m, bit depth of the game, which means that all num... | [{"type": "stdin_stdout", "input": "17 15\na := 010000111111110\nb := 101100110000100\nc := 100101100100111\nd := 010110101110110\ne := 111111000010110\nf := 011001110111110\ng := 110011010100101\nh := 000001010010001\ni := 110000111001011\nj := 000010000010111\nk := 110110111110110\nl := 010000110000100\nm := 00011110... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nPolycarp has just invented a new binary protocol for data transmission. He is encoding positive integer decimal number to binary string using following algorithm:\n\n * Each digit is represented with number of '1' charac... | [{"type": "stdin_stdout", "input": "89\n11111111101111111110111111111011111111101111111110111111111011111111101111111110111111111\n", "output": "999999999\n"}, {"type": "stdin_stdout", "input": "53\n10110111011110111110111111011111110111111110011111111\n", "output": "1234567808\n"}, {"type": "stdin_stdout", "input": "5... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nIn the computer network of the Berland State University there are n routers numbered from 1 to n. Some pairs of routers are connected by patch cords. Information can be transmitted over patch cords in both direction. The ... | [{"type": "stdin_stdout", "input": "10\n2:7,4-2:5,8-1:3-1:6-1:2-2:10,9\n9:6,7,3,4,10,8,9,5,1\n9:2,1,7,6,9,4,8,10,5\n8:5,2,1,3,6,9,10,8-1:7\n1:8-8:9,10,2,6,3,1,7,4\n9:8,4,1,2,10,9,7,3,5\n9:1,3,6,2,9,10,5,8,4\n9:5,2,7,3,6,4,10,1,9\n9:3,7,6,8,10,5,1,2,4\n1:9-8:2,7,3,6,8,5,1,4\n", "output": "9\n1 2\n1 3\n1 4\n1 5\n1 6\n1 1... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nWhat are you doing at the end of the world? Are you busy? Will you save us?\n\n<image>\n\nNephren is playing a game with little leprechauns.\n\nShe gives them an infinite array of strings, f0... β.\n\nf0 is \"What are you... | [{"type": "stdin_stdout", "input": "10\n100000 873326525630182716\n100000 620513733919162415\n100000 482953375281256917\n100000 485328193417229962\n100000 353549227094721271\n100000 367447590857326107\n100000 627193846053528323\n100000 243833127760837417\n100000 287297493528203749\n100000 70867563577617188\n", "output"... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nAs we all know, Max is the best video game player among her friends. Her friends were so jealous of hers, that they created an actual game just to prove that she's not the best at games. The game is played on a directed a... | [{"type": "stdin_stdout", "input": "100 1\n92 93 p\n", "output": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\nBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB... | code_stdio |
[
{
"content": "Solve the following coding problem using the programming language python:\n\nStudents love to celebrate their holidays. Especially if the holiday is the day of the end of exams!\n\nDespite the fact that Igor K., unlike his groupmates, failed to pass a programming test, he decided to invite them to... | [{"type": "stdin_stdout", "input": "50 1000 49\n", "output": "YES\n1 1000.00000000000000000000 2 20.40816326530612201395 \n2 979.59183673469385666976 3 40.81632653061224402791 \n3 959.18367346938771333953 4 61.22448979591836604186 \n4 938.77551020408168369613 5 81.63265306122448805581 \n5 918.36734693877554036590 6 102... | code_stdio |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.